refactor(docker): move frontend, actions and ai-service env into env/docker
Stacked on #21827.
Moves the environment: values of the frontend, actions and ai-service compose services into env/docker layer and variant files. The rendered compose config is unchanged in every scenario.
Moved keys
| Key | Service(s) | From | To |
|---|---|---|---|
DATAHUB_GMS_HOST, THEME_V2_DEFAULT, PLAY_HTTP_CONTEXT, LOG_AGGREGATOR_ENDPOINT, DATAHUB_AI_SERVICE_URL | all frontend | frontend service anchor | env/docker/frontend.env (replaces stale DATAHUB_GMS_HOST line; stale DATAHUB_SECRET line removed) |
DATAHUB_ANALYTICS_ENABLED | frontend debug | dev template | env/docker/variants/debug/frontend.env |
ACTIONS_EXTRA_PACKAGES, ACTIONS_CONFIG, SCHEMA_REGISTRY_URL | all actions | three templates + pgQueue anchor | env/docker/actions.env (replaces stale SCHEMA_REGISTRY_URL) |
DATAHUB_ACTIONS_SYSTEM_CONFIGS_PATH, PGQUEUE_HOST_PORT, PGQUEUE_DATABASE, PGQUEUE_USERNAME, PGQUEUE_PASSWORD, DATAHUB_PGQUEUE_SCHEMA, DATAHUB_PGQUEUE_TABLE_PREFIX | 4 non-CDC Postgres actions services | pgQueue anchor | env/docker/variants/postgres/actions.env |
DATAHUB_GMS_URL, DATAHUB_AI_MCP_ENABLED | ai-service | ai-service anchor | new env/docker/ai-service.env (now a required entry) |
The debug frontend services and the non-CDC Postgres actions services get their own anchored env_file lists (x-env-files-frontend-debug, x-env-files-actions-postgres) with the variant in place. The postgres-cdc actions services never used pgQueue and keep the base list.
Kept in environment:
JAVA_TOOL_OPTIONS(frontend debug): tied to debug port 5002.AWS_PROFILE(bare pass-through) andAWS_SDK_LOAD_CONFIG(actions): tied to the~/.awsmounts.DATAHUB_AI_PORT: tied to the container port mapping.PYTHONPATH(ai-service dev): tied to the source mounts.DATAHUB_BASE_PATH,DATAHUB_GMS_BASE_PATH,DATAHUB_SYSTEM_CLIENT_SECRET(frontend): the GMS-side services keep them inenvironment:too, so all read the same shell value.DATAHUB_SECRET(frontend): no env layer or ad-hoc file can replace it with a short legacy value, which stops Play 3 from starting.DATAHUB_AI_TRUSTED_PROXIES(ai-service): only the frontend is trusted to name the client host; no env layer can widen that.
Interpolation: PLAY_HTTP_CONTEXT=${DATAHUB_BASE_PATH:-/} (frontend), SCHEMA_REGISTRY_URL (actions) and DATAHUB_GMS_URL (ai-service) read the base paths, which no file in their lists sets, so they resolve from the shell as the environment: values did.
Verification
Rendered with compose_env_snapshot.py (from #21820) on a clean copy of the base and on this branch, then diffed:
bareandshell(every profile),smoke,ai(both embedding variants),zdu: no differences (71 scenarios;debug-frontendis known-broken on the base too).gradle: all 27quickstart_configskeys, with the print task'sdocker/build.gradlecopied over scratch copies only: no differences (quickstartDebugSearchSplitis known-broken on the base too).- Ad-hoc files (
smoke-test/test_resources/actions/actions.env, CIai-gms.env,smoke.common.env,zdu-test.env, sparksmoke-gms.env) set none of the moved keys, so no precedence change. ./gradlew :docker:generateQuickstartComposeConfigthengit diff --exit-code docker/quickstart/: clean, noenv_filekey.python3 smoke-test/check_env_parity.py: exit 0.
Checklist
- The PR conforms to DataHub's Contributing Guideline (PR title format)
- Links to related issues (if applicable)
- Tests for the changes have been added/updated (if applicable): rendered-config snapshot diff, no new tests
- Docs related to the changes have been added/updated (if applicable):
env/README.md - For any breaking change/potential downtime/deprecation/big changes an entry has been made in Breaking Changes: not a breaking change
🤖 Generated with Claude Code
Summary by cubic
Moves the environment: values of the frontend, actions, and ai-service compose services into env/docker layer and variant files. The rendered compose config is unchanged in every scenario.
Refactor details
- Frontend values move to
env/docker/frontend.env, replacing its staleDATAHUB_GMS_HOSTandDATAHUB_SECRETlines; ai-service values move to the new requiredenv/docker/ai-service.env; actions values move toenv/docker/actions.env, with pgQueue values for non-CDC Postgres services inenv/docker/variants/postgres/actions.envand the debug analytics default inenv/docker/variants/debug/frontend.env. - The debug frontend and non-CDC Postgres actions services get variant-aware
env_filelists; postgres-cdc actions services keep the base list. - Keys tied to a service port or mount (
JAVA_TOOL_OPTIONS,AWS_PROFILE/AWS_SDK_LOAD_CONFIG,DATAHUB_AI_PORT,PYTHONPATH) stay inenvironment:, as doDATAHUB_SECRETandDATAHUB_AI_TRUSTED_PROXIES, which an env layer could otherwise override (a short legacy secret stops Play 3 from starting; a wider trusted-proxies list would trust forwarded hosts from other peers). - Rendered configs were diffed against the base branch across all profiles and scenarios with no differences.