From baefc7e5327d68be7f4f79a9d188b886c03f64dc Mon Sep 17 00:00:00 2001 From: george haff Date: Mon, 10 Oct 2022 11:31:18 -0400 Subject: [PATCH 1/4] remove references to database docker definition in delphi/operations also some documentation updates we havent needed `dev/docker/database/Dockerfile` from `delphi/operations` since the v4 merge, which moved to building on a Percona container --- .github/workflows/ci.yaml | 1 - dev/docker/database/epidata/Dockerfile | 2 +- dev/docker/database/epidata/README.md | 8 ++++---- dev/local/Makefile | 6 +----- docs/epidata_development.md | 4 ++-- docs/new_endpoint_tutorial.md | 2 -- 6 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f9d447331..37bd86703 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,7 +51,6 @@ jobs: - name: Build docker images run: | - docker build -t delphi_database -f repos/delphi/operations/dev/docker/database/Dockerfile . docker build -t delphi_python -f repos/delphi/operations/dev/docker/python/Dockerfile . docker build -t delphi_database_epidata -f ./repos/delphi/delphi-epidata/dev/docker/database/epidata/Dockerfile . docker build -t delphi_web_python -f repos/delphi/delphi-epidata/dev/docker/python/Dockerfile . diff --git a/dev/docker/database/epidata/Dockerfile b/dev/docker/database/epidata/Dockerfile index bd0ac37b5..5531679c6 100644 --- a/dev/docker/database/epidata/Dockerfile +++ b/dev/docker/database/epidata/Dockerfile @@ -13,7 +13,7 @@ ENV MYSQL_ROOT_PASSWORD pass # create the `epidata` database ENV MYSQL_DATABASE epidata -# create the `epi` user account with a development-only password +# create the `user` account with a development-only password ENV MYSQL_USER user ENV MYSQL_PASSWORD pass diff --git a/dev/docker/database/epidata/README.md b/dev/docker/database/epidata/README.md index 51c11fd2d..569f9fe6f 100644 --- a/dev/docker/database/epidata/README.md +++ b/dev/docker/database/epidata/README.md @@ -1,10 +1,10 @@ # `delphi_database_epidata` -This image extends Delphi's database by: +This image extends a Percona database by: -- adding the `epi` user account -- adding the `epidata` database -- creating empty tables in `epidata` +- adding the `user` account +- adding the `epidata` & other appropriate databases +- creating empty tables in those databases To start a container from this image, run: diff --git a/dev/local/Makefile b/dev/local/Makefile index 48c63a958..69d0889b0 100644 --- a/dev/local/Makefile +++ b/dev/local/Makefile @@ -78,7 +78,7 @@ web: @# Build the web_epidata image @cd repos/delphi/delphi-epidata;\ docker build -t delphi_web_epidata -f ./devops/Dockerfile .;\ - cd ../../../ + cd - @# Run the web server @docker run --rm -p 127.0.0.1:10080:80 \ @@ -97,10 +97,6 @@ db: @# Setup virtual network if it doesn't exist @docker network ls | grep delphi-net || docker network create --driver bridge delphi-net - @# Only build prereqs if we need them - @docker images delphi_database | grep delphi || \ - docker build -t delphi_database -f repos/delphi/operations/dev/docker/database/Dockerfile . - @# Build the database_epidata image @docker build -t delphi_database_epidata \ -f repos/delphi/delphi-epidata/dev/docker/database/epidata/Dockerfile . diff --git a/docs/epidata_development.md b/docs/epidata_development.md index 6f353d4ac..44d13a348 100644 --- a/docs/epidata_development.md +++ b/docs/epidata_development.md @@ -119,8 +119,8 @@ above. The base images are built first, followed by the derived the Epidata API to the `delphi_web` image. - The [`delphi_database_epidata` image](https://github.com/cmu-delphi/delphi-epidata/blob/main/dev/docker/database/epidata/README.md) - adds the `epi` user account, `epidata` database, and relevant tables - (initially empty) to the `delphi_database` image. + adds user accounts, `epidata` & other appropriate databases, and relevant tables + (initially empty) to a Percona database image. From the root of your workspace, all of the images can be built as follows: diff --git a/docs/new_endpoint_tutorial.md b/docs/new_endpoint_tutorial.md index 7f562fa10..bd5634c9e 100644 --- a/docs/new_endpoint_tutorial.md +++ b/docs/new_endpoint_tutorial.md @@ -277,8 +277,6 @@ docker build -t delphi_web \ -f repos/delphi/operations/dev/docker/web/Dockerfile . docker build -t delphi_web_epidata \ -f repos/delphi/delphi-epidata/dev/docker/web/epidata/Dockerfile . -docker build -t delphi_database \ - -f repos/delphi/operations/dev/docker/database/Dockerfile . docker build -t delphi_database_epidata \ -f repos/delphi/delphi-epidata/dev/docker/database/epidata/Dockerfile . From 421b9da1ab40372a435c54335b4a8d450f2c4f89 Mon Sep 17 00:00:00 2001 From: george haff Date: Mon, 10 Oct 2022 11:53:00 -0400 Subject: [PATCH 2/4] update Dockerfile comment with reference to required Dockerfile from delphi/operations repo --- dev/docker/python/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/docker/python/Dockerfile b/dev/docker/python/Dockerfile index 07d2c6d3b..40a89b567 100644 --- a/dev/docker/python/Dockerfile +++ b/dev/docker/python/Dockerfile @@ -1,4 +1,4 @@ -# start with the `delphi_python` image +# start with the `delphi_python` image, which is built from repos/delphi/operations/dev/docker/python/Dockerfile FROM delphi_python RUN pip install --no-cache-dir -r repos/delphi/delphi-epidata/requirements.txt -r repos/delphi/delphi-epidata/requirements.dev.txt From 65bd5da010bf2e26f1767be6782952c35ba481a3 Mon Sep 17 00:00:00 2001 From: george haff Date: Mon, 10 Oct 2022 11:31:18 -0400 Subject: [PATCH 3/4] remove references to database docker definition in delphi/operations also some documentation updates we havent needed `dev/docker/database/Dockerfile` from `delphi/operations` since the v4 merge, which moved to building on a Percona container --- .github/workflows/ci.yaml | 1 - dev/docker/database/epidata/Dockerfile | 2 +- dev/docker/database/epidata/README.md | 8 ++++---- dev/local/Makefile | 6 +----- docs/epidata_development.md | 4 ++-- docs/new_endpoint_tutorial.md | 2 -- 6 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f9d447331..37bd86703 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,7 +51,6 @@ jobs: - name: Build docker images run: | - docker build -t delphi_database -f repos/delphi/operations/dev/docker/database/Dockerfile . docker build -t delphi_python -f repos/delphi/operations/dev/docker/python/Dockerfile . docker build -t delphi_database_epidata -f ./repos/delphi/delphi-epidata/dev/docker/database/epidata/Dockerfile . docker build -t delphi_web_python -f repos/delphi/delphi-epidata/dev/docker/python/Dockerfile . diff --git a/dev/docker/database/epidata/Dockerfile b/dev/docker/database/epidata/Dockerfile index bd0ac37b5..5531679c6 100644 --- a/dev/docker/database/epidata/Dockerfile +++ b/dev/docker/database/epidata/Dockerfile @@ -13,7 +13,7 @@ ENV MYSQL_ROOT_PASSWORD pass # create the `epidata` database ENV MYSQL_DATABASE epidata -# create the `epi` user account with a development-only password +# create the `user` account with a development-only password ENV MYSQL_USER user ENV MYSQL_PASSWORD pass diff --git a/dev/docker/database/epidata/README.md b/dev/docker/database/epidata/README.md index 51c11fd2d..569f9fe6f 100644 --- a/dev/docker/database/epidata/README.md +++ b/dev/docker/database/epidata/README.md @@ -1,10 +1,10 @@ # `delphi_database_epidata` -This image extends Delphi's database by: +This image extends a Percona database by: -- adding the `epi` user account -- adding the `epidata` database -- creating empty tables in `epidata` +- adding the `user` account +- adding the `epidata` & other appropriate databases +- creating empty tables in those databases To start a container from this image, run: diff --git a/dev/local/Makefile b/dev/local/Makefile index 48c63a958..69d0889b0 100644 --- a/dev/local/Makefile +++ b/dev/local/Makefile @@ -78,7 +78,7 @@ web: @# Build the web_epidata image @cd repos/delphi/delphi-epidata;\ docker build -t delphi_web_epidata -f ./devops/Dockerfile .;\ - cd ../../../ + cd - @# Run the web server @docker run --rm -p 127.0.0.1:10080:80 \ @@ -97,10 +97,6 @@ db: @# Setup virtual network if it doesn't exist @docker network ls | grep delphi-net || docker network create --driver bridge delphi-net - @# Only build prereqs if we need them - @docker images delphi_database | grep delphi || \ - docker build -t delphi_database -f repos/delphi/operations/dev/docker/database/Dockerfile . - @# Build the database_epidata image @docker build -t delphi_database_epidata \ -f repos/delphi/delphi-epidata/dev/docker/database/epidata/Dockerfile . diff --git a/docs/epidata_development.md b/docs/epidata_development.md index 6f353d4ac..44d13a348 100644 --- a/docs/epidata_development.md +++ b/docs/epidata_development.md @@ -119,8 +119,8 @@ above. The base images are built first, followed by the derived the Epidata API to the `delphi_web` image. - The [`delphi_database_epidata` image](https://github.com/cmu-delphi/delphi-epidata/blob/main/dev/docker/database/epidata/README.md) - adds the `epi` user account, `epidata` database, and relevant tables - (initially empty) to the `delphi_database` image. + adds user accounts, `epidata` & other appropriate databases, and relevant tables + (initially empty) to a Percona database image. From the root of your workspace, all of the images can be built as follows: diff --git a/docs/new_endpoint_tutorial.md b/docs/new_endpoint_tutorial.md index 7f562fa10..bd5634c9e 100644 --- a/docs/new_endpoint_tutorial.md +++ b/docs/new_endpoint_tutorial.md @@ -277,8 +277,6 @@ docker build -t delphi_web \ -f repos/delphi/operations/dev/docker/web/Dockerfile . docker build -t delphi_web_epidata \ -f repos/delphi/delphi-epidata/dev/docker/web/epidata/Dockerfile . -docker build -t delphi_database \ - -f repos/delphi/operations/dev/docker/database/Dockerfile . docker build -t delphi_database_epidata \ -f repos/delphi/delphi-epidata/dev/docker/database/epidata/Dockerfile . From c9e896b04cd2e01fc737a8ca247ae650a6aec748 Mon Sep 17 00:00:00 2001 From: george haff Date: Mon, 10 Oct 2022 11:53:00 -0400 Subject: [PATCH 4/4] update Dockerfile comment with reference to required Dockerfile from delphi/operations repo --- dev/docker/python/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/docker/python/Dockerfile b/dev/docker/python/Dockerfile index 07d2c6d3b..40a89b567 100644 --- a/dev/docker/python/Dockerfile +++ b/dev/docker/python/Dockerfile @@ -1,4 +1,4 @@ -# start with the `delphi_python` image +# start with the `delphi_python` image, which is built from repos/delphi/operations/dev/docker/python/Dockerfile FROM delphi_python RUN pip install --no-cache-dir -r repos/delphi/delphi-epidata/requirements.txt -r repos/delphi/delphi-epidata/requirements.dev.txt