diff --git a/src/database_metrics/README.md b/src/database_metrics/README.md index 3ffd759..66362b2 100644 --- a/src/database_metrics/README.md +++ b/src/database_metrics/README.md @@ -6,7 +6,9 @@ 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), +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. diff --git a/src/database_metrics/setup.sh b/src/database_metrics/setup.sh new file mode 100644 index 0000000..883f05d --- /dev/null +++ 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