refactor(docker): move debug and localstack env into env/docker variants

DE
15h ago
+164-36

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

KeyFromToRead by
SEARCH_SERVICE_ENABLE_CACHE=false, LINEAGE_SEARCH_CACHE_ENABLED=false, SHOW_BROWSE_V2=true&datahub-gms-dev-envvariants/debug/gms.envall 13 datahub-gms-debug* services
8 × DATAHUB_VALIDATION_ASPECT_SIZE_{PRE,POST}_PATCH_* (opt-in, same defaults)&datahub-gms-dev-envvariants/debug/gms.envsame
AWS_ENDPOINT_URL, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, DATAHUB_EXECUTOR_ROLE_ARNx-localstack-envvariants/localstack/{gms,system-update}.envdatahub-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:

KeyWhy
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-envIt 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 namesBare pass-through: an env file cannot pass a value through only when it is set
AWS_SDK_LOAD_CONFIGsystem-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, then diff: no differences (71 scenarios; the known-broken debug-frontend fails on both sides).
  • snapshot --only gradle: no differences in any of the 27 Gradle quickstart_configs scenarios. These ran on scratch copies of both trees with the snapshot tool's docker/build.gradle print task; the only failure is the known-broken quickstartDebugSearchSplit, on both sides.
  • No ad-hoc scenario differs: no known ad-hoc env file sets a moved key.
  • ./gradlew :docker:generateQuickstartComposeConfig, then git 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 and LocalStack environment: values for the GMS-family and AWS services into env/docker/variants/ files. 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 to variants/localstack/.
  • The debug GMS services and the two debug AWS services restate their env_file lists with the variants in order datastore, graph, cloud, debug.
  • Removed dev template copies that repeated values the service already gets with the same default, plus two unused anchor names.
  • Keys stay inline where an env file cannot reproduce them: DATAHUB_SERVER_TYPE and JAVA_TOOL_OPTIONS defaults already set by an earlier layer, AWS_REGION (relies on merge order), bare cloud pass-throughs, and AWS_SDK_LOAD_CONFIG.
  • env/README.md documents the new localstack variant slot.