refactor(docker): move debug and localstack env into env/docker variants
Stacked on #21825.
Moves the debug and dev environment: values of the GMS-family compose services into env/docker/variants/debug, and the LocalStack values into a new env/docker/variants/localstack. No effective value changes.
Moved keys
| Key | From | To | Read by |
|---|---|---|---|
SEARCH_SERVICE_ENABLE_CACHE=false, LINEAGE_SEARCH_CACHE_ENABLED=false, SHOW_BROWSE_V2=true | &datahub-gms-dev-env | variants/debug/gms.env | all 13 datahub-gms-debug* services |
8 × DATAHUB_VALIDATION_ASPECT_SIZE_{PRE,POST}_PATCH_* (opt-in, same defaults) | &datahub-gms-dev-env | variants/debug/gms.env | same |
AWS_ENDPOINT_URL, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, DATAHUB_EXECUTOR_ROLE_ARN | x-localstack-env | variants/localstack/{gms,system-update}.env | datahub-gms-debug-aws, system-update-debug-aws |
The debug GMS services and the two aws services now restate their env_file list with the variants in place (order: datastore, graph, cloud, debug). env/README.md names the new localstack slot.
Also deleted: dev template copies that repeat a value the same service already gets with the same default (ENTITY_VERSIONING_ENABLED, METADATA_SERVICE_AUTH_ENABLED, MCP_SERVER_ENABLED, DEV_TOOLING_ENABLED, and REPROCESS_DEFAULT_BROWSE_PATHS_V2, which is already in env/docker/system-update.env), and the unused anchor names &datahub-gms-env-files and &datahub-system-update-env-files.
Kept in environment:
| Key | Why |
|---|---|
DATAHUB_SERVER_TYPE: ${…:-dev} (GMS, MCE dev) | The base environment: sets ${…:-quickstart}. A later env file's ${KEY:-default} cannot change a default an earlier layer set |
JAVA_TOOL_OPTIONS (system-update, GMS, MCE dev) | Tied to the debug port the same service maps |
AWS_REGION in x-localstack-env | It beats the bare AWS_REGION: pass-through only by merge order. In an env file, a shell value would win instead |
AWS_PROFILE and the GCP, Vertex and Bedrock names | Bare pass-through: an env file cannot pass a value through only when it is set |
AWS_SDK_LOAD_CONFIG | system-update-debug-postgres-cdc uses the aws anchor but does not read variants/debug, and MCE dev has no aws anchor. Moving it would need a copy per service |
Kept as is: the LocalStack AWS_SECRET_ACCESS_KEY default reads ${DATAHUB_AWS_ACCESS_KEY_ID:-test} (the access key variable). It probably should read a secret key variable, but this PR changes no values.
Verification
The rendered compose model is unchanged in every scenario. It was compared with .github/scripts/compose_env_snapshot.py (from the snapshot tool PR) on a clean copy of the base branch and on this branch:
snapshot --only bare shell smoke ai zdu, thendiff: no differences (71 scenarios; the known-brokendebug-frontendfails on both sides).snapshot --only gradle: no differences in any of the 27 Gradlequickstart_configsscenarios. These ran on scratch copies of both trees with the snapshot tool'sdocker/build.gradleprint task; the only failure is the known-brokenquickstartDebugSearchSplit, on both sides.- No ad-hoc scenario differs: no known ad-hoc env file sets a moved key.
./gradlew :docker:generateQuickstartComposeConfig, thengit diff --exit-code docker/quickstart/: clean.python3 smoke-test/check_env_parity.py: exit 0.
No line changed in env/docker/system-update.env or env/docker/gms.env, the two files read outside the profiles (datahub-upgrade.sh and docker/mysql/docker-compose.mysql.yml).
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 test code changes
- Docs related to the changes have been added/updated (if applicable):
env/README.md - Breaking changes: none
🤖 Generated with Claude Code
Summary by cubic
Moves the debug GMS and LocalStack environment: values into env/docker/variants/ files so debug services share config through the same env-file layer system as the regular profiles. The rendered compose model is unchanged in every scenario, so no values change.
Refactors
- Debug GMS values (caches off, browse v2, aspect size validation) move to
variants/debug/gms.env; LocalStack endpoint, keys and executor role move tovariants/localstack/. - Debug GMS services and the two debug AWS services now restate their
env_filelists with the variants in order datastore, graph, cloud (localstack), debug. - Removed dev template copies that repeated defaults the service already gets, plus the unused
&datahub-gms-env-filesand&datahub-system-update-env-filesanchors. - Keys stay inline where an env file cannot reproduce them:
DATAHUB_SERVER_TYPEandJAVA_TOOL_OPTIONS(defaults set by an earlier layer or tied to the debug port),AWS_REGION(relies on merge order), bare cloud pass-throughs, andAWS_SDK_LOAD_CONFIG. env/README.mddocuments the newlocalstackvariant slot.