Repository navigation
refactor(docker): move common, auth and telemetry env into env/docker - #21824
devashish2203 wants to merge 5 commits into
Conversation
Move the common, authentication and telemetry values out of the
docker/profiles compose anchors into env/docker layer files:
- DATAHUB_BASE_PATH and DATAHUB_GMS_BASE_PATH go to the system-update,
gms, mae-consumer, mce-consumer and frontend service files.
- DATAHUB_SYSTEM_CLIENT_SECRET goes to the system-update, gms,
mce-consumer and frontend service files.
- The telemetry and usage aggregation keys go to the gms and
mce-consumer service files, and to env/docker/variants/debug/ for the
debug system-update and mae-consumer services, which are the only
services of those kinds that had them.
The rendered compose config is unchanged in every scenario. Keys stay in
environment: where moving them would change a value: the token secrets,
DATAHUB_SERVER_TYPE on gms and mce (a later env file's ${KEY:-default}
resolves against values earlier files set, so a variant cannot change
that default), and the irregular mae client secret and telemetry, marked
for cleanup.
datahub-upgrade.sh passes system-update.env to docker run, which does
not interpolate, so it now skips lines that contain ${.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR SummaryOverview Compose
Reviewed by Cursor Bugbot for commit 1b6c7f6. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d999884. Configure here.
There was a problem hiding this comment.
All reported issues were addressed across 12 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Smart test selectionpytest smoke testsMode: active. Only the selection below runs for the pytest smoke tests on this PR (applied:
Medium confidence: a wrong tag means tests are skipped, so check the tags above against what this PR touches. Selected scopes (17 files or classes, 42 tests)
Add the Playwright E2E testsThis run:
Add the commit |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Other compose values interpolate DATAHUB_BASE_PATH and DATAHUB_GMS_BASE_PATH
(PLAY_HTTP_CONTEXT, the schema registry URLs, the AI service's GMS URL), and
interpolation never sees env_file values, so a layer file that set a base path
would split the config. The system client secret goes back to the shared auth
anchor so every service that uses it resolves the same value.
datahub-upgrade.sh now fails before pulling when system-update.env is
missing, and the README's docker run examples skip the ${...} lines as the
script does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Stacked on #21823.
Step 3a of moving the Docker env into the
env/layers: the common, authentication and telemetry values leave thedocker/profilescompose anchors and go intoenv/dockerfiles.Moved keys
All keep the
KEY=${KEY:-default}form, so a shell value still wins.DATAHUB_TELEMETRY_ENABLED,USAGE_AGGREGATION_{ENABLED,FLUSH_INTERVAL_SECONDS,ALIGNMENT_PERIOD_SECONDS,INCLUDE_AGENT_NAME}env/docker/{gms,mce-consumer}.envDATAHUB_SERVER_TYPE(dev)env/docker/variants/debug/{system-update,mae-consumer}.env, listed only by the debug services that had themThe stale copies in
env/docker/mce-consumer.envare removed.Kept in
environment:DATAHUB_TOKEN_SERVICE_SIGNING_KEY,DATAHUB_TOKEN_SERVICE_SALT: the shell or Gradle supplies them.DATAHUB_BASE_PATH,DATAHUB_GMS_BASE_PATH: other compose values interpolate them (PLAY_HTTP_CONTEXT, the schema registry URLs, the AI service's GMS URL), and interpolation never seesenv_filevalues.DATAHUB_SYSTEM_CLIENT_SECRET: every service that shares it keeps the same value, since the mae client secret cannot move yet (below).DATAHUB_SERVER_TYPEon gms and mce (quickstart, ordevon debug services). Compose resolves${KEY:-default}in a later env file against the values that earlier files in the same list set. So a variant file cannot change the default of a key that the service file already sets: the earlier value wins unless the shell sets the key.env/README.mdnow states this rule.Cleanup:in the compose file:datahub-mae-consumer-quickstart-postgres-consumershas no client secret or token keys, while every other mae service has them.system-update-debug-postgres-cdchas none, so it reuses the quickstartenv_filelist without the debug variant.Upgrade script
docker/datahub-upgrade/datahub-upgrade.shpassesenv/docker/system-update.envtodocker run --env-file, which does not resolve${...}. The script now skips lines that contain${, so it gets the same keys as before. The one line that was already passed through literally is now skipped too.docker/datahub-upgrade/README.mdnotes this.Verification
bareandshellscenarios, and for thesmoke,ai(both providers) andzdu(both topologies) scenarios. No ad-hoc file sets a moved key for a service that reads it, so there are no ad-hoc precedence differences.quickstart(profilequickstart-consumers) andquickstartDebug(profiledebug), rendered with the env those tasks set: per-service environment identical../gradlew :docker:generateQuickstartComposeConfig: no diff indocker/quickstart/, and noenv_filekey.smoke-test/check_env_parity.py: exit 0.Checklist
env/README.md,docker/datahub-upgrade/README.md)🤖 Generated with Claude Code
Summary by cubic
Moves the telemetry and usage aggregation values out of the
docker/profilescompose anchors and into theenv/dockerlayer files. The rendered compose config is unchanged for every scenario.The common and authentication keys (
DATAHUB_BASE_PATH,DATAHUB_GMS_BASE_PATH,DATAHUB_SYSTEM_CLIENT_SECRET) stay inenvironment:, because other compose values interpolate them and interpolation never seesenv_filevalues.DATAHUB_SERVER_TYPEalso stays, since a later env file's${KEY:-default}resolves against values earlier files set, so a variant file cannot change that default. The token secrets stay, as the shell or Gradle supplies them.gms.env,mce-consumer.env, and newenv/docker/variants/debug/files for debug services.variants/debugfiles explicitly.environment:, markedCleanup:.datahub-upgrade.shnow skips${...}lines when passingsystem-update.envtodocker run --env-file(which does not interpolate), and exits before pulling when the file is missing; both READMEs document this.Migration
env/README.mdnow states that a later env file's${KEY:-default}resolves against values earlier files set, so it cannot change a default already set by the service file.Written for commit 28dd125. Summary will update on new commits.