From 80f3b30b2fabfcfc8e7960436d2099f4a40eef9c Mon Sep 17 00:00:00 2001 From: Devashish Chandra Date: Thu, 3 Dec 2026 03:49:43 +0530 Subject: [PATCH] refactor(docker): move Gradle spark settings into a job folder quickstartSpark selects spark-smoke-test/env through DATAHUB_ENV_JOB_DIR instead of smoke-gms.env and a METADATA_SERVICE_AUTH_ENABLED Gradle value. METADATA_SERVICE_AUTH_ENABLED moves from GMS environment: to env/docker/gms.env with the same default so a job file can set it. Drop METADATA_TESTS_ENABLED, which no service received. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 1 + docker/build.gradle | 5 +---- docker/profiles/docker-compose.gms.yml | 1 - env/README.md | 6 +++++- env/docker/gms.env | 5 +++-- .../java/acryl-spark-lineage/spark-smoke-test/env/all.env | 1 + .../java/acryl-spark-lineage/spark-smoke-test/env/gms.env | 1 + .../java/acryl-spark-lineage/spark-smoke-test/smoke-gms.env | 4 ---- 8 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 metadata-integration/java/acryl-spark-lineage/spark-smoke-test/env/all.env create mode 100644 metadata-integration/java/acryl-spark-lineage/spark-smoke-test/env/gms.env delete mode 100644 metadata-integration/java/acryl-spark-lineage/spark-smoke-test/smoke-gms.env diff --git a/.gitignore b/.gitignore index 06a6938a2605d..4c1f67a125026 100644 --- a/.gitignore +++ b/.gitignore @@ -133,6 +133,7 @@ skills-lock.json !/smoke-test/env/**/*.env !/smoke-test/test_resources/semantic/env/**/*.env !/e2e-test/ui/playwright/env/**/*.env +!/metadata-integration/java/acryl-spark-lineage/spark-smoke-test/env/**/*.env # Compatibility symlinks to env/docker/*.env, kept for one release. !/docker/datahub-*/env/docker.env # Exception: ZDU test compose override (no secrets — only authz bypass flags) diff --git a/docker/build.gradle b/docker/build.gradle index 66476e15cf345..61bfe0698f5b6 100644 --- a/docker/build.gradle +++ b/docker/build.gradle @@ -321,8 +321,7 @@ ext { ':datahub-actions', ], additionalEnv: [ - 'DATAHUB_LOCAL_COMMON_ENV': "${rootProject.project(':metadata-integration:java:acryl-spark-lineage').projectDir}/spark-smoke-test/smoke-gms.env", - 'METADATA_SERVICE_AUTH_ENABLED': 'false' + 'DATAHUB_ENV_JOB_DIR': "${rootProject.project(':metadata-integration:java:acryl-spark-lineage').projectDir}/spark-smoke-test/env", ] ], 'quickstartStorage': [ @@ -510,7 +509,6 @@ dockerCompose { environment.put 'DATAHUB_VERSION', System.getenv("DATAHUB_VERSION") ?: "v${version}" environment.put 'DATAHUB_APP_VERSION', System.getenv("DATAHUB_APP_VERSION") ?: "v${version}" environment.put 'DATAHUB_TELEMETRY_ENABLED', 'false' - environment.put "METADATA_TESTS_ENABLED", "true" // Debug bind-mount stacks only. Image quickstarts keep compose's default // (false) unless a task sets DEV_TOOLING_ENABLED via additionalEnv (e.g. CI OS3). if (config.isDebug) { @@ -1036,7 +1034,6 @@ tasks.register("reloadEnv", Exec) { environment.put 'DATAHUB_VERSION', System.getenv("DATAHUB_VERSION") ?: "v${version}" environment.put 'DATAHUB_APP_VERSION', System.getenv("DATAHUB_APP_VERSION") ?: "v${version}" environment.put 'DATAHUB_TELEMETRY_ENABLED', 'false' - environment.put "METADATA_TESTS_ENABLED", "true" if (matchingConfig.isDebug) { environment.put "DEV_TOOLING_ENABLED", "true" } diff --git a/docker/profiles/docker-compose.gms.yml b/docker/profiles/docker-compose.gms.yml index aeca8b2a94a78..8379c60425998 100644 --- a/docker/profiles/docker-compose.gms.yml +++ b/docker/profiles/docker-compose.gms.yml @@ -220,7 +220,6 @@ x-datahub-gms-service: &datahub-gms-service <<: [*kafka-env, *datahub-authentication-env] # The server type stays here: a later env file's ${KEY:-default} sees the value an earlier file set. DATAHUB_SERVER_TYPE: ${DATAHUB_SERVER_TYPE:-quickstart} - METADATA_SERVICE_AUTH_ENABLED: ${METADATA_SERVICE_AUTH_ENABLED:-true} DATAHUB_OBJECT_STORAGE_URI: ${DATAHUB_OBJECT_STORAGE_URI:-file:///tmp/datahub-object-storage} MCP_CONSUMER_BATCH_ENABLED: ${MCP_CONSUMER_BATCH_ENABLED:-true} # Same value as system-update, which writes it onto the index. Unset, it stays at 3s instead of diff --git a/env/README.md b/env/README.md index efc862de2f95d..935712c51f4b7 100644 --- a/env/README.md +++ b/env/README.md @@ -4,7 +4,8 @@ Env files for GMS, system-update and optional services in DataHub's local stacks (`metadata-service/gms-lite/bin/gms-lite-stack.py`, started by `scripts/dev/datahub-dev.sh start --local`) reads `common/` and `docker-free/`. The Docker compose profiles read `common/` for GMS, the files in `docker/`, and the job folder that `DATAHUB_ENV_JOB_DIR` selects (`smoke-test/run-quickstart.sh` -selects `smoke-test/env`); the rest of their env still lives in `docker/profiles/*`. +selects `smoke-test/env`, Gradle `quickstartSpark` the spark smoke folder); the rest of their env still +lives in `docker/profiles/*`. ## Layout @@ -18,6 +19,9 @@ env/ folders, plus any conditional folders the extension adds smoke-test/env/ job layer for the pytest smoke tests (--job smoke-test) e2e-test/ui/playwright/env/ job layer for Playwright (--job playwright) +metadata-integration/java/acryl-spark-lineage/spark-smoke-test/env/ + job layer for the spark lineage smoke test (Docker only, + selected by Gradle `quickstartSpark`) ``` Each layer folder can hold `all.env` (every service) and one file per service: `gms.env`, diff --git a/env/docker/gms.env b/env/docker/gms.env index cc6d9fd2ded8c..8be9d89a177e2 100644 --- a/env/docker/gms.env +++ b/env/docker/gms.env @@ -36,8 +36,9 @@ PE_CONSUMER_ENABLED=true # This should match the DATAHUB_BASE_PATH setting in the frontend service # DATAHUB_BASE_PATH=${DATAHUB_BASE_PATH} -# Uncomment to disable Metadata Service Authentication -# METADATA_SERVICE_AUTH_ENABLED=false +# Metadata Service Authentication. Job folders (spark, ZDU) turn it off; an `environment:` entry +# would mask them. +METADATA_SERVICE_AUTH_ENABLED=${METADATA_SERVICE_AUTH_ENABLED:-true} # Uncomment to disable persistence of client-side analytics events # DATAHUB_ANALYTICS_ENABLED=false diff --git a/metadata-integration/java/acryl-spark-lineage/spark-smoke-test/env/all.env b/metadata-integration/java/acryl-spark-lineage/spark-smoke-test/env/all.env new file mode 100644 index 0000000000000..cd10b655059cb --- /dev/null +++ b/metadata-integration/java/acryl-spark-lineage/spark-smoke-test/env/all.env @@ -0,0 +1 @@ +REST_API_AUTHORIZATION_ENABLED=false diff --git a/metadata-integration/java/acryl-spark-lineage/spark-smoke-test/env/gms.env b/metadata-integration/java/acryl-spark-lineage/spark-smoke-test/env/gms.env new file mode 100644 index 0000000000000..9daebe7fe550e --- /dev/null +++ b/metadata-integration/java/acryl-spark-lineage/spark-smoke-test/env/gms.env @@ -0,0 +1 @@ +METADATA_SERVICE_AUTH_ENABLED=false diff --git a/metadata-integration/java/acryl-spark-lineage/spark-smoke-test/smoke-gms.env b/metadata-integration/java/acryl-spark-lineage/spark-smoke-test/smoke-gms.env deleted file mode 100644 index 00ff37b8e8dd8..0000000000000 --- a/metadata-integration/java/acryl-spark-lineage/spark-smoke-test/smoke-gms.env +++ /dev/null @@ -1,4 +0,0 @@ -REST_API_AUTHORIZATION_ENABLED=false -# This does not work from an env file since this is also defined in the environment list which takes precedence over env files. -# This environment variable must be set to disable METADATA_SERVICE_AUTH_ENABLED -# METADATA_SERVICE_AUTH_ENABLED=false \ No newline at end of file