Skip to content

feat(lakehouse): add Docker Compose installation - #20621

Open
cshuo wants to merge 3 commits into
apache:masterfrom
cshuo:codex/docker-lakehouse-installation
Open

cshuo wants to merge 3 commits into
apache:masterfrom
cshuo:codex/docker-lakehouse-installation

Conversation

@cshuo

@cshuo cshuo commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Describe the issue this Pull Request addresses

Closes #20620. Part of #20619 and RFC-117 (#20575).

Add a Docker Compose installation for users who want to try the Hudi lakehouse without setting up a host JDK, Maven, Kubernetes, or Helm. From a checkout, ./hudi-lakehouse/docker/lakehouse.sh up --build starts the stack, loads sample data, and verifies the MCP query path. Subsequent starts can reuse the images with ./hudi-lakehouse/docker/lakehouse.sh up.

Summary and Changelog

Docker Lakehouse — Access & Query Paths

  • Package MinIO, persistent Derby-backed Hive Metastore, Spark Connect, sample-data initialization, and the existing agent gateway. Preserve the Spark Connect → HMS-backed HoodieCatalog query path and read-only gateway tools.
  • Add installer preflight checks, readiness checks, diagnostics, and explicit lifecycle commands. Running without arguments shows help without contacting Docker; starting services requires up. Support host Ollama, optional containerized Ollama with model caching, and API providers.
  • Check chat readiness separately from lakehouse startup. The default is host Ollama with qwen3:8b; other providers require explicit GATEWAY_LLM_PROVIDER configuration, and API keys alone do not select a provider. An unavailable LLM or missing API model produces a warning while successful MCP checks allow startup to complete. Chat UI and HTTP Chat API remain exposed and require a usable Gateway LLM; external MCP clients use their own model.
  • Keep image consumption in compose.yaml and opt-in source builds in compose.build.yaml. Consolidate HMS and S3A configuration in hive-site.xml and document each service's role.
  • Initialize and validate only missing demo tables; preserve existing tables, user edits, deletions and empty tables across restarts. Use LIMIT 1 reads for MCP startup checks and retain strict demo validation in lakehouse.sh test. Run seed with init: true; on timeout, request Spark query cancellation with a bounded cleanup period. Document recovery from interrupted initialization. Recover an initialized HMS schema when its completion marker is missing.
  • Reject --local-llm conflicts with an explicitly configured API provider before building or starting services. Pin the default Hive image by digest and support a HIVE_IMAGE override.
  • Add regression tests and an opt-in Docker live acceptance workflow for MCP queries, persistence without reseeding, repeated installation, and preservation of modified data and empty tables.

Impact

Adds a local Docker installation with localhost-bound Chat UI, MCP, Spark Connect, and MinIO console endpoints. Existing Helm charts, gateway interfaces, and the Hudi storage format are unchanged.

This is the checkout-based Compose installation and contributor build path. Publishing release images, versioned downloads, the public bootstrap endpoint, catalog adapters, and semantic-layer integration remain separate work under the umbrella issue. Default application image tags are local build tags, not published ASF artifacts.

Service startup, validation of newly initialized demo tables, and MCP failures still fail the command. Existing demo data does not have to match the original samples for startup to succeed; the explicit test command still checks sample counts, totals and joins without modifying data. Explicit --local-llm startup/model-download failures also fail; invalid required API-provider configuration can prevent the Gateway from starting.

Risk Level

Low: changes are confined to the new Docker installation, its documentation, and tests. The local demo uses fixed storage credentials and unauthenticated services bound to localhost; it is not a production deployment.

Validation completed locally:

  • All 31 Docker regression tests passed; shell syntax and diff checks passed.
  • Isolated Docker acceptance passed with the updated startup probes: fresh initialization, strict demo verification, updates/deletions, restart with an empty table, and MCP reads. Strict demo verification rejected modified data without changing it. Test containers and volumes were cleaned up.
  • A shortened seed timeout during a real slow CTAS requested cancellation and exited with code 124; Spark had no running jobs afterward. A stalled cancellation was also terminated by the bounded grace timer.
  • Killing the disposable Spark server mid-CTAS left .hoodie files without an HMS entry; a subsequent CTAS rejected the existing path instead of overwriting it. The README documents stopping server work before retrying and the destructive full-reset option for disposable demos.
  • Earlier local acceptance also covered unreachable Ollama and a missing API model (a placeholder key satisfied Gateway configuration validation). Both emitted chat-unavailable messages while MCP remained usable.
  • Fresh image builds and installation with new data volumes passed.
  • MCP discovery, schema inspection, and joins through Spark Connect/HMS/MinIO passed.
  • Executed both documented mcp add commands and verified Claude Code and Codex CLI using the saved HTTP registrations at http://localhost:8000/mcp/. Each completed seven real MCP calls with expected counts, city totals and joins. Localhost bypassed the host HTTP proxy via NO_PROXY; Claude Code used the existing model proxy configuration.
  • Real local Ollama chat (qwen3:0.6b) invoked the SQL tool and returned expected city totals of 33, 55, and 77.
  • HMS loaded S3A settings from hive-site.xml and created, inspected, and deleted a test directory in MinIO.
  • Container recreation without seeding, missing-schema-marker recovery, cached-model reuse, and repeated installation passed; sample counts remained 9 trips and 3 drivers.

The Docker live acceptance workflow passed on the fork via workflow_dispatch at commit 0943ddd424c: successful run. The Ubuntu hosted-runner job completed in 4 minutes 34 seconds, including fresh image builds, installation, persistence checks, repeated startup, and modified/empty-table preservation. Hosted-provider authentication/inference and the default 8B model were not exercised by these acceptance runs.

Documentation Update

Organize the Docker guide around startup, querying through MCP, and querying through Chat UI. Include Claude Code and Codex CLI registration commands, sample queries and expected results; keep lifecycle commands and technical reference material in later sections. Add the environment example and Compose service comments, and link the guide from the lakehouse README.

Contributor's checklist

  • Read through contributor's guide
  • Enough context is provided in the sections above
  • Adequate tests were added if applicable

@cshuo
cshuo marked this pull request as draft November 12, 2026 03:04
@github-actions github-actions Bot added the size:XL PR with lines of changes > 1000 label Nov 12, 2026
@codecov-commenter

codecov-commenter commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.16%. Comparing base (c32b64e) to head (0943ddd).
⚠️ Report is 39 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #20621      +/-   ##
============================================
- Coverage     80.87%   78.16%   -2.71%     
+ Complexity    36169    34917    -1252     
============================================
  Files          2589     2589              
  Lines        147664   147678      +14     
  Branches      18242    18244       +2     
============================================
- Hits         119425   115439    -3986     
- Misses        20018    23780    +3762     
- Partials       8221     8459     +238     
Components Coverage Δ
hudi-common 82.58% <ø> (-1.58%) ⬇️
hudi-client 79.76% <ø> (-4.30%) ⬇️
hudi-flink 86.35% <ø> (ø)
hudi-spark-datasource 66.37% <ø> (-8.00%) ⬇️
hudi-utilities 79.31% <ø> (-0.01%) ⬇️
hudi-cli 70.80% <ø> (ø)
hudi-hadoop 69.05% <ø> (-2.13%) ⬇️
hudi-sync 77.24% <ø> (-0.08%) ⬇️
hudi-io 81.52% <ø> (ø)
hudi-timeline-service 78.53% <ø> (-4.88%) ⬇️
hudi-cloud 81.01% <ø> (ø)
hudi-kafka-connect 57.90% <ø> (ø)
Flag Coverage Δ
common-and-other-modules 52.33% <ø> (-0.01%) ⬇️
hadoop-mr-java-client 43.95% <ø> (+<0.01%) ⬆️
spark-client-hadoop-common 37.62% <ø> (-0.01%) ⬇️
spark-java-tests 31.22% <ø> (-20.36%) ⬇️
spark-scala-tests 46.45% <ø> (+<0.01%) ⬆️
utilities 37.71% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 391 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cshuo
cshuo force-pushed the codex/docker-lakehouse-installation branch from 8245107 to 910f74b Compare November 12, 2026 07:42
@cshuo
cshuo marked this pull request as ready for review November 12, 2026 07:43
@cshuo
cshuo force-pushed the codex/docker-lakehouse-installation branch 4 times, most recently from df0a2d6 to d49bd44 Compare November 12, 2026 11:51
Comment thread hudi-lakehouse/docker/compose.yaml Resolved
Comment thread hudi-lakehouse/docker/lakehouse.sh Resolved
Comment thread hudi-lakehouse/docker/scripts/seed.py Resolved
Package MinIO, Hive Metastore, Spark Connect and the agent gateway with
sample data, readiness checks and optional containerized Ollama support.
Keep Spark Connect queries on the HMS-backed HoodieCatalog.
@cshuo
cshuo force-pushed the codex/docker-lakehouse-installation branch from d49bd44 to 2188671 Compare November 16, 2026 03:02
@cshuo
cshuo requested a review from nsivabalan November 17, 2026 02:49

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

Thanks for the thorough work here, and for turning around the earlier round quickly. This change only adds files under hudi-lakehouse/docker/ plus a workflow_dispatch-only workflow. There are no Hudi storage, API or config changes, and the compose contracts and installer have good unit coverage (already picked up by agent_gateway_ci.yml's chart-lint job). Nothing blocking from me. A few things before merge:

Important

  1. A seed timeout leaves the server-side CTAS running. Details inline on seed.py.
  2. Please run the live acceptance workflow once. Trigger hudi_lakehouse_docker_live.yml on your fork with workflow_dispatch and link a green run. It's the only check of the real build → HMS → MinIO → Connect path.
  3. Issue #20620 no longer matches this PR. It still describes --mcp-only and says unavailable models/providers produce readiness failures. This PR rejects --mcp-only and makes chat failures warnings, which I think is the better design, but could you update the issue's commands and acceptance checklist so the record matches what ships?

Suggestions

  • seed.py validates a newly created table only once. If CTAS succeeds but verify() fails, the next up says "Preserving existing table" and passes. That fits the keep-existing-data design. A README line saying lakehouse.sh test is the strict check would help.
  • The free Chainguard MinIO/mc images only publish latest. Can you confirm the pinned digests stay pullable? If they get GC'd, a fresh install breaks with no code change. A short note in .env.example about overriding MINIO_IMAGE / MINIO_CLIENT_IMAGE would give users a way out.
  • ANTHROPIC_API_KEY / OPENAI_API_KEY are passed into the gateway container even when the provider is ollama. It's harmless on localhost, but passing them only when needed would be cleaner.
  • check-connect.py overlaps with images/spark-connect/check-ready.py. That's justified, since check-ready.py needs a table and won't work on a first boot with an empty catalog. A one-line comment saying so would stop someone from "deduplicating" it later.

Nit

  • In seed.py, the expected row counts could sit in a dict next to DEMO_TABLES rather than 3 if table == 'drivers' else 9.

Comment thread hudi-lakehouse/docker/scripts/seed.py Resolved
Comment thread hudi-lakehouse/docker/compose.yaml Resolved
Comment thread hudi-lakehouse/docker/lakehouse.sh Resolved
@nsivabalan

nsivabalan commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

@cshuo a heads-up on two RFC-117 requirements that affect the installation work in this PR and in #20737 (minikube). Neither needs to block these PRs. They can land as follow-ups, but it would help to keep the Spark SQL Connect image selectable (an image variable in Compose and a value in the chart) so they plug in cleanly.

  1. Published images per release (Publish Docker images for the Docker Compose lakehouse install with each release (explore and propose) #20985). The Docker Compose install should pull prebuilt release images and not build from source. The source-build override can stay opt-in for contributors. Publish Docker images for the Docker Compose lakehouse install with each release (explore and propose) #20985 explores the ASF registry and the release-process side.
  2. Opt-in native bundle (Opt-in Hudi native Spark bundle (--native-bundle) for the lakehouse Spark SQL Connect server #20986). By default, Spark SQL Connect uses the regular Hudi Spark bundle. With lakehouse.sh up --native-bundle (and a matching Helm value), it should run the native bundle from feat(spark): add hudi-spark-native-bundle packaging Apache DataFusion Comet #19674 / RFC-113, which packages DataFusion Comet. This means a second Spark SQL Connect image on the same Spark version, plus the Comet and off-heap Spark configs. The full scope is in Opt-in Hudi native Spark bundle (--native-bundle) for the lakehouse Spark SQL Connect server #20986.

@cshuo

cshuo commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

@cshuo a heads-up on two RFC-117 requirements that affect the installation work in this PR and in #20737 (minikube). Neither needs to block these PRs. They can land as follow-ups, but it would help to keep the Spark SQL Connect image selectable (an image variable in Compose and a value in the chart) so they plug in cleanly.

  1. Published images per release (Publish Docker images for the Docker Compose lakehouse install with each release (explore and propose) #20985). The Docker Compose install should pull prebuilt release images and not build from source. The source-build override can stay opt-in for contributors. Publish Docker images for the Docker Compose lakehouse install with each release (explore and propose) #20985 explores the ASF registry and the release-process side.
  2. Opt-in native bundle (Opt-in Hudi native Spark bundle (--native-bundle) for the lakehouse Spark SQL Connect server #20986). By default, Spark SQL Connect uses the regular Hudi Spark bundle. With lakehouse.sh up --native-bundle (and a matching Helm value), it should run the native bundle from feat(spark): add hudi-spark-native-bundle packaging Apache DataFusion Comet #19674 / RFC-113, which packages DataFusion Comet. This means a second Spark SQL Connect image on the same Spark version, plus the Comet and off-heap Spark configs. The full scope is in Opt-in Hudi native Spark bundle (--native-bundle) for the lakehouse Spark SQL Connect server #20986.

@nsivabalan Thanks for the heads-up! Compose already exposes SPARK_CONNECT_IMAGE, with source builds opt-in via --build. Published images and --native-bundle support can follow in #20985 and #20986.

@hudi-bot

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL PR with lines of changes > 1000

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Docker Compose installation for the Hudi lakehouse

5 participants