From a49a69824c6b31f30c8b9e75ff52c2d64d9118a0 Mon Sep 17 00:00:00 2001 From: Mike Greenberg Date: Mon, 4 Jan 2021 17:22:39 -0500 Subject: [PATCH 1/2] docs: Update README and docker-compose to require use of TimescaleDB v1.7 --- README.md | 19 +++---------------- docker-compose.yml | 2 +- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index e31768d72..a88fed27c 100644 --- a/README.md +++ b/README.md @@ -22,27 +22,14 @@ Build the `sentinel-visor` binary to the root of the project directory: $ make build ``` -Install PostgreSQL: +Install TimescaleDB v1.7.4: -```sh -brew install postgresql@12 -``` - -Install TimescaleDB: - -```sh -brew tap timescale/tap -brew install timescaledb -``` - -You may need to run the following _before_ installing timescale to get it to compile: +In a separate shell, use docker-compose to start the appropriate version of Postgres with TimescaleDB. (Note: Visor requires TimescaleDB v1.7.x and will not work with v2.0.) ```sh -ln -s /usr/local/Cellar/postgresql@12/12.5/include/postgresql/server /usr/local/Cellar/postgresql@12/12.5/include/server +docker-compose up --build timescaledb ``` -Run `timescaledb-tune` and/or activate TimescaleDB by adding `shared_preload_libraries = 'timescaledb'` to `postgresql.conf`. Ensure you run `timescaledb_move.sh` as homebrew asks to finish the installation and then restart the postgres server if it's running. - ### Running tests Create a new DB in postgres for testing: diff --git a/docker-compose.yml b/docker-compose.yml index b5fcb2915..c59841780 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3.5' services: timescaledb: container_name: timescaledb - image: timescale/timescaledb:latest-pg12 + image: timescale/timescaledb:1.7.4-pg12 ports: - "5432:5432" environment: From 1b7feebada56316097b55ad05435431e438096bf Mon Sep 17 00:00:00 2001 From: Mike Greenberg Date: Tue, 12 Jan 2021 10:34:24 -0500 Subject: [PATCH 2/2] chore(docs): Include quick testing blurb --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index a88fed27c..bfc82929e 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,12 @@ docker-compose up --build timescaledb ### Running tests +To quickly run tests, you can provide the `VISOR_TEST_DB` envvar and execute `make test` like so: + +`VISOR_TEST_DB="postgres://postgres:password@localhost:5432/postgres?sslmode=disable" make test` + +For more, manual test running, you could also prepare your environment in the following way: + Create a new DB in postgres for testing: ```sql