From 7991125f568a721bb1a05b4d851e1b652afabdd6 Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 20 Nov 2020 13:20:11 -0800 Subject: [PATCH 1/3] add setup script --- src/database_metrics/setup.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/database_metrics/setup.sh diff --git a/src/database_metrics/setup.sh b/src/database_metrics/setup.sh new file mode 100644 index 0000000..e69de29 From 5ae891fb985cea1a108c370fcbd593eafd0597fd Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 20 Nov 2020 13:22:07 -0800 Subject: [PATCH 2/3] Update readme --- src/database_metrics/README.md | 3 ++- src/database_metrics/setup.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/database_metrics/README.md b/src/database_metrics/README.md index 3ffd759..4592d3d 100644 --- a/src/database_metrics/README.md +++ b/src/database_metrics/README.md @@ -6,7 +6,8 @@ This module contains methods for collecting metrics on the database server under install Docker and clone all the relevant repositories to a working directory. Do not build the images yet. 2. Obtain the test data you will be running. Place it into a `common_full/`folder in the same working directory, with sub folders corresponding to the production ingestion structure: `common_full/covidcast/receiving//filename` -3. Before building the images, you will need to make two edits: +3. Before building the images, you will need to make two edits. These can be achieved by navigating to the +`repos/delphi/operations/src/database_metrics/` directory and running `setup.sh` (you may have to chmod u+x) the file: a. Edit `repos/delphi/operations/src/secrets.py` by setting `db.host = 'delphi_database_epidata'` and `set db.epi = ('user', 'pass')`, which will match the testing docker image. b. Add `COPY common_full common_full` to `repos/delphi/operations/dev/docker/python/Dockerfile` after copying source files. diff --git a/src/database_metrics/setup.sh b/src/database_metrics/setup.sh index e69de29..883f05d 100644 --- a/src/database_metrics/setup.sh +++ b/src/database_metrics/setup.sh @@ -0,0 +1,3 @@ +sed -i "s/'{SECRET_DB_HOST}'/'delphi_database_epidata'/g" ../secrets.py +sed -i "s/('{SECRET_DB_USERNAME_EPI}', '{SECRET_DB_PASSWORD_EPI}')/('user', 'pass')/g" ../secrets.py +printf "\n# Copy test files\nCOPY common_full common_full\n" >> ../../dev/docker/python/Dockerfile \ No newline at end of file From fe3166abfc3a41d714e002960ccd94d795f9e949 Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 20 Nov 2020 13:45:01 -0800 Subject: [PATCH 3/3] Update readme --- src/database_metrics/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/database_metrics/README.md b/src/database_metrics/README.md index 4592d3d..66362b2 100644 --- a/src/database_metrics/README.md +++ b/src/database_metrics/README.md @@ -7,7 +7,8 @@ install Docker and clone all the relevant repositories to a working directory. D 2. Obtain the test data you will be running. Place it into a `common_full/`folder in the same working directory, with sub folders corresponding to the production ingestion structure: `common_full/covidcast/receiving//filename` 3. Before building the images, you will need to make two edits. These can be achieved by navigating to the -`repos/delphi/operations/src/database_metrics/` directory and running `setup.sh` (you may have to chmod u+x) the file: +`repos/delphi/operations/src/database_metrics/` directory and running `setup.sh` (you may have to chmod u+x the file), +or by following the steps below. Do not commit these edits. a. Edit `repos/delphi/operations/src/secrets.py` by setting `db.host = 'delphi_database_epidata'` and `set db.epi = ('user', 'pass')`, which will match the testing docker image. b. Add `COPY common_full common_full` to `repos/delphi/operations/dev/docker/python/Dockerfile` after copying source files.