You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make the nightly database-in-image refresh work on GitHub Actions #3182
The nightly database job refreshes a database-in-image project's image on CircleCI, but the GitHub Actions database job in .github/workflows/build-test-deploy.yml has never had any database-in-image handling. A GitHub Actions project with VORTEX_DB_IMAGE set gets no fresh image from its nightly run, and with the container_registry fetch source the Export DB step fails.
Details
How CircleCI does it
#3180 (for #3177) makes the CircleCI flow work. When VORTEX_DB_IMAGE and VORTEX_DB_IMAGE_BASE are set and VORTEX_FETCH_DB_SOURCE isn't container_registry, the Export DB step:
Runs vortex-fetch-db with the container_registry source and VORTEX_FETCH_DB_CONTAINER_REGISTRY_IMAGE_BASE passed in, so vortex-fetch-db-container-registry pulls the base image and tags it as VORTEX_DB_IMAGE. docker compose up then builds the database service from that clean base.
Runs vortex-provision with VORTEX_DB_IMAGE cleared, so the empty database is provisioned from the dump file. vortex-provision itself knows nothing about the base image.
Runs vortex-export-db with VORTEX_DB_IMAGE set, which exports the database as an image, and the Deploy DB image step pushes it with vortex-push-db-image.
What the GitHub Actions database job is missing
The Adjust variables for a scheduled run step sets neither VORTEX_DB_IMAGE_BASE nor VORTEX_EXPORT_DB_CONTAINER_REGISTRY_PUSH_PROCEED.
The Export DB step runs docker compose --progress quiet cp -L .data/db.sql cli:/app/.data/db.sql without || true, so it fails for the container_registry source, which fetches no dump file. CircleCI tolerates the missing file.
It doesn't remove .data/db.sql after the import for database-in-image projects (CircleCI runs grep -q ^VORTEX_DB_IMAGE .env && rm .data/db.sql || true), so the cache stores both the dump and the image archive.
It has none of the base image handling from the CircleCI Export DB step described above.
The template's own database-in-image test workflows (DIDI-FI and DIDI-II in .circleci/vortex-test-common.yml) run on CircleCI only, so nothing exercises this path on GitHub Actions.
To fix
Set VORTEX_DB_IMAGE_BASE and VORTEX_EXPORT_DB_CONTAINER_REGISTRY_PUSH_PROCEED=1 for the scheduled run.
Add a Deploy DB image step that mirrors the CircleCI one.
Make Export DB tolerate a missing dump file, and remove the dump after the import for database-in-image projects.
Add the base image handling from the CircleCI Export DB step: tag the base through vortex-fetch-db with the container_registry source, and run vortex-provision with VORTEX_DB_IMAGE cleared.
Cover the flow in the template's GitHub Actions tests.
Summary
The nightly database job refreshes a database-in-image project's image on CircleCI, but the GitHub Actions
databasejob in.github/workflows/build-test-deploy.ymlhas never had any database-in-image handling. A GitHub Actions project withVORTEX_DB_IMAGEset gets no fresh image from its nightly run, and with thecontainer_registryfetch source theExport DBstep fails.Details
How CircleCI does it
#3180 (for #3177) makes the CircleCI flow work. When
VORTEX_DB_IMAGEandVORTEX_DB_IMAGE_BASEare set andVORTEX_FETCH_DB_SOURCEisn'tcontainer_registry, theExport DBstep:vortex-fetch-dbwith thecontainer_registrysource andVORTEX_FETCH_DB_CONTAINER_REGISTRY_IMAGE_BASEpassed in, sovortex-fetch-db-container-registrypulls the base image and tags it asVORTEX_DB_IMAGE.docker compose upthen builds thedatabaseservice from that clean base.vortex-provisionwithVORTEX_DB_IMAGEcleared, so the empty database is provisioned from the dump file.vortex-provisionitself knows nothing about the base image.vortex-export-dbwithVORTEX_DB_IMAGEset, which exports the database as an image, and theDeploy DB imagestep pushes it withvortex-push-db-image.What the GitHub Actions
databasejob is missingAdjust variables for a scheduled runstep sets neitherVORTEX_DB_IMAGE_BASEnorVORTEX_EXPORT_DB_CONTAINER_REGISTRY_PUSH_PROCEED.Deploy DB imagestep. The push used to live insidevortex-export-dbuntil Extract the container image deployment from 'export-db' into a dedicated script #2723 moved it into its own step, and only CircleCI got one.Export DBstep runsdocker compose --progress quiet cp -L .data/db.sql cli:/app/.data/db.sqlwithout|| true, so it fails for thecontainer_registrysource, which fetches no dump file. CircleCI tolerates the missing file..data/db.sqlafter the import for database-in-image projects (CircleCI runsgrep -q ^VORTEX_DB_IMAGE .env && rm .data/db.sql || true), so the cache stores both the dump and the image archive.Export DBstep described above..circleci/vortex-test-common.yml) run on CircleCI only, so nothing exercises this path on GitHub Actions.To fix
VORTEX_DB_IMAGE_BASEandVORTEX_EXPORT_DB_CONTAINER_REGISTRY_PUSH_PROCEED=1for the scheduled run.Deploy DB imagestep that mirrors the CircleCI one.Export DBtolerate a missing dump file, and remove the dump after the import for database-in-image projects.Export DBstep: tag the base throughvortex-fetch-dbwith thecontainer_registrysource, and runvortex-provisionwithVORTEX_DB_IMAGEcleared.