seaweedfs/weed/admin/view/app
Chris Lu 2bb21ea276
feat: Add Iceberg REST Catalog server and admin UI (#8175)
* feat: Add Iceberg REST Catalog server

Implement Iceberg REST Catalog API on a separate port (default 8181)
that exposes S3 Tables metadata through the Apache Iceberg REST protocol.

- Add new weed/s3api/iceberg package with REST handlers
- Implement /v1/config endpoint returning catalog configuration
- Implement namespace endpoints (list/create/get/head/delete)
- Implement table endpoints (list/create/load/head/delete/update)
- Add -port.iceberg flag to S3 standalone server (s3.go)
- Add -s3.port.iceberg flag to combined server mode (server.go)
- Add -s3.port.iceberg flag to mini cluster mode (mini.go)
- Support prefix-based routing for multiple catalogs

The Iceberg REST server reuses S3 Tables metadata storage under
/table-buckets and enables DuckDB, Spark, and other Iceberg clients
to connect to SeaweedFS as a catalog.

* feat: Add Iceberg Catalog pages to admin UI

Add admin UI pages to browse Iceberg catalogs, namespaces, and tables.

- Add Iceberg Catalog menu item under Object Store navigation
- Create iceberg_catalog.templ showing catalog overview with REST info
- Create iceberg_namespaces.templ listing namespaces in a catalog
- Create iceberg_tables.templ listing tables in a namespace
- Add handlers and routes in admin_handlers.go
- Add Iceberg data provider methods in s3tables_management.go
- Add Iceberg data types in types.go

The Iceberg Catalog pages provide visibility into the same S3 Tables
data through an Iceberg-centric lens, including REST endpoint examples
for DuckDB and PyIceberg.

* test: Add Iceberg catalog integration tests and reorg s3tables tests

- Reorganize existing s3tables tests to test/s3tables/table-buckets/
- Add new test/s3tables/catalog/ for Iceberg REST catalog tests
- Add TestIcebergConfig to verify /v1/config endpoint
- Add TestIcebergNamespaces to verify namespace listing
- Add TestDuckDBIntegration for DuckDB connectivity (requires Docker)
- Update CI workflow to use new test paths

* fix: Generate proper random UUIDs for Iceberg tables

Address code review feedback:
- Replace placeholder UUID with crypto/rand-based UUID v4 generation
- Add detailed TODO comments for handleUpdateTable stub explaining
  the required atomic metadata swap implementation

* fix: Serve Iceberg on localhost listener when binding to different interface

Address code review feedback: properly serve the localhost listener
when the Iceberg server is bound to a non-localhost interface.

* ci: Add Iceberg catalog integration tests to CI

Add new job to run Iceberg catalog tests in CI, along with:
- Iceberg package build verification
- Iceberg unit tests
- Iceberg go vet checks
- Iceberg format checks

* fix: Address code review feedback for Iceberg implementation

- fix: Replace hardcoded account ID with s3_constants.AccountAdminId in buildTableBucketARN()
- fix: Improve UUID generation error handling with deterministic fallback (timestamp + PID + counter)
- fix: Update handleUpdateTable to return HTTP 501 Not Implemented instead of fake success
- fix: Better error handling in handleNamespaceExists to distinguish 404 from 500 errors
- fix: Use relative URL in template instead of hardcoded localhost:8181
- fix: Add HTTP timeout to test's waitForService function to avoid hangs
- fix: Use dynamic ephemeral ports in integration tests to avoid flaky parallel failures
- fix: Add Iceberg port to final port configuration logging in mini.go

* fix: Address critical issues in Iceberg implementation

- fix: Cache table UUIDs to ensure persistence across LoadTable calls
  The UUID now remains stable for the lifetime of the server session.
  TODO: For production, UUIDs should be persisted in S3 Tables metadata.

- fix: Remove redundant URL-encoded namespace parsing
  mux router already decodes %1F to \x1F before passing to handlers.
  Redundant ReplaceAll call could cause bugs with literal %1F in namespace.

* fix: Improve test robustness and reduce code duplication

- fix: Make DuckDB test more robust by failing on unexpected errors
  Instead of silently logging errors, now explicitly check for expected
  conditions (extension not available) and skip the test appropriately.

- fix: Extract username helper method to reduce duplication
  Created getUsername() helper in AdminHandlers to avoid duplicating
  the username retrieval logic across Iceberg page handlers.

* fix: Add mutex protection to table UUID cache

Protects concurrent access to the tableUUIDs map with sync.RWMutex.
Uses read-lock for fast path when UUID already cached, and write-lock
for generating new UUIDs. Includes double-check pattern to handle race
condition between read-unlock and write-lock.

* style: fix go fmt errors

* feat(iceberg): persist table UUID in S3 Tables metadata

* feat(admin): configure Iceberg port in Admin UI and commands

* refactor: address review comments (flags, tests, handlers)

- command/mini: fix tracking of explicit s3.port.iceberg flag
- command/admin: add explicit -iceberg.port flag
- admin/handlers: reuse getUsername helper
- tests: use 127.0.0.1 for ephemeral ports and os.Stat for file size check

* test: check error from FileStat in verify_gc_empty_test
2026-02-02 23:12:13 -08:00
..
admin_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
admin.templ Improve admin urls (#7370) 2025-10-24 01:38:01 -07:00
cluster_brokers_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
cluster_brokers.templ Admin UI: Add message queue to admin UI (#6958) 2025-07-11 10:19:27 -07:00
cluster_collections_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
cluster_collections.templ adjust layout 2025-12-27 18:37:53 -08:00
cluster_ec_shards_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
cluster_ec_shards.templ migrate IAM policies to multi-file storage (#8114) 2026-01-26 11:28:23 -08:00
cluster_ec_volumes_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
cluster_ec_volumes.templ migrate IAM policies to multi-file storage (#8114) 2026-01-26 11:28:23 -08:00
cluster_filers_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
cluster_filers.templ Admin UI: Add policies (#6968) 2025-07-12 01:13:11 -07:00
cluster_masters_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
cluster_masters.templ Admin UI: Add policies (#6968) 2025-07-12 01:13:11 -07:00
cluster_volume_servers_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
cluster_volume_servers.templ adjust layout 2025-12-27 18:37:53 -08:00
cluster_volumes_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
cluster_volumes.templ adjust layout 2025-12-27 18:37:53 -08:00
collection_details_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
collection_details.templ migrate IAM policies to multi-file storage (#8114) 2026-01-26 11:28:23 -08:00
ec_volume_details_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
ec_volume_details.templ adjust layout 2025-12-27 18:37:53 -08:00
file_browser_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
file_browser.templ Add s3tables shell and admin UI (#8172) 2026-01-30 22:57:05 -08:00
iceberg_catalog_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
iceberg_catalog.templ feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
iceberg_namespaces_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
iceberg_namespaces.templ feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
iceberg_tables_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
iceberg_tables.templ feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
maintenance_config_schema_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
maintenance_config_schema.templ migrate IAM policies to multi-file storage (#8114) 2026-01-26 11:28:23 -08:00
maintenance_config_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
maintenance_config.templ migrate IAM policies to multi-file storage (#8114) 2026-01-26 11:28:23 -08:00
maintenance_queue_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
maintenance_queue.templ Admin: Add Service Account Management UI (#7902) 2025-12-29 22:57:02 -08:00
maintenance_workers_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
maintenance_workers.templ Fix Javascript merge issue and UI worker detail display bug (#8135) 2026-01-27 10:56:28 -08:00
object_store_users_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
object_store_users.templ Add s3tables shell and admin UI (#8172) 2026-01-30 22:57:05 -08:00
policies_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
policies.templ migrate IAM policies to multi-file storage (#8114) 2026-01-26 11:28:23 -08:00
s3_buckets_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
s3_buckets.templ Refine Bucket Size Metrics: Logical and Physical Size (#7943) 2026-01-02 18:28:00 -08:00
s3tables_buckets_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
s3tables_buckets.templ Add s3tables shell and admin UI (#8172) 2026-01-30 22:57:05 -08:00
s3tables_namespaces_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
s3tables_namespaces.templ Add s3tables shell and admin UI (#8172) 2026-01-30 22:57:05 -08:00
s3tables_tables_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
s3tables_tables.templ Add s3tables shell and admin UI (#8172) 2026-01-30 22:57:05 -08:00
service_accounts_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
service_accounts.templ migrate IAM policies to multi-file storage (#8114) 2026-01-26 11:28:23 -08:00
subscribers_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
subscribers.templ Admin UI: Add message queue to admin UI (#6958) 2025-07-11 10:19:27 -07:00
task_config_schema_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
task_config_schema_test.go Admin: misc improvements on admin server and workers. EC now works. (#7055) 2025-07-30 12:38:03 -07:00
task_config_schema.templ migrate IAM policies to multi-file storage (#8114) 2026-01-26 11:28:23 -08:00
task_config_templ_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
task_config_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
task_config_templ.templ migrate IAM policies to multi-file storage (#8114) 2026-01-26 11:28:23 -08:00
task_config.templ migrate IAM policies to multi-file storage (#8114) 2026-01-26 11:28:23 -08:00
task_detail_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
task_detail.templ migrate IAM policies to multi-file storage (#8114) 2026-01-26 11:28:23 -08:00
template_helpers.go weed admin: remove system health status 2025-07-02 23:57:36 -07:00
topic_details_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
topic_details.templ Add Kafka Gateway (#7231) 2025-10-13 18:05:17 -07:00
topics_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
topics.templ upgrade templ version from v0.3.833 to v0.3.906 2025-07-11 13:03:04 -07:00
volume_details_templ.go feat: Add Iceberg REST Catalog server and admin UI (#8175) 2026-02-02 23:12:13 -08:00
volume_details.templ adjust layout 2025-12-27 18:37:53 -08:00