feat(docker): run datahub-ai-service in quickstart and datahub-dev

Merged
NW
4d ago
+388-31

Stack. This is one PR in a series that adds a built-in MCP server to DataHub Core. It is based on na--ai-service-image-ci (the previous PR in the stack); review only its own commit. This PR changes GMS, the frontend, Docker or CI, not only the new Python packages. Everything user-facing is behind a GMS feature flag, MCP_SERVER_ENABLED, off by default (added in #21349).

Stack so far:

  1. #21332
  2. #21333
  3. #21334
  4. #21335
  5. #21336
  6. #21337
  7. #21338
  8. #21339
  9. #21340
  10. #21341
  11. #21342
  12. #21343
  13. #21344
  14. #21345
  15. #21346
  16. #21347
  17. #21348
  18. #21349
  19. #21350
  20. #21351
  21. #21352 ← this PR
  22. #21353
  23. #21435
  24. #21436
  25. #21437
  26. #21438
  27. #21439
  28. #21440
  29. #21441
  30. #21442
  31. #21443
  32. #21444
  33. #21445
  34. #21447
  35. #21501
  36. #21502
  37. #21503
  38. #21504
  39. #21505
  40. #21506
  41. #21507
  42. #21508
  43. #21509
  44. #21510
  45. #21511
  46. #21512

What this does

Quickstart profiles now start datahub-ai-service, and the frontend proxies
http://localhost:9002/mcp to it, so an MCP client needs only the URL (no
token while GMS auth is off).

The plain quickstart profile leaves it out for now: datahub docker quickstart runs that profile with the latest release's images, and no
release has published datahub-ai-service yet, so pulling it would stop the
whole stack from starting. It joins that profile once a release ships the
image. The other quickstart profiles (smoke tests, run-quickstart.sh) and
the debug profiles run it.

  • docker/profiles/docker-compose.ai.yml: the service publishes 9005 on the
    host's loopback only; remote clients go through the frontend. No
    depends_on (it answers 503 until GMS is up) and no compose healthcheck
    (the image has one). It trusts X-Forwarded-Host only from the frontend.
  • The frontend gets DATAHUB_AI_SERVICE_URL=http://datahub-ai-service:9005.
  • Debug profiles (all but debug-min) run the checkout's datahub-ai-service and
    datahub-core-mcp-tools sources over the installed packages, so a restart picks
    up changes; the image builds with the other Python services.
  • generateQuickstartComposeConfig keeps the DATAHUB_MAPPED_AI_PORT,
    DATAHUB_AI_MCP_ENABLED and DATAHUB_AI_IMAGE overrides, and the
    quickstart compose check fails if any user override is lost.
  • The image joins the release bake (multi-arch, tagged and published with
    the other images) and every quickstart config whose compose profile runs
    it. CI's image plan builds it when packages/datahub-ai-service,
    packages/datahub-core-mcp-tools, docker/datahub-ai-service, metadata-ingestion
    or the shared uv/SSL snippets change, and otherwise reuses the quickstart
    tag. The security scan covers it like the other images.
  • datahub-dev: DATAHUB_MAPPED_AI_PORT in the slot port table (and so in
    remote tunnels); changes under either package rebuild only
    datahub-ai-service (rebuild ai). AGENTS.md maps both packages to the
    container.

Tested with datahub-dev on a local OSS instance (GMS auth off): the service
comes up healthy from the compose file, and through the frontend legacy
and modern MCP clients call get_me with no token as the system user; a
foreign Host/Origin gets 403, ?token= 400 and OPTIONS 405.

Testing

datahub-dev start brought the service up healthy from compose on the OSS instance; through :14002/mcp legacy + modern clients called get_me with no token; 403 / 400 / 405 checks; datahub-dev unit tests (26); resolver scenario tests (58); quickstart compose check.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly PR Title Format)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). The MCP docs come later in the stack.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Breaking Changes. The release notes come later in the stack.

šŸ¤– Generated with Claude Code