Skip to content
Open
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
12 changes: 8 additions & 4 deletions backend/src/analytics_agent/quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,16 +560,20 @@ def _ingest_metadata(gms_token: str) -> None:


def _write_demo_config(config_dir: Path, gms_token: str, llm_env: dict[str, str]) -> None:
"""Write .env and config.yaml for the demo (DataHub + Olist MySQL)."""
"""Write .env and config.yaml for the demo (DataHub + 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
6 changes: 6 additions & 0 deletions quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,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 +438,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

# Append LLM key if one was found in the environment — otherwise the wizard handles it
Expand Down
Loading