diff --git a/docker/profiles/docker-compose.actions.yml b/docker/profiles/docker-compose.actions.yml index 2e47ee862c3a..32de9ce31ba4 100644 --- a/docker/profiles/docker-compose.actions.yml +++ b/docker/profiles/docker-compose.actions.yml @@ -33,10 +33,6 @@ x-datahub-actions-service: &datahub-actions-service required: false - ${DATAHUB_LOCAL_COMMON_ENV:-empty.env} - ${DATAHUB_LOCAL_ACTIONS_ENV:-empty2.env} - environment: - ACTIONS_EXTRA_PACKAGES: ${ACTIONS_EXTRA_PACKAGES:-} - ACTIONS_CONFIG: ${ACTIONS_CONFIG:-} - SCHEMA_REGISTRY_URL: http://datahub-gms:8080${DATAHUB_GMS_BASE_PATH:-}/schema-registry/api/ x-datahub-actions-service-dev: &datahub-actions-service-dev <<: *datahub-actions-service @@ -47,9 +43,6 @@ x-datahub-actions-service-dev: &datahub-actions-service-dev - *aws-config-mount - *aws-sso-cache-mount environment: - ACTIONS_EXTRA_PACKAGES: ${ACTIONS_EXTRA_PACKAGES:-} - ACTIONS_CONFIG: ${ACTIONS_CONFIG:-} - SCHEMA_REGISTRY_URL: http://datahub-gms:8080${DATAHUB_GMS_BASE_PATH:-}/schema-registry/api/ AWS_PROFILE: AWS_SDK_LOAD_CONFIG: ${AWS_SDK_LOAD_CONFIG:-1} @@ -59,26 +52,39 @@ x-datahub-actions-quickstart-service: &datahub-actions-quickstart-service - *aws-config-mount - *aws-sso-cache-mount environment: - ACTIONS_EXTRA_PACKAGES: ${ACTIONS_EXTRA_PACKAGES:-} - ACTIONS_CONFIG: ${ACTIONS_CONFIG:-} - SCHEMA_REGISTRY_URL: http://datahub-gms:8080${DATAHUB_GMS_BASE_PATH:-}/schema-registry/api/ AWS_PROFILE: AWS_SDK_LOAD_CONFIG: ${AWS_SDK_LOAD_CONFIG:-1} -# Non-CDC Postgres profiles use pgQueue-backed system action configs (Python consumer in container). -x-datahub-actions-postgres-pgqueue-env: &datahub-actions-postgres-pgqueue-env - ACTIONS_EXTRA_PACKAGES: ${ACTIONS_EXTRA_PACKAGES:-} - ACTIONS_CONFIG: ${ACTIONS_CONFIG:-} - SCHEMA_REGISTRY_URL: http://datahub-gms:8080${DATAHUB_GMS_BASE_PATH:-}/schema-registry/api/ - DATAHUB_ACTIONS_SYSTEM_CONFIGS_PATH: /etc/datahub/actions/system/conf-postgres-pgqueue - PGQUEUE_HOST_PORT: postgres:5432 - PGQUEUE_DATABASE: datahub - PGQUEUE_USERNAME: ${DATAHUB_EBEAN_DATASOURCE_ROOT_USERNAME:-datahub} - PGQUEUE_PASSWORD: ${DATAHUB_EBEAN_DATASOURCE_ROOT_PASSWORD:-datahub} - DATAHUB_PGQUEUE_SCHEMA: ${DATAHUB_PGQUEUE_SCHEMA:-queue} - DATAHUB_PGQUEUE_TABLE_PREFIX: ${DATAHUB_PGQUEUE_TABLE_PREFIX:-metadata_queue} - AWS_PROFILE: - AWS_SDK_LOAD_CONFIG: ${AWS_SDK_LOAD_CONFIG:-1} +# Non-CDC Postgres profiles use pgQueue-backed system action configs (variants/postgres). The +# postgres-cdc services do not, so they keep the base list. +x-env-files-actions-postgres: &env-files-actions-postgres + - path: ../../env/docker/all.env + required: false + - ../../env/docker/actions.env + - path: ../../env/docker/${DATAHUB_ENV_MODE:-local}/all.env + required: false + - path: ../../env/docker/${DATAHUB_ENV_MODE:-local}/actions.env + required: false + - path: ../../env/docker/variants/postgres/actions.env + required: false + - path: ${DATAHUB_ENV_EXTENSION_DIR:-.unset}/docker/all.env + required: false + - path: ${DATAHUB_ENV_EXTENSION_DIR:-.unset}/docker/actions.env + required: false + - path: ${DATAHUB_ENV_JOB_DIR:-.unset}/all.env + required: false + - path: ${DATAHUB_ENV_JOB_DIR:-.unset}/actions.env + required: false + - path: ${DATAHUB_ENV_JOB_DIR:-.unset}/${DATAHUB_ENV_MODE:-local}/all.env + required: false + - path: ${DATAHUB_ENV_JOB_DIR:-.unset}/${DATAHUB_ENV_MODE:-local}/actions.env + required: false + - path: ${DATAHUB_ENV_JOB_DIR:-.unset}/docker/all.env + required: false + - path: ${DATAHUB_ENV_JOB_DIR:-.unset}/docker/actions.env + required: false + - ${DATAHUB_LOCAL_COMMON_ENV:-empty.env} + - ${DATAHUB_LOCAL_ACTIONS_ENV:-empty2.env} services: datahub-actions-quickstart: @@ -119,8 +125,7 @@ services: condition: service_healthy postgres: condition: service_healthy - environment: - <<: *datahub-actions-postgres-pgqueue-env + env_file: *env-files-actions-postgres datahub-actions-quickstart-postgres-consumers: <<: *datahub-actions-quickstart-service profiles: @@ -130,8 +135,7 @@ services: condition: service_healthy postgres: condition: service_healthy - environment: - <<: *datahub-actions-postgres-pgqueue-env + env_file: *env-files-actions-postgres datahub-actions-quickstart-consumers: <<: *datahub-actions-quickstart-service profiles: @@ -184,8 +188,7 @@ services: condition: service_healthy postgres: condition: service_healthy - environment: - <<: *datahub-actions-postgres-pgqueue-env + env_file: *env-files-actions-postgres datahub-actions-debug-postgres-consumers: <<: *datahub-actions-service-dev profiles: @@ -195,8 +198,7 @@ services: condition: service_healthy postgres: condition: service_healthy - environment: - <<: *datahub-actions-postgres-pgqueue-env + env_file: *env-files-actions-postgres datahub-actions-debug-postgres-cdc: <<: *datahub-actions-service-dev profiles: diff --git a/docker/profiles/docker-compose.ai.yml b/docker/profiles/docker-compose.ai.yml index 15a74fb917a6..dc51628bb5d9 100644 --- a/docker/profiles/docker-compose.ai.yml +++ b/docker/profiles/docker-compose.ai.yml @@ -10,8 +10,7 @@ x-datahub-ai-service: &datahub-ai-service env_file: - path: ../../env/docker/all.env required: false - - path: ../../env/docker/ai-service.env - required: false + - ../../env/docker/ai-service.env - path: ../../env/docker/${DATAHUB_ENV_MODE:-local}/all.env required: false - path: ../../env/docker/${DATAHUB_ENV_MODE:-local}/ai-service.env @@ -34,10 +33,10 @@ x-datahub-ai-service: &datahub-ai-service required: false - ${DATAHUB_LOCAL_COMMON_ENV:-empty.env} environment: &datahub-ai-service-env - DATAHUB_GMS_URL: http://datahub-gms:8080${DATAHUB_GMS_BASE_PATH:-} + # Matches the container port in ports:. DATAHUB_AI_PORT: 9005 - DATAHUB_AI_MCP_ENABLED: ${DATAHUB_AI_MCP_ENABLED:-true} - # The frontend proxies /mcp and says which host the client used; believe only it. + # The frontend proxies /mcp and names the client host; believe only it. Kept here, not in an + # env file, so no later env layer can widen who is trusted. DATAHUB_AI_TRUSTED_PROXIES: datahub-frontend-react restart: on-failure stop_grace_period: 30s diff --git a/docker/profiles/docker-compose.frontend.yml b/docker/profiles/docker-compose.frontend.yml index ba3c6760e918..740632d4ac8d 100644 --- a/docker/profiles/docker-compose.frontend.yml +++ b/docker/profiles/docker-compose.frontend.yml @@ -33,33 +33,57 @@ x-datahub-frontend-service: &datahub-frontend-service required: false - ${DATAHUB_LOCAL_COMMON_ENV:-empty.env} - ${DATAHUB_LOCAL_FRONTEND_ENV:-empty2.env} + # The base paths and client secret stay in environment:, as on the GMS-side services, so every + # service reads the same shell value. The rest of the frontend env is in env/docker/frontend.env. environment: &datahub-frontend-service-env - DATAHUB_GMS_HOST: ${DATAHUB_GMS_HOST:-datahub-gms} - DATAHUB_SYSTEM_CLIENT_SECRET: ${DATAHUB_SYSTEM_CLIENT_SECRET:-JohnSnowKnowsNothing} # Play 3 maps this to play.http.secret.key; HS256 requires >=256 bits (see ApplicationSecret). - # Overrides env_file when unset on host; use a long random value in production. + # Use a long random value in production. DATAHUB_SECRET: ${DATAHUB_SECRET:-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef} - THEME_V2_DEFAULT: ${THEME_V2_DEFAULT:-true} - PLAY_HTTP_CONTEXT: ${DATAHUB_BASE_PATH:-/} - # The base paths stay here so they always match PLAY_HTTP_CONTEXT above. + DATAHUB_SYSTEM_CLIENT_SECRET: ${DATAHUB_SYSTEM_CLIENT_SECRET:-JohnSnowKnowsNothing} DATAHUB_BASE_PATH: ${DATAHUB_BASE_PATH:-/} DATAHUB_GMS_BASE_PATH: ${DATAHUB_GMS_BASE_PATH:-/} - LOG_AGGREGATOR_ENDPOINT: ${LOG_AGGREGATOR_ENDPOINT:-} - # /mcp is proxied to datahub-ai-service (docker-compose.ai.yml). - DATAHUB_AI_SERVICE_URL: ${DATAHUB_AI_SERVICE_URL:-http://datahub-ai-service:9005} volumes: - ${HOME}/.datahub/plugins:/etc/datahub/plugins +x-env-files-frontend-debug: &env-files-frontend-debug + - path: ../../env/docker/all.env + required: false + - ../../env/docker/frontend.env + - path: ../../env/docker/${DATAHUB_ENV_MODE:-local}/all.env + required: false + - path: ../../env/docker/${DATAHUB_ENV_MODE:-local}/frontend.env + required: false + - path: ../../env/docker/variants/debug/frontend.env + required: false + - path: ${DATAHUB_ENV_EXTENSION_DIR:-.unset}/docker/all.env + required: false + - path: ${DATAHUB_ENV_EXTENSION_DIR:-.unset}/docker/frontend.env + required: false + - path: ${DATAHUB_ENV_JOB_DIR:-.unset}/all.env + required: false + - path: ${DATAHUB_ENV_JOB_DIR:-.unset}/frontend.env + required: false + - path: ${DATAHUB_ENV_JOB_DIR:-.unset}/${DATAHUB_ENV_MODE:-local}/all.env + required: false + - path: ${DATAHUB_ENV_JOB_DIR:-.unset}/${DATAHUB_ENV_MODE:-local}/frontend.env + required: false + - path: ${DATAHUB_ENV_JOB_DIR:-.unset}/docker/all.env + required: false + - path: ${DATAHUB_ENV_JOB_DIR:-.unset}/docker/frontend.env + required: false + - ${DATAHUB_LOCAL_COMMON_ENV:-empty.env} + - ${DATAHUB_LOCAL_FRONTEND_ENV:-empty2.env} + x-datahub-frontend-service-dev: &datahub-frontend-service-dev <<: *datahub-frontend-service image: ${DATAHUB_FRONTEND_IMAGE:-${DATAHUB_REPO:-acryldata}/datahub-frontend-react}:${DATAHUB_FRONTEND_VERSION:-${DATAHUB_VERSION:-debug}} ports: - ${DATAHUB_MAPPED_FRONTEND_DEBUG_PORT:-5002}:5002 - ${DATAHUB_MAPPED_FRONTEND_PORT:-9002}:9002 + env_file: *env-files-frontend-debug environment: <<: *datahub-frontend-service-env JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5002 - DATAHUB_ANALYTICS_ENABLED: ${DATAHUB_ANALYTICS_ENABLED:-true} volumes: - ../../datahub-frontend/build/stage/main:/datahub-frontend # Removed nested mount - causes virtiofs mountpoint error in Docker Desktop >= 4.42.0 diff --git a/env/README.md b/env/README.md index 8b1c3e0fd8a8..81772ff3e35f 100644 --- a/env/README.md +++ b/env/README.md @@ -11,7 +11,7 @@ the rest of their env still lives in `docker/profiles/*` and `smoke-test/smoke.* env/ common/ values that are the same on every stack and job docker/ base env of the Docker services (`gms`, `system-update`, `frontend`, `actions`, - `mae-consumer`, `mce-consumer`), read by compose only + `mae-consumer`, `mce-consumer`, `ai-service`), read by compose only docker-free/ values for the Docker-free stack (H2, pgqueue, embedded OpenSearch, ports) extensions// one launcher extension's values, with the same common/ and docker-free/ folders, plus any conditional folders the extension adds diff --git a/env/docker/actions.env b/env/docker/actions.env index 3c77a5a6fb72..6ce107c89acc 100644 --- a/env/docker/actions.env +++ b/env/docker/actions.env @@ -3,8 +3,7 @@ DATAHUB_GMS_HOST=datahub-gms DATAHUB_GMS_PORT=8080 KAFKA_BOOTSTRAP_SERVER=broker:29092 -SCHEMA_REGISTRY_URL=http://schema-registry:8081 -# SCHEMA_REGISTRY_URL=http://datahub-gms:8080/schema-registry/api/ +SCHEMA_REGISTRY_URL=http://datahub-gms:8080${DATAHUB_GMS_BASE_PATH:-}/schema-registry/api/ ELASTICSEARCH_HOST=search ELASTICSEARCH_PORT=9200 @@ -17,6 +16,9 @@ METADATA_CHANGE_LOG_VERSIONED_TOPIC_NAME=MetadataChangeLog_Versioned_v1 # to keep ephemeral storage from growing. See docs/docker/bundled-ingestion-venvs.md. UV_LINK_MODE=hardlink +ACTIONS_EXTRA_PACKAGES=${ACTIONS_EXTRA_PACKAGES:-} +ACTIONS_CONFIG=${ACTIONS_CONFIG:-} + # System Auth -- DATAHUB_SYSTEM_CLIENT_ID=__datahub_system DATAHUB_SYSTEM_CLIENT_SECRET=JohnSnowKnowsNothing diff --git a/env/docker/ai-service.env b/env/docker/ai-service.env new file mode 100644 index 000000000000..1add3e324948 --- /dev/null +++ b/env/docker/ai-service.env @@ -0,0 +1,2 @@ +DATAHUB_GMS_URL=http://datahub-gms:8080${DATAHUB_GMS_BASE_PATH:-} +DATAHUB_AI_MCP_ENABLED=${DATAHUB_AI_MCP_ENABLED:-true} diff --git a/env/docker/frontend.env b/env/docker/frontend.env index 8b9cd19d8ea4..ef4265515617 100644 --- a/env/docker/frontend.env +++ b/env/docker/frontend.env @@ -1,17 +1,9 @@ -DATAHUB_GMS_HOST=datahub-gms +DATAHUB_GMS_HOST=${DATAHUB_GMS_HOST:-datahub-gms} DATAHUB_GMS_PORT=8080 -DATAHUB_SECRET=YouKnowNothing DATAHUB_APP_VERSION=${DATAHUB_APP_VERSION:-${DATAHUB_VERSION:-v1.0.0}} DATAHUB_PLAY_MEM_BUFFER_SIZE=10MB JAVA_OPTS=-Xms512m -Xmx512m -Dhttp.port=9002 -Dconfig.file=datahub-frontend/conf/application.conf -Djava.security.auth.login.config=datahub-frontend/conf/jaas.conf -Dlogback.configurationFile=datahub-frontend/conf/logback.xml -Dlogback.debug=false -Dpidfile.path=/dev/null -# Base Path Configuration -# Uncomment both to serve DataHub from a custom base path (e.g., "/datahub") -# This allows DataHub to be served from a subdirectory instead of the root path -# DATAHUB_BASE_PATH=${DATAHUB_BASE_PATH} -# play.http.context must be / when DATAHUB_BASE_PATH is unset, otherwise is set to DATAHUB_BASE_PATH when using a custom base path -# PLAY_HTTP_CONTEXT=${DATAHUB_BASE_PATH:-/} - # Uncomment and set these to support SSL connection to GMS # NOTE: Currently GMS itself does not offer SSL support, these settings are intended for when there is a proxy in front # of GMS that handles SSL, such as an EC2 Load Balancer. @@ -94,3 +86,12 @@ FRONTEND_GRACEFUL_SHUTDOWN_ENABLED=false FRONTEND_BEFORE_SERVICE_UNBIND_TIMEOUT=10s FRONTEND_SERVICE_REQUESTS_DONE_TIMEOUT=65s FRONTEND_SERVICE_STOP_TIMEOUT=15s + +# play.http.context follows DATAHUB_BASE_PATH; set DATAHUB_BASE_PATH (e.g. "/datahub") to serve +# DataHub from a subdirectory. +PLAY_HTTP_CONTEXT=${DATAHUB_BASE_PATH:-/} + +THEME_V2_DEFAULT=${THEME_V2_DEFAULT:-true} +LOG_AGGREGATOR_ENDPOINT=${LOG_AGGREGATOR_ENDPOINT:-} +# /mcp is proxied to datahub-ai-service (docker-compose.ai.yml). +DATAHUB_AI_SERVICE_URL=${DATAHUB_AI_SERVICE_URL:-http://datahub-ai-service:9005} diff --git a/env/docker/variants/debug/frontend.env b/env/docker/variants/debug/frontend.env new file mode 100644 index 000000000000..8bd53d7b955c --- /dev/null +++ b/env/docker/variants/debug/frontend.env @@ -0,0 +1,2 @@ +# Debug frontend: client-side analytics events persisted. +DATAHUB_ANALYTICS_ENABLED=${DATAHUB_ANALYTICS_ENABLED:-true} diff --git a/env/docker/variants/postgres/actions.env b/env/docker/variants/postgres/actions.env new file mode 100644 index 000000000000..a984580e727c --- /dev/null +++ b/env/docker/variants/postgres/actions.env @@ -0,0 +1,8 @@ +# Non-CDC Postgres profiles use pgQueue-backed system action configs (Python consumer in container). +DATAHUB_ACTIONS_SYSTEM_CONFIGS_PATH=/etc/datahub/actions/system/conf-postgres-pgqueue +PGQUEUE_HOST_PORT=postgres:5432 +PGQUEUE_DATABASE=datahub +PGQUEUE_USERNAME=${DATAHUB_EBEAN_DATASOURCE_ROOT_USERNAME:-datahub} +PGQUEUE_PASSWORD=${DATAHUB_EBEAN_DATASOURCE_ROOT_PASSWORD:-datahub} +DATAHUB_PGQUEUE_SCHEMA=${DATAHUB_PGQUEUE_SCHEMA:-queue} +DATAHUB_PGQUEUE_TABLE_PREFIX=${DATAHUB_PGQUEUE_TABLE_PREFIX:-metadata_queue}