diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0416644eb..17055c677 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,12 +56,6 @@ jobs: ln -s repos/delphi/delphi-epidata/dev/local/pyproject.toml repos/ ln -s repos/delphi/delphi-epidata/dev/local/setup.cfg repos/ - - name: Build docker images - run: | - make db - make web - make redis - - name: Run tests run: | make test diff --git a/dev/local/Makefile b/dev/local/Makefile index b4083ea34..f473ecdb2 100644 --- a/dev/local/Makefile +++ b/dev/local/Makefile @@ -65,9 +65,6 @@ NOW:=$(shell date "+%Y-%m-%d") LOG_WEB:=delphi_web_epidata_$(NOW).log LOG_DB:=delphi_database_epidata_$(NOW).log LOG_REDIS:=delphi_redis_instance_$(NOW).log -WEB_CONTAINER_ID:=$(shell docker ps -q --filter 'name=delphi_web_epidata') -DATABASE_CONTAINER_ID:=$(shell docker ps -q --filter 'name=delphi_database_epidata') -REDIS_CONTAINER_ID:=$(shell docker ps -q --filter 'name=delphi_redis') M1= ifeq ($(shell uname -smp), Darwin arm64 arm) @@ -82,9 +79,7 @@ db: .PHONY=web web: - @docker compose up delphi_web_epidata $(M1) \ - --env "SQLALCHEMY_DATABASE_URI=$(sqlalchemy_uri)" \ - --detach + @SQLALCHEMY_DATABASE_URI=$(sqlalchemy_uri) docker compose up delphi_web_epidata $(M1) --detach @docker logs -f delphi_web_epidata >$(LOG_WEB) 2>&1 & .PHONY=redis @@ -94,15 +89,17 @@ redis: .PHONY=test test: - @docker compose run delphi_web_python $(M1) python -m pytest --import-mode importlib $(pdb) $(test) | tee test_output_$(NOW).log + @SQLALCHEMY_DATABASE_URI=$(sqlalchemy_uri) docker compose run delphi_web_python $(M1) \ + python -m pytest --import-mode importlib $(pdb) $(test) | tee test_output_$(NOW).log .PHONY=r-test r-test: - @docker compose run delphi_web_python $(M1) Rscript repos/delphi/delphi-epidata/integrations/client/test_delphi_epidata.R | tee r-test_output_$(NOW).log + @SQLALCHEMY_DATABASE_URI=$(sqlalchemy_uri) docker compose run delphi_web_python $(M1) \ + Rscript repos/delphi/delphi-epidata/integrations/client/test_delphi_epidata.R | tee r-test_output_$(NOW).log .PHONY=bash bash: - @docker compose run delphi_web_python $(M1) bash + @SQLALCHEMY_DATABASE_URI=$(sqlalchemy_uri) docker compose run delphi_web_python $(M1) bash .PHONY=sql sql: diff --git a/dev/local/docker-compose.yaml b/dev/local/docker-compose.yaml index 2ec49615b..8bc2bbc18 100644 --- a/dev/local/docker-compose.yaml +++ b/dev/local/docker-compose.yaml @@ -27,7 +27,7 @@ services: dockerfile: ./devops/Dockerfile environment: MODULE_NAME: delphi.epidata.server.main - SQLALCHEMY_DATABASE_URI: mysql+mysqldb://user:pass@delphi_database_epidata:3306/epidata + SQLALCHEMY_DATABASE_URI: ${SQLALCHEMY_DATABASE_URI:-mysql+mysqldb://user:pass@delphi_database_epidata:3306/epidata} FLASK_SECRET: abc FLASK_PREFIX: /epidata LOG_DEBUG: "1" @@ -68,7 +68,7 @@ services: context: . dockerfile: repos/delphi/delphi-epidata/dev/docker/python/Dockerfile environment: - SQLALCHEMY_DATABASE_URI: mysql+mysqldb://user:pass@delphi_database_epidata:3306/epidata + SQLALCHEMY_DATABASE_URI: ${SQLALCHEMY_DATABASE_URI:-mysql+mysqldb://user:pass@delphi_database_epidata:3306/epidata} FLASK_SECRET: abc volumes: - type: bind