refactor(docker): move Gradle spark settings into a job folder

DE
15h ago
+12-12

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.

  • quickstartSpark reads a new job folder, metadata-integration/java/acryl-spark-lineage/spark-smoke-test/env/, through DATAHUB_ENV_JOB_DIR. Its all.env holds REST_API_AUTHORIZATION_ENABLED=false for every service, as smoke-gms.env did through the common ad-hoc slot. Its gms.env holds METADATA_SERVICE_AUTH_ENABLED=false for GMS only, as the Gradle value did. smoke-gms.env is deleted.
  • METADATA_SERVICE_AUTH_ENABLED moves from the GMS compose environment: block to env/docker/gms.env, with the same ${METADATA_SERVICE_AUTH_ENABLED:-true} form, so that a job file can set it.
  • The METADATA_TESTS_ENABLED=true puts are deleted from docker/build.gradle. No compose file, env file or entrypoint names the key, so no container ever received it.
  • env/README.md lists the new job folder, and .gitignore gets a negation for it.

Gradle entries

KeyConfigResult
DATAHUB_LOCAL_ACTIONS_ENVdebug configsLeft: a path
DEV_TOOLING_ENABLED=truequickstartOS3Left: there is no opensearch3 variant folder, and adding one would change plain-compose quickstart-opensearch3
DATAHUB_LOCAL_COMMON_ENV (smoke-gms.env)quickstartSparkReplaced by DATAHUB_ENV_JOB_DIR and the spark job folder
METADATA_SERVICE_AUTH_ENABLED=falsequickstartSparkMoved to spark-smoke-test/env/gms.env
DATAHUB_VERSION, DATAHUB_APP_VERSION, DATAHUB_REPOallLeft: version or image
DATAHUB_TELEMETRY_ENABLED=falseallLeft: the services that name this key are irregular, so no layer is exactly equivalent
METADATA_TESTS_ENABLED=trueallDeleted: no container ever received it
DEV_TOOLING_ENABLED=trueall debug configsLeft: moving it to the debug variant would change plain-compose debug stacks
DATAHUB_SYSTEM_CLIENT_SECRET, token signing key and saltallLeft: 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.

KeyServicesScenarioBeforeAfterFile
METADATA_SERVICE_AUTH_ENABLEDevery GMS serviceplain 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 filetruethe 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_configs key, rendered with the env and arguments the compose plugin passes: 27 configs, no differences. quickstartDebugSearchSplit fails 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_ENABLED for GMS; before, the compose environment: entry masked env files.
  • Deletes METADATA_TESTS_ENABLED=true from docker/build.gradle; no compose file, env file, or entrypoint names the key, so no container ever received it.