Skip to content

[Database metrics] Setup shell script #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/database_metrics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<data_source>/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.
Expand Down
3 changes: 3 additions & 0 deletions src/database_metrics/setup.sh
Original file line number Diff line number Diff line change
@@ -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