Skip to content

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

Open
devashish2203 wants to merge 9 commits into
pfp-8941-env-anchors-datastorefrom
pfp-8941-env-anchors-debug
Open

devashish2203 wants to merge 9 commits into
pfp-8941-env-anchors-datastorefrom
pfp-8941-env-anchors-debug

Conversation

@devashish2203

@devashish2203 devashish2203 commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

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

Key From To Read by
SEARCH_SERVICE_ENABLE_CACHE=false, LINEAGE_SEARCH_CACHE_ENABLED=false, SHOW_BROWSE_V2=true &datahub-gms-dev-env variants/debug/gms.env all 13 datahub-gms-debug* services
8 × DATAHUB_VALIDATION_ASPECT_SIZE_{PRE,POST}_PATCH_* (opt-in, same defaults) &datahub-gms-dev-env variants/debug/gms.env same
AWS_ENDPOINT_URL, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, DATAHUB_EXECUTOR_ROLE_ARN x-localstack-env variants/localstack/{gms,system-update}.env datahub-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:

Key Why
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-env It 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 names Bare pass-through: an env file cannot pass a value through only when it is set
AWS_SDK_LOAD_CONFIG system-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 GMS and LocalStack environment: values into env/docker/variants/ files so debug services share config through the same env-file layer system as the regular profiles. 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/.
  • Debug GMS services and the two debug AWS services now restate their env_file lists with the variants in order datastore, graph, cloud (localstack), debug.
  • Removed dev template copies that repeated defaults the service already gets, plus the unused &datahub-gms-env-files and &datahub-system-update-env-files anchors.
  • Keys stay inline where an env file cannot reproduce them: DATAHUB_SERVER_TYPE and JAVA_TOOL_OPTIONS (defaults set by an earlier layer or tied to the debug port), AWS_REGION (relies on merge order), bare cloud pass-throughs, and AWS_SDK_LOAD_CONFIG.
  • env/README.md documents the new localstack variant slot.

Written for commit 758d515. Summary will update on new commits.

View guided diff Turn on auto-fix

Move the debug GMS values and the LocalStack values out of the
docker/profiles compose anchors into env/docker variant files:

- The debug GMS cache, browse v2 and aspect size validation values go to
  env/docker/variants/debug/gms.env. The debug GMS services restate their
  env_file list with the debug variant in place.
- The LocalStack endpoint, keys and executor role go to
  env/docker/variants/localstack/, read by the two debug aws services
  (variant order: datastore, graph, cloud, debug).
- Dev template copies that repeat a value the service already gets with
  the same default are deleted, as are two anchor names nothing uses.

The rendered compose config is unchanged in every scenario. Keys stay in
environment: where an env file would change a value: DATAHUB_SERVER_TYPE
(the base environment sets it), JAVA_TOOL_OPTIONS (tied to the debug
port), AWS_REGION in the LocalStack anchor (it beats the bare
pass-through only by merge order), the bare cloud pass-through names and
AWS_SDK_LOAD_CONFIG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the devops PR or Issue related to DataHub backend & deployment label Dec 2, 2026
@cursor

cursor Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

PR Summary

Overview
Refactors Docker Compose so debug and LocalStack settings live in env/docker/variants/ instead of long inline environment: blocks in docker-compose.gms.yml, without changing rendered config (per PR verification).

Debug GMS behavior (caches off, browse v2, aspect-size validation) moves to env/docker/variants/debug/gms.env. Dev GMS services pick it up via variants/debug/gms.env in their env_file chains, and profile-specific anchors (e.g. *-postgres-debug, *-cassandra-debug) add that layer alongside datastore/graph variants.

LocalStack AWS endpoint, keys, and executor role ARN move to env/docker/variants/localstack/{gms,system-update}.env. x-localstack-env keeps only AWS_REGION (merge-order semantics). datahub-gms-debug-aws and system-update-debug-aws use *-localstack-debug env file anchors.

Compose also drops redundant dev-only duplicates already set elsewhere (e.g. ENTITY_VERSIONING_ENABLED, flags repeated from base gms.env) and removes unused env_file anchor names in favor of explicit or renamed variant lists. env/README.md documents the localstack cloud variant slot in the layer order.

Reviewed by Cursor Bugbot for commit a940737. Bugbot is set up for automated code reviews on this repo. Configure here.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Smart test selection

pytest smoke tests

Mode: active. Only the selection below runs for the pytest smoke tests on this PR (applied: smart).

  • Selection: smart: tests for the tagged features, plus always-run modules, this PR's changed tests, and the plumbing sample if the PR changes the pytest harness
  • Size: 271 of 861 tests in 2 batches, predicted longest batch ~4 min
  • Tags: change-type: docs; feature-dev: aspect-validation, executor, graph-index; feature-user: search
  • Confidence: MEDIUM (5 changed files)
  • Classifier reasoning: The change restructures docker compose env layering and adds a debug variant that toggles search browse v2, search and lineage caches, and aspect size validation, plus LocalStack AWS and executor role settings.

Medium confidence: a wrong tag means tests are skipped, so check the tags above against what this PR touches.

Selected scopes (50 files or classes, 271 tests)
  • tests/e2e/actions/doc_propagation/test_propagation.py
  • tests/e2e/actions/test_actions_shutdown.py
  • tests/e2e/authorization/test_aspect_write_auth.py
  • tests/e2e/authorization/test_domain_scoped_create_entity_auth.py
  • tests/e2e/authorization/test_domain_scoped_create_entity_auth.py::TestDomainScopedCreateEntityAuth
  • tests/e2e/authorization/test_privilege_grant_auth.py
  • tests/e2e/authorization/test_self_entity_auth.py
  • tests/e2e/browse/browse_test.py
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchBasic
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchDiagnose
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchDryRun
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchErrorHandling
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchFilterCombinations
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchFiltersByEntityType
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchFiltersByPlatform
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchPagination
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchProjectionLive
  • tests/e2e/cli/search_cmd/test_search_cmd.py::TestSearchWhereFilter
  • tests/e2e/dataproduct/test_dataproduct_hierarchy_delete.py
  • tests/e2e/delete/delete_assertion_cascade_test.py
  • tests/e2e/domains/domains_test.py
  • tests/e2e/entity_graph_cache/test_entity_graph_cache.py::TestContainer
  • tests/e2e/entity_graph_cache/test_entity_graph_cache.py::TestDomain
  • tests/e2e/entity_graph_cache/test_entity_graph_cache.py::TestGlossary
  • tests/e2e/entity_graph_cache/test_entity_graph_cache.py::TestMembership
  • tests/e2e/forms/forms_test.py
  • tests/e2e/frontend/test_static_asset_encodings.py
  • tests/e2e/graph/test_graph_client.py
  • tests/e2e/managed_ingestion/ingestion_source_run_events_test.py
  • tests/e2e/managed_ingestion/managed_ingestion_test.py
  • tests/e2e/mcp/mcp_test.py
  • tests/e2e/openapi/v3/test_scroll_relationships.py
  • tests/e2e/query_projection/test_query_projection_smoke.py
  • tests/e2e/read_only/test_search.py
  • tests/e2e/read_only/test_services_up.py
  • tests/e2e/search/test_lineage_search_index_fields.py
  • tests/e2e/search/test_search_projection.py::TestSearchProjection
  • tests/e2e/semantic/test_classical_embedding_provider.py::TestClassicalEmbeddingProvider
  • tests/e2e/semantic/test_config_fingerprint.py::TestConfigFingerprint
  • tests/e2e/semantic/test_current_offset_api.py
  • tests/e2e/semantic/test_event_driven_docs.py::TestEventDrivenDocumentIngestion
  • tests/e2e/semantic/test_event_mode_fallback.py::TestEventModeFallback
  • tests/e2e/semantic/test_local_embedding_provider.py::TestLocalEmbeddingProvider
  • tests/e2e/semantic/test_semantic_search.py::TestSemanticSearchWithIngestion
  • tests/e2e/semantic/test_source_type_filtering.py::TestSourceTypeFiltering
  • tests/e2e/semantic/test_stateful_ingestion.py::TestStatefulIngestion
  • tests/e2e/siblings/siblings_search_batching_test.py
  • tests/e2e/structured_properties/test_structured_properties.py
  • tests/e2e/structured_properties/test_validator_error_messages.py
  • tests/e2e/test_e2e.py

Add the run-all-tests:pytest label to run the full pytest suite on this PR.

Playwright E2E tests

This run: smart

  • Selection: smart: specs tagged aspect-validation, executor, graph-index, search plus the tests the change affects
  • Size: 54 tests in 9 spec files, ~9 min predicted on 2 shard(s)
Specs selected because of this PR (9)
Spec Tests Why
autocomplete-v2/autocomplete.spec.ts 2/2 tagged search
browse-v2/browse-v2.spec.ts 10/10 tagged search
logical-models/physical-children-view.spec.ts 2/2 tagged search
search/query-and-filter-search.spec.ts 10/10 tagged search
search/search-filters.spec.ts 5/5 tagged search
search/search-within-operator.spec.ts 1/1 tagged search
search/search.spec.ts 7/7 tagged search
search/searchv2.spec.ts 15/15 tagged search
task-runs-v2/task-runs.spec.ts 2/2 tagged executor

Add the run-all-tests:playwright label to run the full Playwright suite on this PR.

commit 758d515 · workflow run

@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@david-leifker david-leifker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This branch was successfully deployed

1 active deployment
Preview — 758d5158 Deployed Dec 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops PR or Issue related to DataHub backend & deployment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants