Skip to content

refactor(docker): move frontend, actions and ai-service env into env/docker - #21828

Open
devashish2203 wants to merge 10 commits into
pfp-8941-env-anchors-debugfrom
pfp-8941-env-anchors-frontend
Open

devashish2203 wants to merge 10 commits into
pfp-8941-env-anchors-debugfrom
pfp-8941-env-anchors-frontend

Conversation

@devashish2203

@devashish2203 devashish2203 commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #21827.

Moves the environment: values of the frontend, actions and ai-service compose services into env/docker layer and variant files. The rendered compose config is unchanged in every scenario.

Moved keys

Key Service(s) From To
DATAHUB_GMS_HOST, THEME_V2_DEFAULT, PLAY_HTTP_CONTEXT, LOG_AGGREGATOR_ENDPOINT, DATAHUB_AI_SERVICE_URL all frontend frontend service anchor env/docker/frontend.env (replaces stale DATAHUB_GMS_HOST line; stale DATAHUB_SECRET line removed)
DATAHUB_ANALYTICS_ENABLED frontend debug dev template env/docker/variants/debug/frontend.env
ACTIONS_EXTRA_PACKAGES, ACTIONS_CONFIG, SCHEMA_REGISTRY_URL all actions three templates + pgQueue anchor env/docker/actions.env (replaces stale SCHEMA_REGISTRY_URL)
DATAHUB_ACTIONS_SYSTEM_CONFIGS_PATH, PGQUEUE_HOST_PORT, PGQUEUE_DATABASE, PGQUEUE_USERNAME, PGQUEUE_PASSWORD, DATAHUB_PGQUEUE_SCHEMA, DATAHUB_PGQUEUE_TABLE_PREFIX 4 non-CDC Postgres actions services pgQueue anchor env/docker/variants/postgres/actions.env
DATAHUB_GMS_URL, DATAHUB_AI_MCP_ENABLED ai-service ai-service anchor new env/docker/ai-service.env (now a required entry)

The debug frontend services and the non-CDC Postgres actions services get their own anchored env_file lists (x-env-files-frontend-debug, x-env-files-actions-postgres) with the variant in place. The postgres-cdc actions services never used pgQueue and keep the base list.

Kept in environment:

  • JAVA_TOOL_OPTIONS (frontend debug): tied to debug port 5002.
  • AWS_PROFILE (bare pass-through) and AWS_SDK_LOAD_CONFIG (actions): tied to the ~/.aws mounts.
  • DATAHUB_AI_PORT: tied to the container port mapping.
  • PYTHONPATH (ai-service dev): tied to the source mounts.
  • DATAHUB_BASE_PATH, DATAHUB_GMS_BASE_PATH, DATAHUB_SYSTEM_CLIENT_SECRET (frontend): the GMS-side services keep them in environment: too, so all read the same shell value.
  • DATAHUB_SECRET (frontend): no env layer or ad-hoc file can replace it with a short legacy value, which stops Play 3 from starting.
  • DATAHUB_AI_TRUSTED_PROXIES (ai-service): only the frontend is trusted to name the client host; no env layer can widen that.

Interpolation: PLAY_HTTP_CONTEXT=${DATAHUB_BASE_PATH:-/} (frontend), SCHEMA_REGISTRY_URL (actions) and DATAHUB_GMS_URL (ai-service) read the base paths, which no file in their lists sets, so they resolve from the shell as the environment: values did.

Verification

Rendered with compose_env_snapshot.py (from #21820) on a clean copy of the base and on this branch, then diffed:

  • bare and shell (every profile), smoke, ai (both embedding variants), zdu: no differences (71 scenarios; debug-frontend is known-broken on the base too).
  • gradle: all 27 quickstart_configs keys, with the print task's docker/build.gradle copied over scratch copies only: no differences (quickstartDebugSearchSplit is known-broken on the base too).
  • Ad-hoc files (smoke-test/test_resources/actions/actions.env, CI ai-gms.env, smoke.common.env, zdu-test.env, spark smoke-gms.env) set none of the moved keys, so no precedence change.
  • ./gradlew :docker:generateQuickstartComposeConfig then git diff --exit-code docker/quickstart/: clean, no env_file key.
  • python3 smoke-test/check_env_parity.py: exit 0.

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 new tests
  • Docs related to the changes have been added/updated (if applicable): env/README.md
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Breaking Changes: not a breaking change

🤖 Generated with Claude Code


Summary by cubic

Moves the environment: values of the frontend, actions, and ai-service compose services into env/docker layer and variant files, leaving the rendered compose config unchanged in every scenario.

  • Frontend values move to env/docker/frontend.env; ai-service values to a new required env/docker/ai-service.env; actions values to env/docker/actions.env, with pgQueue values for non-CDC Postgres services in env/docker/variants/postgres/actions.env and the debug analytics default in env/docker/variants/debug/frontend.env.
  • The debug frontend and non-CDC Postgres actions services get variant-aware env_file lists; postgres-cdc actions services keep the base list.
  • Keys tied to a service port or mount (JAVA_TOOL_OPTIONS, AWS_PROFILE/AWS_SDK_LOAD_CONFIG, DATAHUB_AI_PORT, PYTHONPATH) stay in environment:, as do DATAHUB_SECRET and DATAHUB_AI_TRUSTED_PROXIES, which an env layer could otherwise override.
  • Rendered configs were diffed against the base branch across all profiles and scenarios with no differences.

Written for commit e429692. Summary will update on new commits.

View guided diff Turn on auto-fix

…docker

Move the frontend, actions and ai-service values out of the
docker/profiles compose anchors into env/docker layer and variant files:

- Frontend values go to env/docker/frontend.env, replacing the stale
  DATAHUB_GMS_HOST and DATAHUB_SECRET lines it carried. The debug
  analytics default goes to env/docker/variants/debug/frontend.env, read
  by the debug frontend services through their own env_file list.
- Actions values go to env/docker/actions.env, replacing the stale
  SCHEMA_REGISTRY_URL line. The pgQueue values of the non-CDC Postgres
  services go to env/docker/variants/postgres/actions.env.
- ai-service values go to the new env/docker/ai-service.env, now a
  required entry like the other service files.

The rendered compose config is unchanged in every scenario, and no ad-hoc
env file sets a moved key. Keys stay in environment: where they are tied
to a port or mount of the same service: JAVA_TOOL_OPTIONS (debug port),
AWS_PROFILE and AWS_SDK_LOAD_CONFIG (~/.aws mounts), DATAHUB_AI_PORT and
PYTHONPATH (source mounts).

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
This PR relocates inline environment: settings for frontend, actions, and ai-service into the env/docker layering model, matching how other DataHub Docker services are configured.

Frontend values such as PLAY_HTTP_CONTEXT, THEME_V2_DEFAULT, DATAHUB_AI_SERVICE_URL, and related settings move into env/docker/frontend.env. Debug frontend profiles use a new x-env-files-frontend-debug anchor that also pulls env/docker/variants/debug/frontend.env (e.g. DATAHUB_ANALYTICS_ENABLED). Secrets and base paths (DATAHUB_SECRET, DATAHUB_BASE_PATH, DATAHUB_GMS_BASE_PATH, DATAHUB_SYSTEM_CLIENT_SECRET) stay in compose environment: so shell interpolation stays aligned with GMS-side services.

Actions shared settings (ACTIONS_*, updated SCHEMA_REGISTRY_URL) land in env/docker/actions.env. The old postgres pgQueue environment: anchor is replaced by x-env-files-actions-postgres, which layers env/docker/variants/postgres/actions.env for the four non-CDC Postgres action services. CDC postgres actions keep the base env file list. AWS-related pass-throughs remain inline with the volume mounts.

AI service gets a required env/docker/ai-service.env (DATAHUB_GMS_URL, DATAHUB_AI_MCP_ENABLED). DATAHUB_AI_TRUSTED_PROXIES and DATAHUB_AI_PORT stay in compose so proxies and port mapping cannot be overridden by later env layers.

env/README.md documents ai-service in the docker env layout. The PR author reports rendered compose output is unchanged across verified scenarios.

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

@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: 47 of 861 tests in 1 batch, predicted longest batch ~1 min
  • Tags: change-type: docs; feature-user: analytics
  • Confidence: MEDIUM (9 changed files)
  • Classifier reasoning: The change reorganizes Docker Compose env files and moves DATAHUB_ANALYTICS_ENABLED into a debug variant, with no clear mapping to other taxonomy features beyond analytics.

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

Selected scopes (11 files or classes, 47 tests)
  • tests/e2e/analytics/test_analytics.py
  • tests/e2e/analytics/test_highlights.py
  • tests/e2e/audit_events/audit_events_test.py
  • tests/e2e/authorization/test_self_entity_auth.py
  • tests/e2e/delete/delete_assertion_cascade_test.py
  • tests/e2e/frontend/test_static_asset_encodings.py
  • tests/e2e/managed_ingestion/ingestion_source_run_events_test.py
  • tests/e2e/mcp/mcp_test.py
  • tests/e2e/read_only/test_analytics.py
  • tests/e2e/read_only/test_services_up.py
  • tests/e2e/search/test_search_projection.py::TestSearchProjection

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 analytics plus the tests the change affects
  • Size: 2 tests in 1 spec file, ~1 min predicted on 1 shard(s)
Specs selected because of this PR (1)
Spec Tests Why
analytics/analytics.spec.ts 2/2 tagged analytics

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

commit e429692 · workflow run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@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.

All reported issues were addressed across 9 files

Reply with feedback, questions, or to request a fix.

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

Comment thread docker/profiles/docker-compose.ai.yml Resolved
@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!

# Conflicts:
#	docker/profiles/docker-compose.frontend.yml
#	env/docker/frontend.env

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b73214d. Configure here.

…ompose environment

An env layer or ad-hoc env file could otherwise override them: a short
legacy DATAHUB_SECRET stops Play 3 from starting, and a wider
DATAHUB_AI_TRUSTED_PROXIES would trust forwarded hosts from other peers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@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.

All reported issues were addressed across 4 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

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

@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

@meticulous

meticulous Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ Meticulous evaluated 220 user flows and determined via code coverage that none of them exercise the code changed in this PR, so no replays were executed. View results.

Last updated for commit e429692 chore: merge the PR below in the stack. This comment will update as new commits are pushed.

@meticulous

meticulous Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Meticulous agent swarm testing found no browser-testable changes on e429692: view details.

No reachable UI: All changed units are Docker Compose environment configuration or documentation under `docker/profiles` and `env`, and neither browser channel runs the containers or backend services they configure.

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Initial JS bundle size ➡️

Base (758d515) This PR Diff
index.html (/login) 250 KB 250 KB +0 KB (+0.0%)
Logged-in shell 1.07 MB 1.07 MB +0 KB (+0.0%)
/search 1.25 MB 1.25 MB +0 KB (+0.0%)
/ (home) 1.27 MB 1.27 MB +0 KB (+0.0%)

index.html is the login page; logged-in pages add the shell. Gzip of the JS loaded before first paint. Codecov reports total bundle including lazy chunks — these intentionally differ.

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Boot web vitals (no backend)

Unauthenticated /login against the two dist/ trees from this job. No GMS — this is eager JS, not search/dataset payload. Lantern, desktop, 1x CPU. Does not forecast fleet p75; do not gate on LCP.

Web-vitals A/B — base (758d515) (A) vs pr (e429692) (B)

Lighthouse 12.8.2, throttling simulate (cpu 1x, rtt 40 ms, 10240 kbps). Form factor: desktop. Cache: cold (fresh incognito context per run). target n=3/build, 1 warm-up discarded, alternating A,B.

Boot-only (no GMS). Unauthenticated login route — eager JS/CSS/font transfer and parse, not search/dataset payload. Do not treat as a fleet p75.

boot

Measured runs in the table: A 3/3, B 3/3.

metric A p50 B p50 Δ p50 Δ% A p95 B p95
fcp 858 ms 854 ms -4 ms -0.5% 860 ms 856 ms
lcp 1317 ms 1307 ms -10 ms -0.8% 1325 ms 1312 ms
cls 0.0000 0.0000 0.0000 — 0.0000 0.0000
tbt 18 ms 12 ms -6 ms -31.4% 21 ms 15 ms
tti 1318 ms 1308 ms -10 ms -0.8% 1326 ms 1313 ms
ttfb 1 ms 1 ms 0 ms +0.4% 1 ms 1 ms
transferredBytes 1077.1 KB 1077.1 KB 0.0 KB +0.0% 1077.1 KB 1077.1 KB
mainThread 293 ms 293 ms 0 ms -0.2% 323 ms 317 ms
bootup 163 ms 153 ms -10 ms -6.2% 180 ms 158 ms

Resource transfer by type (p50):

type A bytes B bytes Δ bytes A requests B requests
document 1.3 KB 1.3 KB 0.0 KB 1 1
script 645.3 KB 645.3 KB 0.0 KB 8 8
stylesheet 3.0 KB 3.0 KB 0.0 KB 2 2
image 48.7 KB 48.7 KB 0.0 KB 1 1
media 257.3 KB 257.3 KB 0.0 KB 1 1
font 106.6 KB 106.6 KB 0.0 KB 3 3
other 0.0 KB 0.0 KB 0.0 KB 0 0

LCP element A: div > div.sc-fpAkvV > div.sc-pRPz > p.sc-pNWdM — Welcome to DataHub
LCP element B: div > div.sc-fpAkvV > div.sc-pRPz > p.sc-pNWdM — Welcome to DataHub

These numbers rank changes and gate regressions against the measured origin(s). They do not sum across PRs and do not forecast any fleet-wide production number.

This branch was successfully deployed

2 active deployments
Preview — e429692a Deployed Dec 4, 2026 by vercel[bot]
datahub-project-web-react (Preview) — e429692a Deployed Dec 4, 2026 by github-actions[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