Repository navigation
Switch Iceberg catalog tests to use standard MinIO (with_minio=True) - #102861
alexey-milovidov merged 6 commits into
Conversation
56caacd to
bf2249e
Compare
|
@azat I've reworked this to implement the TODOs as you requested: What changed:
On
Could be a follow-up if desired, but it requires updating all catalog service environment variables and potentially rebuilding the HMS image. Session: |
|
@azat I investigated the The blocker: port mismatchStandard Adding OptionsA. Update Iceberg code to B. Change standard MinIO to port 9000 (the actual S3 standard port). Cleanest long-term, but touches 318+ hardcoded references across dozens of test suites. Much larger scope. C. Keep current approach (v2): remove I can do A — it's about 11 files total. Should I rework the PR that way, or is the current v2 acceptable as a first step? Session: |
|
Workflow [PR], commit [459c132] Summary: ✅ AI ReviewSummaryThis PR migrates Iceberg/Glue/HMS/Nessie integration catalog tests from per-compose Final VerdictStatus: ✅ Approve |
… (with_minio=True) Remove per-catalog custom MinIO and mc containers from all 5 Iceberg-related Docker Compose files. Catalogs now depend on the standard minio1 service (port 9001) provided by with_minio=True. Changes: - Remove minio, mc, and spark-iceberg services from compose files - Update all catalog S3 endpoints from minio:9000 to minio1:9001 - Add CATALOG_S3_PATH__STYLE__ACCESS=true to REST catalog - Mount overridden core-site.xml for HMS to use minio1:9001 - Auto-enable with_minio when any catalog flag is set in cluster.py - Create catalog buckets (warehouse-rest, warehouse-hms, warehouse-glue, iceberg_data) on standard MinIO during cluster startup - Update all test code references from minio:9000 to minio1:9001 Closes ClickHouse#102442 Co-Authored-By: Claude Opus 4.6 <[email protected]>
bf2249e to
48a014a
Compare
|
@azat — v3 rework: switched all 5 Iceberg catalog compose files to use the standard What changed:
This eliminates 2-3 extra containers per test (custom minio + mc + spark-iceberg) by reusing the standard test MinIO infrastructure. Session: |
The standard MinIO (minio1) enforces strict S3 bucket naming rules that prohibit underscores. The old custom MinIO was permissive about this. After migrating to minio1 in v3, all Iceberg integration tests fail at cluster startup because create_minio_buckets tries to create a bucket named "iceberg_data" which is rejected with InvalidBucketName. Fix: rename to "iceberg-data" (hyphen instead of underscore) in the two S3-facing locations — cluster.py bucket creation and REST catalog compose file. All other "iceberg_data" references are local filesystem paths (/var/lib/clickhouse/user_files/iceberg_data/) which don't need to follow S3 naming rules. Co-Authored-By: Claude Opus 4.6 <[email protected]>
v4: Fix InvalidBucketName CI regressionAll 400+ Iceberg integration test failures were caused by a single issue: S3 bucket name Fix (8555ee0): Renamed
All other Pushed, CI should pick up the fix. |
After v3 migrated catalogs to the standard `minio1` service, every
catalog compose file declared `depends_on: minio1: service_started`.
But cluster.py launches each catalog with only its own compose file
as `--file`, so docker compose validates the catalog project in
isolation and rejects it:
service "glue" depends on undefined service "minio1":
invalid compose project
This blew up cluster startup for every Iceberg integration test using
a catalog (REST, HMS, Glue, Nessie, Lakekeeper), producing the 477
v4 failures concentrated in test_database_glue, test_database_iceberg,
test_database_iceberg_*, test_storage_iceberg_no_spark, etc.
The cross-compose `depends_on` is unnecessary anyway. cluster.start()
already starts `minio1` first (line 3932), waits for it via
wait_minio_to_start() (line 3958), creates the catalog buckets (line
3970) and only then launches the catalog services (lines 3974/3979/
3984). Ordering is guaranteed by Python orchestration, not by docker
compose. Catalog-to-MinIO connectivity at runtime works through Docker
networking — `minio1:9001` resolves via the shared docker network
regardless of compose project boundaries (this is the same pattern
Kafka and other integration tests use).
Fix: remove the `minio1` entry from `depends_on` in all 5 catalog
compose files. For lakekeeper, the intra-file deps (`migrate`, `db`)
are preserved — only the cross-project `minio1` reference is dropped.
Closes ClickHouse#102442
v5 (commit b751252): real root cause of the 477 v4 failures@azat — sorry for the long gap. After re-reading the v4 CI logs I realized the bucket rename to What was happeningWhen v3 switched all five catalogs to depends_on:
minio1:
condition: service_startedBut This is the failure signature that hit every Why the cross-project
|
After the v3 migration to standard `with_minio=True` (commit 48a014a), the container `minio` was renamed to `minio1` and the port changed from 9000 to 9001. However `load_catalog_impl` in `test_database_iceberg/test.py` and `test_database_glue/test.py` was not updated and still calls `started_cluster.get_instance_ip('minio')` and uses port `:9000`. Result: every test in those suites fails immediately with `docker.errors.NotFound` when pyiceberg tries to load the catalog, because the `minio` container does not exist (it is named `minio1` now). v5 CI on this branch shows 105 + 98 = 203 failed test runs from this single bug across all sanitizer variants. Replace the stale references with the existing dynamic accessors `started_cluster.minio_ip` and `started_cluster.minio_port`, matching the pattern already used in `test_database_iceberg_lakekeeper_catalog/test.py` and `test_database_iceberg_nessie_catalog/test.py` after the migration. Lakekeeper tests on this branch already pass with this same pattern, confirming the fix is correct. CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=102861 PR: ClickHouse#102861
|
v6 pushed (commit Root cause for the 203 failing tests in v5The v3 migration renamed the MinIO container from
Since the
Total: 231 individual test runs failing, in 14 CI checks. FixReplace stale hardcoded references with "s3.endpoint": f"http://{started_cluster.minio_ip}:{started_cluster.minio_port}",Lakekeeper tests on this branch already pass 7/7 with this exact pattern, confirming the fix is correct (same pyiceberg client, same MinIO, same docker network). Pre-PR validation
Remaining work — Nessie tests (28 failures)The Nessie failures are a different bug: pyiceberg fails inside Lakekeeper passes the same Pyiceberg honors this over the test config, and the The OLD compose used Possible fixes (to investigate next):
Will tackle in v7 once v6 CI confirms the iceberg+glue fix works. |
The Iceberg Nessie integration tests on PR ClickHouse#102861 v6 (`test_database_iceberg_nessie_catalog`) failed with `EndpointConnectionError: Could not connect to the endpoint URL "http://minio1:9001/..."` whenever pytest used pyiceberg to write data (`table.append(df)`). Root cause: the Nessie REST catalog vends an S3 endpoint to clients in the `loadTable` response. That endpoint is configured by Nessie's `nessie.catalog.service.s3.default-options.external-endpoint` in `docker_compose_iceberg_nessie_catalog.yml`, which was hardcoded to `http://minio1:9001/`. The hostname `minio1` is only resolvable inside the Docker network; the pytest process runs on the host network and cannot resolve it, so `s3fs` / `aiobotocore` fails to connect when pyiceberg uploads manifest files. The locally-configured `s3.endpoint` in `RestCatalog(...)` is overridden by Nessie's vended `overrides.s3.endpoint` per the Iceberg REST spec, so a client-side fix is not possible. Fix: vend the standard MinIO container's IP instead of its hostname. The container IP is reachable from both the host (Docker default bridge mode routes container IPs out) and from other Docker containers on the same network, so it works for both pytest and the in-container ClickHouse server. `cluster.py` exports `MINIO_IP` after `wait_minio_to_start` (and re-emits the env file) so the Nessie compose can substitute it via `${MINIO_IP:-minio1}`. The fallback to `minio1` keeps the compose file usable for ad-hoc invocations outside `cluster.py`. Other catalog compose files (`docker_compose_iceberg_rest_catalog.yml`, `docker_compose_iceberg_lakekeeper_catalog.yml`, `docker_compose_iceberg_hms_catalog.yml`, `docker_compose_glue_catalog.yml`) do not vend an external endpoint, so this issue is Nessie-specific. Confirmed by CIDB: only the four Nessie tests fail on v6. CI report: ClickHouse#102861 Issue: ClickHouse#102442
|
v7 — fix Nessie vended S3 endpoint for Root cause of the v6 Nessie failures ( The Nessie REST catalog vends an S3 endpoint to clients via the Iceberg REST The locally-configured Other catalog compose files (REST/Tabulario, HMS, Lakekeeper, Glue) do not vend an external endpoint, which is why only the four Nessie tests failed on v6 — CIDB confirmed: Fix: vend the standard MinIO container's IP instead of its hostname. The container IP is reachable from both the host (Docker default bridge mode routes container IPs) and from other containers on the same Docker bridge network — so it works for both Changes:
Local verification: Awaiting CI to confirm the other three ( Session: |
@azat asked to compress the 8-line explanation in `docker_compose_iceberg_nessie_catalog.yml` to a single sentence noting that `pyiceberg` runs from the host. The replacement keeps the essential context (host network + `MINIO_IP` from `cluster.py`) on one line. Review thread: ClickHouse#102861
|
The failure in private was related |
|
@antonio2368 thanks for the heads-up — happy to follow up if a public-side fix is needed. Public CIDB is clean since merge: queried So whatever broke in private isn't surfacing on the public side yet. To unblock — could you share:
The migration was non-trivial (v7) and the most likely private-only regressions, given what changed, are:
If you point at the failing test + log line I can have a follow-up PR up the same day. Session: |
dolor.py kept MinIO when Spark or an Iceberg REST, Glue or Hive catalog was requested, because those shared services address the S3 server as `minio1:9001`. The SeaweedFS service now has the network alias `minio1`, so they reach SeaweedFS without changes to their compose files, the harness no longer rejects a catalog with s3_server="seaweedfs", and dolor.py always uses SeaweedFS. Two La Casa settings still named the per-catalog MinIO container (`minio`, port 9000) that ClickHouse#102861 removed, which resolves on neither server: the S3 endpoint of the Spark and pyiceberg catalogs in `catalogs/datalakes.py` (`get_instance_ip('minio')` raised `docker.errors.NotFound`), and the BuzzHouse `minio` entry that BuzzHouse uses for catalog storage endpoints, Spark lake paths and the S3Queue `after_processing_move_uri`. Both now use the harness S3 server (`minio_ip`/`minio_host`, `minio_port`). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fixes: #102442
Implements the TODOs in the Iceberg compose files:
Per @azat's direction: switch to the default
minio1service and remove per-catalog MinIO containers.What changed
Compose files (5 files): removed
minio,mc, andspark-icebergservices from:docker_compose_iceberg_rest_catalog.ymldocker_compose_iceberg_hms_catalog.ymldocker_compose_iceberg_nessie_catalog.ymldocker_compose_iceberg_lakekeeper_catalog.ymldocker_compose_glue_catalog.ymlAll catalog services now
depends_on: minio1(the standard MinIO fromwith_minio=True).Endpoint migration (
minio:9000→minio1:9001):CATALOG_S3_ENDPOINT=http://minio1:9001+ addedCATALOG_S3_PATH__STYLE__ACCESS=trueendpoint=http://minio1:9001/,external-endpoint=http://minio1:9001/hms_core_site_minio1.xmlvolume-mounted to override the baked-incore-site.xmlcluster.py:
with_iceberg_catalog,with_hms_catalog,with_glue_catalognow auto-enablewith_minio=Truewarehouse-rest,warehouse-hms,warehouse-glue,iceberg_data) created on standard MinIO during startup via newcreate_minio_buckets()helperICEBERG_MINIO_PORTenv variable (no longer needed without custom MinIO)wait_custom_minio_to_start()calls for catalog setupWhy
Each Iceberg catalog compose file had its own MinIO instance + mc bucket-creation container. This duplicated infrastructure, added 2-3 extra containers per test, and diverged from the standard test MinIO setup. The standard
minio1service is identical (same credentials, same image family) and already available in tests that use S3.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
...
Documentation check (leave one):
Version info
26.5.1.731