refactor(docker): move Gradle spark settings into a job folder
Stacked on #21831.
Moves the setting-type env that Gradle passes to compose into env layers, where a layer can express it without changing any rendered value.
quickstartSparkreads a new job folder,metadata-integration/java/acryl-spark-lineage/spark-smoke-test/env/, throughDATAHUB_ENV_JOB_DIR. Itsall.envholdsREST_API_AUTHORIZATION_ENABLED=falsefor every service, assmoke-gms.envdid through the common ad-hoc slot. Itsgms.envholdsMETADATA_SERVICE_AUTH_ENABLED=falsefor GMS only, as the Gradle value did.smoke-gms.envis deleted.METADATA_SERVICE_AUTH_ENABLEDmoves from the GMS composeenvironment:block toenv/docker/gms.env, with the same${METADATA_SERVICE_AUTH_ENABLED:-true}form, so that a job file can set it.- The
METADATA_TESTS_ENABLED=trueputs are deleted fromdocker/build.gradle. No compose file, env file or entrypoint names the key, so no container ever received it. env/README.mdlists the new job folder, and.gitignoregets a negation for it.
Gradle entries
| Key | Config | Result |
|---|---|---|
DATAHUB_LOCAL_ACTIONS_ENV | debug configs | Left: a path |
DEV_TOOLING_ENABLED=true | quickstartOS3 | Left: there is no opensearch3 variant folder, and adding one would change plain-compose quickstart-opensearch3 |
DATAHUB_LOCAL_COMMON_ENV (smoke-gms.env) | quickstartSpark | Replaced by DATAHUB_ENV_JOB_DIR and the spark job folder |
METADATA_SERVICE_AUTH_ENABLED=false | quickstartSpark | Moved to spark-smoke-test/env/gms.env |
DATAHUB_VERSION, DATAHUB_APP_VERSION, DATAHUB_REPO | all | Left: version or image |
DATAHUB_TELEMETRY_ENABLED=false | all | Left: the services that name this key are irregular, so no layer is exactly equivalent |
METADATA_TESTS_ENABLED=true | all | Deleted: no container ever received it |
DEV_TOOLING_ENABLED=true | all debug configs | Left: moving it to the debug variant would change plain-compose debug stacks |
DATAHUB_SYSTEM_CLIENT_SECRET, token signing key and salt | all | Left: secrets |
Behaviour change
An ad-hoc env file can now set METADATA_SERVICE_AUTH_ENABLED for GMS. Before, compose environment: masked the file. This is the precedence change planned for the env layers: ad-hoc files beat compose defaults.
| Key | Services | Scenario | Before | After | File |
|---|---|---|---|---|---|
METADATA_SERVICE_AUTH_ENABLED | every GMS service | plain compose with an ad-hoc file that sets the key and no shell value, e.g. DATAHUB_LOCAL_COMMON_ENV=zdu-test.env alone, or a datahub-dev env set file | true | the file's value (false for zdu-test.env) | docker/profiles/zdu-test.env or any DATAHUB_LOCAL_*_ENV file |
The ZDU framework's own compose calls are unchanged: they also export METADATA_SERVICE_AUTH_ENABLED=false from the shell, so they rendered false before and still do.
One more edge case for quickstartSpark: before, its additionalEnv replaced any DATAHUB_LOCAL_COMMON_ENV set in the shell. Now a shell DATAHUB_LOCAL_COMMON_ENV file is also applied, as the ad-hoc layer on top of the job folder. CI sets no such variable.
Verification
Each check compared the base branch with this branch, using docker compose config renders. No stack was started.
- Every Gradle
quickstart_configskey, rendered with the env and arguments the compose plugin passes: 27 configs, no differences.quickstartDebugSearchSplitfails to render on both sides because its override file is not in the repo. - Every profile, bare and with shell overrides, plus the smoke and AI smoke invocations: no differences.
- ZDU, both topologies (
debug,debug-consumers), rendered with the framework's real compose files and env: the full service model is identical. That env includes the shell export, and the cleanup phase's env was rendered too. A ZDU render without the shell export shows only the behaviour change above. ./gradlew :docker:generateQuickstartComposeConfig:docker/quickstart/unchanged.python3 smoke-test/check_env_parity.py: passes.
Moving zdu-test.env into a ZDU job folder follows in a separate PR. That change reworks several framework phases and the daily ZDU workflow.
Checklist
- The PR conforms to DataHub's Contributing Guideline (particularly PR Title Format)
- Links to related issues (if applicable)
- Tests for the changes have been added/updated (if applicable)
- Docs related to the changes have been added/updated (if applicable)
- For any breaking change/potential downtime/deprecation/big changes an entry has been made in Breaking Changes
🤖 Generated with Claude Code
Summary by cubic
Moves the setting-type env that Gradle passes to compose into env layers, so the spark smoke test can express it without changing any rendered value. quickstartSpark now selects the job folder metadata-integration/java/acryl-spark-lineage/spark-smoke-test/env/ through DATAHUB_ENV_JOB_DIR, replacing smoke-gms.env and the Gradle METADATA_SERVICE_AUTH_ENABLED=false value.
Behavior changes
- An ad-hoc env file can now override
METADATA_SERVICE_AUTH_ENABLEDfor GMS; before, the composeenvironment:entry masked env files. - Deletes
METADATA_TESTS_ENABLED=truefromdocker/build.gradle; no compose file, env file, or entrypoint names the key, so no container ever received it.