Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions backend/src/analytics_agent/quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,13 +563,17 @@ def _write_demo_config(config_dir: Path, gms_token: str, llm_env: dict[str, str]
"""Write .env and config.yaml for the demo (DataHub + Fiction Retail MySQL)."""
import shutil

# The agent runs natively on the host, so MySQL and DataHub GMS are
# reachable via localhost even though they run inside Docker containers.
_demo_host = "localhost"

# .env
env_updates: dict[str, str] = {
"DATAHUB_GMS_URL": f"http://{_HOST_INTERNAL}:8080",
"DATAHUB_GMS_URL": f"http://{_demo_host}:8080",
"DATAHUB_GMS_TOKEN": gms_token,
"DATABASE_URL": (
f"mysql+aiomysql://{_DEMO_MYSQL_USER}:{_DEMO_MYSQL_PASS}"
f"@{_HOST_INTERNAL}:{_DEMO_MYSQL_PORT}/talkster"
f"@{_demo_host}:{_DEMO_MYSQL_PORT}/talkster"
),
"DISABLE_NEWER_GMS_FIELD_DETECTION": "true",
}
Expand All @@ -582,7 +586,7 @@ def _write_demo_config(config_dir: Path, gms_token: str, llm_env: dict[str, str]
shutil.copy(src, dest)
# Patch host references in the copied config
text = dest.read_text()
text = text.replace("${MYSQL_HOST}", _HOST_INTERNAL)
text = text.replace("${MYSQL_HOST}", _demo_host)
dest.write_text(text)

click.echo(f" ✓ Demo config written to {config_dir}/")
Expand Down
7 changes: 7 additions & 0 deletions quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ check_cmd docker "Install Docker Desktop: https://www.docker.com/products/
check_cmd datahub "Install DataHub CLI: pip install acryl-datahub"
check_cmd uv "Install uv: curl -LsSf https://astral.sh/uv/install.sh | sh"
check_cmd python3 "Install Python 3.11+: https://python.org"
check_cmd openssl "Install OpenSSL: https://openssl.org (needed to generate DataHub signing keys)"
# pnpm not required — the Docker image builds the frontend internally

# ──────────────────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -264,6 +265,10 @@ if _gms_healthy; then
else
go "No DataHub GMS found at ${DATAHUB_GMS_URL} — starting DataHub OSS quickstart..."

# DataHub v1.5+ requires these to be non-empty; auto-generate if not set.
export DATAHUB_TOKEN_SERVICE_SIGNING_KEY="${DATAHUB_TOKEN_SERVICE_SIGNING_KEY:-$(openssl rand -hex 32)}"
export DATAHUB_TOKEN_SERVICE_SALT="${DATAHUB_TOKEN_SERVICE_SALT:-$(openssl rand -hex 16)}"

# ── Optional: enable semantic search if OPENAI_API_KEY is available ───────
# Semantic search requires GMS to receive extra env vars that the default
# quickstart compose does not include. We inject them via a compose override
Expand Down Expand Up @@ -434,6 +439,8 @@ DATABASE_URL=mysql+aiomysql://${MYSQL_USER}:${MYSQL_PASSWORD}@host.docker.intern
# acryl stack sets this, causing it to enable cloud-only ES fields that fail.
# Force OSS mode so GraphQL queries use the correct field set.
DISABLE_NEWER_GMS_FIELD_DETECTION=true
# Point the agent at the config.yaml mounted into the container.
ENGINES_CONFIG=/app/config.yaml
EOF

# Pick the initial LLM_PROVIDER from what triggered the wizard, but always
Expand Down
Loading