Repository navigation
refactor(docker): move datastore, graph, search and kafka env into env/docker - #21825
devashish2203 wants to merge 6 commits into
Conversation
…v/docker
Move the primary datastore, graph, search and Kafka values out of the
docker/profiles compose anchors into env/docker layer files:
- The default stack (MySQL, Elasticsearch graph, OpenSearch, Kafka
bootstrap and schema registry type) goes to the system-update, gms,
mae-consumer and mce-consumer service files, replacing the stale
values those files carried. Actions gets its search keys in actions.env.
- New variant folders env/docker/variants/{postgres,cassandra,neo4j}
hold the other datastores. Services that use them restate their
env_file list with the variant in place (datastore, graph, debug).
The rendered compose config is unchanged in every scenario. Keys stay in
environment: where an env file would change a value: the schema registry
URLs (they read DATAHUB_GMS_BASE_PATH, which earlier env files set), the
per-engine search overrides, the messaging transport default and the
Cassandra SQL setup flag. CDC and LocalStack env stay for later changes.
datahub-upgrade.sh now resolves ${KEY:-default} and ${KEY} lines of
system-update.env from its own environment instead of skipping them, so
it keeps passing the datasource user and password.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR SummaryOverview
Default service env values are updated in place (e.g. Reviewed by Cursor Bugbot for commit 73951ed. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
All reported issues were addressed across 20 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Smart test selectionpytest smoke testsMode: active. Only the selection below runs for the pytest smoke tests on this PR (applied:
Medium confidence: a wrong tag means tests are skipped, so check the tags above against what this PR touches. Selected scopes (45 files or classes, 212 tests)
Add the Playwright E2E testsThis run:
Specs selected because of this PR (8)
Add the commit |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…laceholder resolution Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docker/datahub-upgrade/datahub-upgrade.sh # docker/profiles/docker-compose.gms.yml
… datahub-upgrade.sh Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 73951ed. Configure here.
| # docker run --env-file passes ${...} literally; a one-service compose project resolves the file | ||
| # the way the stack's own compose files do (shell value, else the default). | ||
| cd "$DIR" && test -r ../../env/docker/system-update.env && docker pull "${IMAGE}" && | ||
| docker compose --project-name datahub-upgrade --project-directory "$DIR" -f - run --rm -T upgrade "$@" <<EOF |
There was a problem hiding this comment.
Compose run swallows upgrade CLI flags
High Severity
docker compose run defines -u as --user, and "$@" is passed after the service name with no -- separator. Callers such as datahub-upgrade.sh -u LoadIndices can have the job flag consumed as a Compose user (or -a rejected as unknown) instead of reaching the upgrade entrypoint, which docker run IMAGE "$@" previously forwarded intact.
Reviewed by Cursor Bugbot for commit 73951ed. Configure here.


Stacked on #21824 (step 3a). Moves the primary datastore, graph, search and Kafka values out of the
docker/profiles/compose anchors intoenv/dockerlayer files and new variant folders. The rendered compose config is unchanged in every scenario.Moved keys
EBEAN_DATASOURCE_{USERNAME,PASSWORD,HOST,URL,DRIVER}(MySQL)x-primary-datastore-mysql-envenv/docker/{system-update,gms,mae-consumer,mce-consumer}.envEBEAN_DATASOURCE_*(Postgres),EBEAN_POSTGRES_USE_AWS_IAM_AUTH,DATAHUB_PGQUEUE_ENABLED,DATAHUB_PGQUEUE_MAINTENANCE_CRON_ENABLEDx-primary-datastore-postgres-envenv/docker/variants/postgres/{system-update,gms,mae-consumer,mce-consumer}.envCASSANDRA_*,ENTITY_SERVICE_IMPL, plus the inlineZDU_STAGE_20: 'false'x-primary-datastore-cassandra-envenv/docker/variants/cassandra/{system-update,gms}.envGRAPH_SERVICE_IMPL=elasticsearchx-graph-datastore-search-envGRAPH_SERVICE_IMPL=neo4j,NEO4J_*x-graph-datastore-neo4j-envenv/docker/variants/neo4j/{system-update,gms}.envELASTICSEARCH_{HOST,PORT,PROTOCOL,USE_SSL,IMPLEMENTATION,INDEX_DOC_IDS_SCHEMA_FIELD_HASH_ID_ENABLED}x-search-datastore-opensearch-envELASTICSEARCH_{HOST,PORT,PROTOCOL,USE_SSL}x-search-datastore-elasticsearch-env(actions)env/docker/actions.envKAFKA_BOOTSTRAP_SERVER,SCHEMA_REGISTRY_TYPEx-kafka-env, inline in system-update, frontend, actionsThe stale values the service files carried (
ELASTICSEARCH_HOST=elasticsearch,GRAPH_SERVICE_IMPL=neo4j, older MySQL URLs) are replaced in place by the effective values. The unusedx-search-datastore-searchanchor indocker-compose.prerequisites.ymlis deleted.Variant folders
Order in each list: datastore, graph, debug. Compose does not merge lists, so
docker-compose.gms.ymldefines 12 anchoredenv_filelists (x-env-files-<service>-<variants>), one per service and variant set.postgres: system-update, gms, mae-consumer and mce-consumer services of thequickstart-postgres*anddebug-postgres*profiles.cassandra: system-update and gms ofquickstart-cassandra(withneo4j) anddebug-cassandra.neo4j: system-update and gms ofquickstart-cassandraanddebug-neo4j.No
mysqlfolder is needed. The datasource user and password readDATAHUB_EBEAN_DATASOURCE_ROOT_*, a name no env file sets, so the Postgres variant's default still applies after the MySQL one.Kept in
environment:KAFKA_SCHEMAREGISTRY_URLand the actionsSCHEMA_REGISTRY_URL: they interpolateDATAHUB_GMS_BASE_PATH, which stays inenvironment:too, so both read the same shell value.DATAHUB_MESSAGING_TRANSPORT: its default differs between postgres (pgqueue) and postgres with CDC (kafka). A later env file cannot change an opt-in default an earlier one set.DATAHUB_SQL_SETUP_ENABLED: 'false'on the Cassandra system-update services: the baseenvironment:value would beat a variant file.Verification
The env snapshot tool (#21820) ran on this branch and on its base (#21824):
bare,shell,smoke,ai,zdu: 71 scenarios, no differences. That includes ad-hoc env files: none of them now wins over a moved key.quickstart_configskeys, includingquickstart,quickstartDebug,quickstartPostgresandquickstartCassandra, rendered with the env and arguments that:docker:printComposeSettings(from ci(docker): add compose env snapshot tool and checks #21820) reports. No differences.quickstartDebugSearchSplitdoes not render on either side, because its override file is not in the repo../gradlew :docker:generateQuickstartComposeConfigproduces no diff, and the generated file has noenv_filekey.smoke-test/check_env_parity.py: exit 0.datahub-upgrade.sh -u SystemUpdateagainst a running local stack: the upgrade job ran and succeeded.Legacy consumers
These read the env files directly and now get the profile values instead of stale ones. The old values pointed at hosts the profile stacks do not run.
docker/datahub-upgrade/datahub-upgrade.sh(env/docker/system-update.env): the script no longer usesdocker run --env-file, which passes${...}literally. It pipes a one-service compose file, withenv_file: ../../env/docker/system-update.env, intodocker compose ... -f - run --rm -T upgrade. Compose resolves${KEY:-default}and${KEY}from the shell, as it does for the stack's own services, so those lines are no longer skipped. The README explains this; its plaindocker runexamples still drop those lines. Changed values:EBEAN_DATASOURCE_USERNAME:datahub→rootEBEAN_DATASOURCE_URL: gains&rewriteBatchedStatements=true&enabledTLSProtocols=TLSv1.2ELASTICSEARCH_HOST:elasticsearch→searchGRAPH_SERVICE_IMPL:neo4j→elasticsearchELASTICSEARCH_PROTOCOL=http,ELASTICSEARCH_USE_SSL=false,ELASTICSEARCH_IMPLEMENTATION=opensearch,ELASTICSEARCH_INDEX_DOC_IDS_SCHEMA_FIELD_HASH_ID_ENABLED=true,SCHEMA_REGISTRY_TYPE=INTERNAL${...}lines from step 3a, which the script skipped before, are now passed with their resolved values.DATAHUB_SYSTEM_CLIENT_SECRET,DATAHUB_TOKEN_SERVICE_SIGNING_KEYandDATAHUB_TOKEN_SERVICE_SALTfrom the shell, because the env file never carried them; and the image tag usesDATAHUB_VERSIONdirectly, so the script'sVERSIONdefault (quickstart) is not applied.docker/mysql/docker-compose.mysql.yml(env/docker/gms.envthrough compose) gets the same changes: userroot, hostsearch, the Elasticsearch graph, and the new search and schema registry keys.Deferred
AWS_REGIONonly beats the bareAWS_REGION:pass-through through merge order.Checklist
env/README.md,docker/datahub-upgrade/README.md🤖 Generated with Claude Code
Summary by cubic
Moves datastore, graph, search, and Kafka defaults from Compose anchors into
env/dockerservice files and Postgres, Cassandra, and Neo4j variants, without changing the rendered Compose configuration.datahub-upgrade.shnow runs the job through a one-servicedocker compose runso${KEY}and${KEY:-default}lines insystem-update.envresolve from the shell environment; it no longer needs a hostperlor drops the placeholders.environment:where moving them would change value resolution; CDC and LocalStack settings remain there for now.Written for commit a86f08f. Summary will update on new commits.