Skip to content

[Docker] Add container environments for ui-new - #2368

Open
newfront wants to merge 8 commits into
unitycatalog:mainfrom
newfront:feat/add-ui-docker-environments
Open

newfront wants to merge 8 commits into
unitycatalog:mainfrom
newfront:feat/add-ui-docker-environments

Conversation

@newfront

@newfront newfront commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests! (Container and Compose configuration only, with no application code; validated by the build and smoke runs below.)
  • If you've added or modified a feature, documentation in docs is updated (ui-new is documented in ui-new/README.md until [UI] Docs: Document using the New UI console. #1953 adds it to docs.)

Description of changes

Closes #1893.

Running ui-new today means starting a Unity Catalog server, the Rust bridge, and Vite by hand. This adds Compose environments so the console runs with one command, either as a full local stack or against an existing Unity Catalog server.

  • ui-new/docker-compose.yaml: full local stack.
    • Unity Catalog: built from this checkout's root Dockerfile, so the UI runs against the server code beside it.
    • Storage and metadata: PostgreSQL holds the metadata and RustFS provides S3-compatible object storage.
    • Configuration: a one-shot config-init creates the bucket, then copies the .properties files of the repository's etc/conf into a volume, with local PostgreSQL and storage settings in place of theirs, so each key has one value. There's no second config tree under ui-new.
      • Ownership: it gives the volume to the server's uid and gid, 100:101, as the Helm chart does for etc/conf.
      • Safe rewrites: each file is written beside its final name and renamed into place, so a server that docker compose restart starts alongside it never reads a half-written file. Leftover temporary files from an interrupted run are deleted first, and only the files the run wrote are renamed into place.
      • Defaults: the server keeps its default managed-table settings, so nothing here changes how the UC REST, Delta and Iceberg REST paths behave.
      • Table storage root: it sets the deprecated storage-root.tables to the bucket. That is the fallback managed tables created through Iceberg REST and Spark (staging tables) use in a catalog without a storage root, so dropping it would break those creates. Volumes and models have no such fallback, so the README says to give their catalog a storage root.
      • Database password: it isn't written into hibernate.properties. It's passed as UC_HIBERNATE_CONNECTION_PASSWORD, as the chart passes it, and set with POSTGRES_PASSWORD (default uc_default_password), which PostgreSQL uses when it creates its volume.
    • Schema: since [Server] Let only the schema steps change the schema #2117 the server no longer sets up a new database's schema. A one-shot upgrade-schema service runs bin/start-uc-server --upgrade-schema before the server starts, as the Helm chart's init container does. Like the chart's, it gets the database password in its environment but not the credential encryption key, which the schema upgrade doesn't read; the key file does sit in the configuration volume it mounts.
    • Object storage: once the server is up, a one-shot storage-init runs bin/uc to register RustFS's keys as an s3_compatible_access_key storage credential, and s3://uc-warehouse as an external location on RustFS's endpoint, http://rustfs:9000, as [Server][CLI] Finalize S3-compatible storage: endpoint and path style on the external location #2289 has it. The location uses path-style requests, since a virtual-hosted address such as uc-warehouse.rustfs doesn't resolve on the Compose network.
      • Effect: the server reaches the bucket at RustFS. Vended credentials are short-lived sessions scoped to the requested path, and their location settings name http://rustfs:9000 with path-style access.
      • Restarts: storage-init waits for the server, then updates an existing credential and location to the current settings. That re-encrypts the credential with the current key and picks up changed RustFS keys.
      • Waits: config-init waits for RustFS and storage-init for the server, for about two minutes each. A wait that times out prints its last attempt's error, so wrong RustFS keys or a CLI that can't start show up as themselves rather than as a slow start.
      • Fixed bucket: the bucket name isn't a setting. Once anything uses the external location, the server refuses to move it to a URL that doesn't cover the old one, so a changed bucket would stop storage-init, and with it the UI.
      • Lookups and writes: it creates the credential or location only when the server answers NOT_FOUND. Any other lookup failure stops it with the CLI's error, rather than trying a create that would fail with a misleading "already exists". Each lookup and write must also return JSON naming the entity, because the CLI exits 0 when it rejects its arguments; otherwise storage-init fails and the bridge doesn't start.
      • Host engines: the endpoint name resolves inside the Compose network. The README shows the /etc/hosts line for an engine on the host, which works while RustFS keeps its default port, 9000.
    • Credential encryption key: the server encrypts the credential's secret with UC_SERVER_CREDENTIAL_ENCRYPTION_KEY, the variable the Helm chart sets from server.credentialEncryptionKeySecret. Export it to use your own key. Left empty, the server uses a key that config-init generates once into the configuration volume, so no key is committed and docker compose down --volumes resets the key and the credential together. The key is written with mode 600 beside its final name and renamed into place, so an interrupted run can't leave a partial key behind. If the key file is missing, the server's launcher says so and points to config-init.
    • Authorization: Unity Catalog runs with authorization off, since the stack sets up no identity provider, and the bridge's UI_AUTH_ENABLED defaults to off to match. The README points to the remote file for trying sign-in.
    • UI: the bridge and the SPA, served by Nginx.
    • Image reuse: upgrade-schema and storage-init reuse the server image. All three services that use it share one definition of it with pull_policy: never, so docker compose up builds the image when it's missing, without first trying to pull it, and doesn't rebuild it otherwise.
    • Restarts and shutdown:
      • Restart policy: the long-running services (Unity Catalog, RustFS, PostgreSQL, the bridge and web) have restart: unless-stopped. They come back after a Docker daemon restart, and the server comes back by itself if it starts before PostgreSQL is ready, as it can under docker compose restart.
      • Server shutdown: the server gets stop_grace_period: 20s, above the 15 seconds docs/server/configuration.md asks for with default settings.
      • Bridge shutdown: the bridge shuts down gracefully on SIGINT, so its image sets STOPSIGNAL SIGINT. Its stop_grace_period: 35s lets an in-flight RPC reach the bridge's 30-second Unity Catalog timeout.
      • Web shutdown: Nginx finishes in-flight requests on its image's stop signal, SIGQUIT. The web service gets the same stop_grace_period: 35s, so an RPC it is proxying also gets to the bridge's timeout.
      • PostgreSQL health: the healthcheck probes TCP (pg_isready -h 127.0.0.1), the way the server connects. On a new volume the image first runs a setup server that listens only on the Unix socket, which a socket probe would report as ready.
  • ui-new/docker-compose-remote.yaml: bridge and web only. It runs against the Unity Catalog server named by UC_SERVER, with auth on by default.
  • Ports. Both files publish on 127.0.0.1 unless BIND_ADDRESS is set. In the default file, Unity Catalog's authorization is off, and PostgreSQL and RustFS use default credentials unless POSTGRES_PASSWORD, RUSTFS_ACCESS_KEY and RUSTFS_SECRET_KEY are set.
  • Images.
    • Bridge: ui-new/server/Dockerfile runs as a non-root user on debian:bookworm-slim and has a /healthz health check. The binary is owned by root, so that user can run it but not replace it, and the image stops it with SIGINT.
    • Web: ui-new/web/Dockerfile serves the SPA from unprivileged Nginx 1.30, the current stable branch. The build ignores web/*.local, so a checkout's local Vite settings, such as VITE_API_BASE in web/.env.local, never reach the image.
    • Code generation: both images generate their protobuf code from ui-new/proto during the build, so a fresh checkout builds without running buf first (web/src/gen is gitignored). The web image uses the buf that bun.lock pins (1.72.0), and the bridge image uses the same version.
    • Pinned images: every image, including the Dockerfile syntax image, is pinned to a tag and its multi-arch digest, as the root Dockerfile and the Helm chart are. RustFS is 1.0.4, the digest the server's RustFS tests use.
  • Nginx (ui-new/web/nginx.conf).
    • Proxying: it proxies /uc.v1.*, /config, and /healthz to the bridge. It looks the bridge up through Docker's DNS, at most 10 seconds apart, so a recreated bridge container is found at its new address. The read timeout is 35 s, just above the bridge's 30 s upstream limit.
    • Routing and caching: it serves index.html for client-side routes, and caches hashed /assets/ as immutable.
    • Body limit: it allows 4 MiB request bodies, which is Connect's default limit.
  • Private registries. These are set through environment variables only, so nothing is committed or baked into the images: NPM_REGISTRY_URL, CARGO_REGISTRY_URL, MAVEN_PROXY_URL (forwarded to the root Dockerfile), or an optional CARGO_CONFIG_FILE BuildKit secret. The secret is mounted where Cargo reads it, so it never lands in a layer, and CARGO_REGISTRY_URL becomes cargo --config flags.
  • ui-new/web/bun.lock fix. Since [UI] Scaffold /ui-new for the new console experience #1902 the lockfile has pinned 447 packages to an internal npm proxy (npm-proxy.cloud.databricks.com). That breaks bun install --frozen-lockfile anywhere the proxy isn't reachable, including inside these images.
    • The strip: this PR strips those URLs with the existing clean-bun-lock script. Only the resolution field changes; versions and integrity hashes don't.
    • Keeping them out:
      • The lint workflow runs clean-bun-lock.ts --check on ui-new/web, as it does for ui/.
      • The script runs as the web package's postinstall. Bun saves the lockfile before it runs the root postinstall, so bun install, bun add and bun update leave no URLs to stage, with no per-clone hook to install. The web image copies the script in before its install.
    • Script: the --check message now names the right script, and the header says the script runs as the postinstall.
  • CI for the container files. A new ui-new-containers job in the lint workflow, "Check ui-new container files", runs:
    • shellcheck on the container scripts and their tests

    • each script's test in the image the script runs in: config-init-test.sh in the AWS CLI image the Compose file names (Amazon Linux, where sh is bash), and the others in the Alpine base of the server image, read from the root Dockerfile (busybox sh)

    • config-init-test.sh, which runs config-init.sh against stand-ins for the AWS CLI, chown and sleep and temporary directories. It checks:

      • each overridden key having one value, the override's, including keys the template sets; a key that only starts with an overridden one is kept
      • that no temporary file is left or put in place
      • that the key is generated, kept, and regenerated when empty
      • through a stand-in chown, that the volume goes to 100:101
      • that it stops when RustFS keeps refusing its keys, printing the last error once

      config-init.sh takes CONF_DIR and TEMPLATES_DIR for this, with the Compose paths as defaults.

    • start-server-test.sh, which checks that the key variable wins over the key file, that the file is used when the variable is empty, and that a missing or empty key file stops the launcher

    • storage-init-test.sh, which runs storage-init.sh against a stand-in bin/uc for each answer the CLI can give. It checks the writes, their arguments and the exit status, including:

      • every credential argument (the endpoint, both keys and the role) on create, with the default keys, and on update, with set ones, plus the location's arguments
      • a first start that stopped after the credential, which updates the credential and creates the location
      • a failed or help-printing update, a failed write, and a location failing after the credential
      • a server that never answers, whose error the timeout prints

      The stand-in takes only the options the CLI lists for each command, read from the CLI's option table in CliUtils.java and CliParams.java. For any other option, or a missing required one, it prints help and exits 0, as the CLI does; it also refuses an option without its leading --, which the CLI would ignore. A check simulates the CLI no longer taking the location's --endpoint, and a renamed command, or a table the test can't read, fails the test with a message naming the CLI file. A comment above CliUtils.cliOptions says the test reads it.

    • docker compose config on both Compose files

  • Docs. ui-new/README.md and ui-new/AGENTS.md now cover:
    • the prerequisites: Docker Compose v2 with BuildKit, and access to buf.build for the protovalidate module even when registry mirrors are set
    • both Compose files, the ports each one publishes, BIND_ADDRESS and the registry variables
    • restarting in order with down and up, and what docker compose restart does instead
    • the storage setup and its variables (RUSTFS_ACCESS_KEY, RUSTFS_SECRET_KEY, POSTGRES_PASSWORD), the fixed bucket, the encryption key, and reaching RustFS from the host
    • building the server image before running upgrade-schema or storage-init on their own
    • that the two files share one Compose project, so a stack is stopped with the file that started it
    • that the credential and location names rustfs and rustfs_warehouse belong to the stack, and that the uc_conf and uc_postgres_data volumes are kept or removed together
    • that the bridge waits for storage-init, and where to look when it fails
    • that the remote file's UC_SERVER can't be a host localhost URL, and that with auth on and no provider set, the sign-in page offers only pasting a token
    • that UI_AUTH_ENABLED gates only the UI, not Unity Catalog's own port, and that the RustFS secret key shows in the process list while storage-init runs
    • that managed volumes and models need a storage root on their catalog or schema, because storage-root.tables is a fallback for tables only

Testing

All runs used clean volumes under separate Compose projects. The web and bridge code haven't changed across this branch's revisions.

On this commit:

  • Script tests: all three pass under macOS sh, Debian's dash and busybox: 19 checks for config-init, 4 for start-server and 10 for storage-init.
  • Broken copies of config-init.sh: the test fails against each one:
    • no table storage root
    • authorization left on
    • no PostgreSQL driver
    • the volume given to another owner
    • stale temporary files kept
  • Local Vite settings: with a web/.env.local setting VITE_API_BASE, a plain bun run build bakes that address into the bundle, and so does the image build without the new ignore line. With it, the address is absent from the image.
  • Real run: on a fresh project, config-init, upgrade-schema and storage-init exited 0.
    • Volume: it was owned by 100:101, each overridden key had one value, there were no temporary files, and the key was mode 600.
    • Storage: vending for a managed volume named http://rustfs:9000, path-style.
  • CI step: the lint step's commands pass.

On earlier revisions of this branch:

  • Broken copies: each test fails against a copy of its script with one guarantee broken:
    • config-init regenerating the key on every run
    • config-init renaming every leftover temporary file
    • config-init leaving the key world-readable
    • start-server preferring the key file over the variable
    • storage-init with its JSON name check disabled
  • No pulls: with the server image missing, dry runs of both docker compose up and up --build build it without trying to pull it. With every image present, plain up neither pulls nor builds.
  • Fresh stack: I started it with a non-default POSTGRES_PASSWORD. Every service became healthy, and config-init, upgrade-schema and storage-init exited 0.
    • Password: PostgreSQL refused the default password and accepted the new one, and the server ran on it.
    • Bucket setting gone: setting UC_STORAGE_BUCKET no longer changes the rendered Compose configuration.
  • Storage, on main with [Server][CLI] Finalize S3-compatible storage: endpoint and path style on the external location #2289: I rebuilt the server image from the branch merged with main and started a fresh stack.
    • Registered objects: the credential was an s3_compatible_access_key with the role, and the location had endpoint http://rustfs:9000 and path_style_access true.
    • Vend: through Unity Catalog's REST API I created a catalog with storage root s3://uc-warehouse/demo, a schema and a managed volume, then vended WRITE_VOLUME credentials. They carried a session token, and their external_location_settings named http://rustfs:9000, us-east-1 and path-style access.
    • Scope: inside the Compose network, path-style, a PUT into the volume's path succeeded and read back, and a PUT elsewhere in the bucket got AccessDenied.
    • UI: the UI, a deep link, /config and ListCatalogs answered, with the new catalog listed.
  • Restart with the location in use: with that catalog's storage root under the external location, a storage-init re-run updated the credential and the location, exited 0, and vending still worked.
  • PostgreSQL probe: I started a PostgreSQL that listens only on its socket, as the image's first-start setup server does. The old probe reported "accepting connections", and the new TCP probe "no response".
  • Bridge shutdown:
    • A plain stop: docker compose stop bridge ended it with exit code 0 and its "shutting down" log line; the image without STOPSIGNAL exits 143 with no log line.
    • During an RPC: I pointed the remote file's bridge at a server that accepts connections and never answers, then stopped the bridge three seconds into an RPC. It waited: the client got the bridge's own deadline_exceeded at the 30-second timeout rather than a dropped connection, and the bridge then exited 0.
  • Fresh-clone build: all three images built from a worktree with no generated code.
    • No pulls: a --dry-run up --build with the server image absent builds it once and pulls nothing.
    • Bridge: the binary is owned by root with mode 755. A build through a CARGO_CONFIG_FILE secret worked, and a deliberately broken secret failed the build with Cargo naming /usr/local/cargo/config.toml, which shows the mounted file is what Cargo reads.
    • Web: the image runs Nginx 1.30.6.
  • Ownership and key: I ran the setup service (then named rustfs-init) on its own before anything else. The volume and every file in it ended up 100:101. The generated key was mode 600 and decoded to exactly 32 bytes, and no temporary file was left. The server then started and wrote its signing keys.
  • Config:
    • Overrides: the generated server.properties differs from the template only in server.authorization=disable and the table storage root. server.authorization-url is kept.
    • Password: it isn't in hibernate.properties, and neither upgrade-schema nor the server logged the deprecation warning about it.
  • Bridge and Nginx: /config and /healthz responded, a deep link served the SPA, and hashed assets came back with one header, Cache-Control: public, max-age=31536000, immutable.
  • Web shutdown: with the bridge pointed at a server that accepts connections and never answers, I stopped web mid-RPC. With the old 10-second default, the RPC was cut at 13 s and the container was killed (exit 137). With 35 s, the RPC finished with the bridge's timeout response at 30 s, and the container exited 0.
  • Container checks: I ran the new job's steps, taken from the workflow file, in the real images: 42 checks passed. Five changes to the scripts each failed a test: dropping either wait's output, swapping the keys, dropping the role, and registering the location only after creating the credential. Three simulated changes to the CLI's source each failed with a message naming the file.
  • storage-init re-run: a second run logged updating credential rustfs and updating external_location rustfs_warehouse, and exited 0.
  • Managed tables without a catalog storage root: in a catalog created with none, a staging table, the path the Spark connector uses, got s3://uc-warehouse/__unitystorage/tables/<id>. An Iceberg REST create also succeeded, and the server wrote its metadata file into RustFS.
  • Server shutdown: the server container's stop timeout is 20 seconds, and docker compose stop ended it with exit code 143 (SIGTERM), not 137.
  • Self-recovery: I stopped PostgreSQL and started the server. Docker restarted it while the database was down, and once PostgreSQL was back the server became healthy by itself, with its catalogs intact.
  • Missing key: with no key file and no variable set, the launcher printed that the key is missing and which service writes it, then exited 1.
  • Encryption key: on the same stack, I restarted the server with a different UC_SERVER_CREDENTIAL_ENCRYPTION_KEY exported. storage-init ran again after it, re-encrypted the credential with the new key, and vending still worked.
  • Full restart: I ran docker compose restart, which restarts every service at once, three times. Each time, the setup service and storage-init exited 0, the server kept serving the PostgreSQL catalog, and both config files kept their overrides.
  • Bridge recreate: I recreated only the bridge at a new IP address. The running web container kept answering /config and RPCs with 200.
  • Remote stack: against a remote Unity Catalog server with auth enabled:
    • /config reported auth on, and a signed-out ListCatalogs returned unauthenticated.
    • A deep link loaded, the web port was bound to 127.0.0.1, and both containers had restart: unless-stopped.
  • Pinned images: a build and a fresh up on a separate project resolved every image by its digest. All services came up healthy, and the UI, a deep link, /config and ListCatalogs answered 200.
  • Lockfile checks: on main's lockfile, clean-bun-lock.ts --check fails, and stripping the 447 URLs gives exactly this PR's lockfile. With the postinstall:
    • a bun install through the proxy left the lockfile unchanged
    • a bun add that wrote 448 proxy URLs left none
    • after bun remove, the lockfile matched this PR's bytes
    • the web image's install ran it and found the lockfile clean
  • ui-new checks: the web and bridge checks pass:
    • bun run typecheck
    • bun run test:coverage (193 tests, 95.4% lines)
    • bun run build
    • bun run test:format
    • cargo test (57 tests)
    • cargo fmt --check

Compatibility

No API, protobuf, or application code changes. The rest is:

  • new container files under ui-new/
  • ui-new docs
  • the lockfile's resolution fields
  • a one-line message fix and a header note in clean-bun-lock.ts
  • a postinstall script in ui-new/web/package.json, a lint workflow step, and a new lint workflow job
  • a two-line comment in examples/cli's CliUtils.java

The local stack's server settings go only into its own generated configuration; etc/conf is unchanged.

Follow-ups

Stack

This is the base of the remaining ui-new stack. Next is the optional client-side request validation branch (chore/add-ui-web-validation-tests), which builds on these Compose files.

This pull request and its description were written by Isaac.

@newfront

Copy link
Copy Markdown
Collaborator Author

/review

@newfront
newfront force-pushed the feat/add-ui-docker-environments branch from 1c38fe9 to d953617 Compare November 25, 2026 18:01
@newfront

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. All eight findings are addressed in d9536173. The PR is still one commit, and I reproduced both blockers before fixing them.

Blocker 1: root-owned configuration volume. Confirmed. With rustfs-init run on its own first, the server died with AccessDeniedException: etc/conf/public_key.der. The earlier smoke runs passed only because of the order Compose creates containers in. bootstrap.sh now ends with chown -R 100:101 /conf, the ids the Helm chart gives etc/conf. Rerunning the same sequence leaves everything 100:101, and the server starts and writes its keys.

Blocker 2: storage traffic going to AWS. Confirmed: credentials vended for an s3://uc-warehouse volume had s3_endpoint=None. I took your suggested route.

  • Configuration: rustfs-init no longer mints STS keys or writes the legacy s3.*.0 lines. It sets server.s3-compatible-storage.enabled=true.
  • Registration: a new one-shot storage-init runs bin/uc from the server image once the server is healthy. It creates an s3_compatible credential with s3_endpoint=http://rustfs:9000 and AssumeRole, plus an external location for the bucket. On later starts it updates both to the current settings. The bridge waits for it.
  • Encryption key: it comes from UC_SERVER_CREDENTIAL_ENCRYPTION_KEY, the variable the chart sets from server.credentialEncryptionKeySecret. Left empty, the server uses a key that rustfs-init generates once into the configuration volume, so nothing secret is committed.
  • Verified storage operations: vended credentials now carry s3_endpoint=http://rustfs:9000, a region and a session token. A PUT into the volume's path succeeded and read back, and a PUT elsewhere in the bucket got AccessDenied.
  • Restart: after a restart, vending still works. Because the update re-encrypts the credential, switching to a different key also keeps working.

Nit 1: ports on all interfaces. Every published port in both files now binds to ${BIND_ADDRESS:-127.0.0.1}, and wider exposure means setting BIND_ADDRESS.

Nit 2: 12-hour STS expiry. Gone with Blocker 2's fix. Each vend is a fresh one-hour session, and nothing static is written into server.properties.

Nit 3: Cargo secret in a build layer. The secret is now mounted at /usr/local/cargo/config.toml, and CARGO_REGISTRY_URL becomes cargo --config flags. A deliberately broken secret fails the build with Cargo naming that path, so the mounted file is what Cargo reads.

Nit 4: Nginx resolves the bridge once. It now uses resolver 127.0.0.11 with a variable upstream. After recreating only the bridge at a new IP, the running web container kept answering with 200.

Nit 5: buf versions and unpinned images.

  • buf: the web image dropped its copied buf and uses the lockfile's 1.72.0. The bridge image moved to bufbuild/buf:1.72.0.
  • Images: RustFS is pinned to the digest the server's RustFS tests use (RustFS 1.0.4), and the AWS CLI to 2.38.0.

Nit 6: no CI check for the lockfile. Added "Check ui-new bun lock" to lint-check.yml, next to the ui/ step. It passes on this branch and fails on main's lockfile.

Also changed after a further review of my own:

  • Authorization: the unused UC_AUTH setting is gone. storage-init had no token, so setting it stopped the stack; Unity Catalog now always runs with authorization off.
  • Managed tables: server.managed-table.use-delta-api-only=true is gone, so the stack keeps the server's default managed-table behavior, alongside Iceberg REST.
  • Safe rewrites: rustfs-init writes each config file beside its final name and renames it into place, so docker compose restart can't start the server on a half-written file. storage-init also waits for the server.
  • Database password: it moved from hibernate.properties to UC_HIBERNATE_CONNECTION_PASSWORD, as the chart passes it.
  • README: the corrections cover:
    • the /etc/hosts note, which works only on RustFS's default port
    • the storage variables
    • the CARGO_REGISTRY_URL format
    • the remote example, which no longer exports variables into later local runs

On the summary's note that the Testing section is empty: the description has one. It's now updated with these runs.

@newfront

Copy link
Copy Markdown
Collaborator Author

/review

@newfront
newfront force-pushed the feat/add-ui-docker-environments branch from d953617 to 35517e1 Compare November 25, 2026 18:27
@newfront

Copy link
Copy Markdown
Collaborator Author

Thanks for the second pass. All three blockers and the nits are addressed in 35517e16, still one commit. Each fix was tested on a fresh stack; the PR description's Testing section has the details.

Blocker 1: partial encryption key. rustfs-init now writes the key under umask 077 beside its final name and renames it into place, as it already did for the properties files. Run on its own, rustfs-init left a mode-600 key that decodes to exactly 32 bytes, and no temporary file.

Blocker 2: any lookup failure treated as missing. storage-init now keeps the get output and creates only when it contains "error_code":"NOT_FOUND", which is what the CLI prints for a 404. Any other failure logs the CLI's error, with stack frames stripped, and exits 1 before anything is written. I ran the script against a stand-in bin/uc:

  • existing entities were updated
  • NOT_FOUND created both
  • a 503 stopped it with the error and no writes

The create and update calls only send their stdout to /dev/null, so their errors already reach the log.

Blocker 3: stop grace period. Added stop_grace_period: 20s to unitycatalog, above the 15 seconds the configuration docs ask for. docker compose stop now ends the server with exit code 143 (SIGTERM), not 137.

Nit 1: storage-root.tables. Kept, and the README now calls it a deprecated fallback. Iceberg REST and staging-table creates, the path the Spark connector uses, fall back to it in a catalog without a storage root (StagingTableRepository), so dropping it would break those. With it, both creates worked in a catalog created without a storage root, and the server wrote the Iceberg metadata into RustFS. The property logs no deprecation warning.

Nit 2: README.

  • Wrapping: the long sentence is re-wrapped, and so is the long remote example command.
  • Ports: the paragraph now lists the ports per file; the remote file publishes only UI_PORT.
  • Prerequisites: a new opening paragraph names Docker Compose v2 with BuildKit.

Nit 3: missing key file. start-server.sh now says that the key file is missing and that rustfs-init writes it, then exits 1. upgrade-schema runs bin/start-uc-server --upgrade-schema directly again, without the key, since the schema upgrade doesn't read it and the Helm chart's init container doesn't get it either.

Nit 4: docker compose restart and PostgreSQL readiness. The long-running services now have restart: unless-stopped, see the next item. With PostgreSQL stopped, Docker restarted the server until the database was back, and then it became healthy by itself. The README now says to restart in order with down and up, and describes what restart does instead.

Nit 5:

  • Restart policy: Unity Catalog, RustFS, the bridge and web now have restart: unless-stopped, like PostgreSQL. The one-shot services don't.
  • Nginx: moved to 1.30-alpine, the current stable branch (1.30.6).
  • Bridge binary: it's copied without --chown, so it's owned by root with mode 755.
  • Shared Compose definitions: not changed. Sharing them across the two files would need extends or include, and the bridge differs between them: UC_SERVER is required, auth defaults on, and there's no storage-init dependency. Only web is identical, so I kept each file standalone and readable on its own.

@newfront

Copy link
Copy Markdown
Collaborator Author

/review

@newfront
newfront force-pushed the feat/add-ui-docker-environments branch from 35517e1 to 5c0f260 Compare November 25, 2026 20:57
@newfront

Copy link
Copy Markdown
Collaborator Author

Thanks. All three blockers are fixed in 5c0f2604, still one commit, along with nits 1, 2, 3 and 5. Nit 4 is partly covered by a new lint step, details below. Each fix was checked on a fresh stack; the PR description's Testing section has the runs.

Blocker 1: socket-only pg_isready. The healthcheck is now pg_isready -h 127.0.0.1 .... I started a PostgreSQL that listens only on its socket, as the image's setup server does. The old probe reported "accepting connections" and the new one "no response". A fresh stack came up healthy with it.

Blocker 2: the CLI exits 0 on rejected arguments. Confirmed: UnityCatalogCli.main prints help and returns, so a mistyped flag exits 0. storage-init now runs every call with --output json and requires the output to name the entity, matching "name":"<entity>" exactly so the location's "credential_name":"rustfs" can't count for the credential.

  • Lookups: a successful lookup without that field fails instead of meaning "exists".
  • Writes: a create or update that doesn't return it fails the script, so the bridge doesn't start.

Against a stand-in bin/uc:

  • existing entities were updated and NOT_FOUND ones created
  • a 503 lookup stopped with no writes
  • a lookup or a write that printed help and exited 0 stopped the script with exit 1

Blocker 3: the bridge ignores SIGTERM. The bridge image now sets STOPSIGNAL SIGINT, the signal main.rs shuts down gracefully on, and the bridge gets stop_grace_period: 35s in both files. I kept this in the Dockerfile rather than changing main.rs, since this PR has no application code; handling SIGTERM in the bridge itself would be a small follow-up for deployments outside these images.

  • A plain stop: docker compose stop bridge now exits 0 and logs "shutting down", where before it was killed with 143.
  • During an RPC: with the bridge pointed at a server that never answers, I stopped it three seconds into an RPC. It waited, the client got the bridge's own deadline_exceeded at 30 seconds rather than a dropped connection, and the bridge exited 0.

Nit 1: the key is in upgrade-schema's volume. Right, the description now says the key isn't passed in its environment and that the file is in the configuration volume it mounts. I kept one volume, since upgrade-schema needs the same server.properties and hibernate.properties.

Nit 2: AGENTS.md remote command. The bullet now gives cd ui-new && UC_SERVER=<url> docker compose -f docker-compose-remote.yaml up --build, and the full-stack command also starts with cd ui-new.

Nit 3: README accuracy.

  • BuildKit: the README now says which features need it: the bridge Dockerfile's secret and cache mounts, and the repository Dockerfile's COPY --parents and heredocs.
  • buf.build: it says both image builds need to reach buf.build for the protovalidate module, even with mirrors set.
  • Remote UC_SERVER: it says localhost there is the bridge container itself, and suggests http://host.docker.internal:8080 on Docker Desktop.

Nit 4: no CI for the container files. The lint workflow now runs shellcheck on the three scripts and docker compose config --quiet on both Compose files. Building the images and smoke-running the stack in CI would take a few minutes of JVM and Rust builds per run, so I'd leave that as a follow-up.

Nit 5: orphans and the storage-init gate. Both are intended, and the README now says so.

  • Orphans: stop a stack with the file that started it. -f docker-compose-remote.yaml down leaves the full stack's Unity Catalog, PostgreSQL and RustFS running.
  • The gate: the bridge starts only after storage-init succeeds, so a storage setup failure keeps the UI down, and docker compose logs storage-init shows the cause.

@newfront

Copy link
Copy Markdown
Collaborator Author

/review

@newfront
newfront force-pushed the feat/add-ui-docker-environments branch from 5c0f260 to 1faa28f Compare November 25, 2026 22:46
@newfront

Copy link
Copy Markdown
Collaborator Author

Thanks. The blocker and nits 2 to 5 are addressed in 1faa28ff, still one commit. I've left nit 1 alone, for the reason below. The PR description's Testing section has the runs.

Blocker 1: changing the bucket leaves the UI down. Confirmed in ExternalLocationRepository.updateExternalLocation: without force, a URL that no longer covers the old one is refused while the location is in use. Rather than document that trap, I removed the UC_STORAGE_BUCKET setting, so the bucket is always uc-warehouse. A comment in config-init.sh explains why it's fixed, and the README and description now say that storage-init picks up changed RustFS keys, not a changed bucket. With a catalog's storage root under the location, down and up ran the update path and vending still worked. I didn't add --force, as you suggested.

Nit 1: probe /readyz. Left as is. /readyz isn't served on port 8080: it's on the separate observability port, which is off unless the server starts with --obs-port. Also, the server checks the schema in its constructor, which needs a database connection, before start() opens port 8080 (UnityCatalogServer). So an open port already means the database was reachable and the schema current. Compose doesn't act on a later unhealthy status, so turning on the observability listener would add a port and a background probe without changing the start order.

Nit 2: the PostgreSQL password is a literal. It's now ${POSTGRES_PASSWORD:-uc_default_password} on postgres, upgrade-schema and unitycatalog. The README says to set it before the first start, since PostgreSQL keeps the password its volume was created with. With a non-default value, PostgreSQL refused the default password, accepted the new one, and the server ran on it.

Nit 3: the port-publishing reason. The paragraph now says both files publish on 127.0.0.1, and that in the default file authorization is off and PostgreSQL and RustFS use default credentials unless POSTGRES_PASSWORD, RUSTFS_ACCESS_KEY and RUSTFS_SECRET_KEY are set.

Nit 4: no automated check of storage-init. Added ui-new/docker/unitycatalog/storage-init-test.sh, and the lint step runs it. It runs storage-init.sh against a stand-in bin/uc and checks the writes and exit status for each case:

  • existing entities
  • NOT_FOUND
  • a 503 lookup
  • a lookup that prints help and exits 0
  • a write that prints help and exits 0

It passes under dash, busybox and macOS sh. With the JSON name check disabled in a copy of the script, the two help cases fail. I'd still keep a full docker compose up --build smoke workflow as a follow-up: building the server, bridge and web images is several minutes of sbt and Rust per run, and adding a heavy workflow is the maintainers' call.

Nit 5: rustfs-init does more than RustFS. Renamed it to config-init and moved its script to docker/unitycatalog/config-init.sh, next to start-server.sh and storage-init.sh. The script now opens with a comment listing what it prepares: the bucket, the configuration volume, the fallback key and the ownership. I kept bucket creation and config rendering in one service: splitting them would add another one-shot without changing what runs before the server.

@newfront

Copy link
Copy Markdown
Collaborator Author

/review

@newfront
newfront force-pushed the feat/add-ui-docker-environments branch from 1faa28f to 8e7afd5 Compare November 25, 2026 23:50
@newfront

Copy link
Copy Markdown
Collaborator Author

Thanks. Nits 1, 2, 3, 4, 6 and 7 are addressed in 8e7afd5e, still one commit. I've left 5 as it is, for the reason below. The PR description's Testing section has the runs.

Nit 1: no tests for config-init.sh and start-server.sh. Both now have tests, and the lint step runs all three script tests. Each one fails against a copy of its script with one of the guarantees broken.

  • config-init-test.sh: it runs the script three times against a stand-in aws and temporary directories. It checks that:

    • the template settings are kept and the overrides appear once, including on the second run
    • no temporary files are left
    • the key is 32 bytes, mode 600, kept on the second run, and regenerated when empty
    • a stale temporary file isn't put in place

    For this, config-init.sh reads CONF_DIR, TEMPLATES_DIR and CONF_OWNER, with the Compose paths and 100:101 as defaults.

  • start-server-test.sh: it checks that the variable wins over the key file, that the file is used when the variable is empty, and that a missing or empty key file stops the launcher with exit 1.

Nit 2: storage-init-test.sh gaps. It now has the three cases you listed:

  • an update that prints help after a successful lookup
  • a write that exits non-zero
  • the location failing after the credential succeeds

The stand-in now records each write's full arguments, and the test checks the credential's --s3_endpoint http://rustfs:9000 and the location's --url s3://uc-warehouse --credential_name rustfs. All three tests pass under dash, busybox and macOS sh.

Nit 3: stale .tmp files. config-init now renames by looping over the templates again, so only the files this run wrote are put in place. The test seeds a stale .removed.properties.tmp and checks it isn't renamed.

Nit 4: auth on with no provider. The README now says to set GOOGLE_CLIENT_ID, OKTA_AUTH_ENABLED or KEYCLOAK_AUTH_ENABLED for the remote file. With none set, the sign-in page shows "No auth providers are enabled" and offers only pasting a Unity Catalog access token, which works.

Nit 5: duplicated definitions and the shared project name. Unchanged, as in earlier rounds. The README describes how the two files interact.

Nit 6: README security notes. It now says that UI_AUTH_ENABLED gates only the UI and leaves Unity Catalog's own port open without authorization, and that the RustFS secret key shows in the process list while storage-init runs.

Nit 7: pull_policy on unitycatalog. Added, as pull_policy: never rather than build. Checking this showed the default policy does try to pull first: with the image missing, a plain docker compose up printed a failed pull of unitycatalog-ui-new-local-uc before building it. I compared both policies with dry runs:

  • never: with the image missing, plain up builds it without trying to pull. With it present, up neither pulls nor builds.
  • build: it would also rebuild on every up, from a build context that is the whole repository.

up --build still rebuilds the image when you want a new one.

@newfront

Copy link
Copy Markdown
Collaborator Author

/review

Add Compose files that run ui-new in containers:

- docker-compose.yaml builds this checkout's Unity Catalog server and runs
  it with PostgreSQL, RustFS object storage, the Rust bridge, and the SPA
  behind Nginx. config-init creates the bucket, copies the .properties
  files of the repository's etc/conf into a volume with local PostgreSQL
  and storage settings, and gives the volume to the server's uid 100:101,
  as the Helm chart does.
  The server runs with authorization off and its default managed-table
  settings, and gets the database password, POSTGRES_PASSWORD or a
  default, as UC_HIBERNATE_CONNECTION_PASSWORD, as the chart passes it.
  upgrade-schema then runs bin/start-uc-server --upgrade-schema, as the
  chart's init container does, since the server no longer sets up a new
  database's schema itself.
- Once the server is up, storage-init registers RustFS as an s3_compatible
  storage credential with an external location for the bucket, so the
  server reaches it at RustFS and vends short-lived, path-scoped sessions
  that name RustFS's endpoint. The bucket name is fixed, since the server
  won't move a location that is in use. storage-init updates both on every
  start, which also re-encrypts the credential with the current key, and
  creates them only when the server reports them missing. Each call must
  return JSON naming the entity, since the CLI exits 0 when it rejects
  its arguments. The secret is encrypted with
  UC_SERVER_CREDENTIAL_ENCRYPTION_KEY, which the chart sets from
  server.credentialEncryptionKeySecret; left empty, a key generated once
  into the configuration volume, written beside its name and renamed into
  place, is used.
- docker-compose-remote.yaml runs only the bridge and web against the Unity
  Catalog server named by UC_SERVER.

Both files publish ports on 127.0.0.1 unless BIND_ADDRESS says otherwise:
authorization is off and PostgreSQL and RustFS use default credentials.
The long-running services restart when they exit. The server gets the 20
seconds docs/server/configuration.md asks for to stop; the bridge stops on
SIGINT, which it handles gracefully, with 35 seconds to finish an in-flight
RPC. PostgreSQL counts as healthy once it accepts TCP connections, as the
server connects, not just on its socket. RustFS and the AWS CLI are
pinned, RustFS to the image the server's tests use.

Both images generate their protobuf code from proto/ during the build, the
web image with the buf that bun.lock pins and the bridge image with the
same version, so a fresh checkout builds without running buf first. The
web build ignores web/*.local, so a checkout's local Vite settings never
reach the image. The bridge binary is owned by root, so the runtime user
can't replace it.
Nginx 1.30, the stable branch, proxies /uc.v1.*, /config, and /healthz to
the bridge, re-resolving it at most every 10 seconds so a recreated bridge
is found; it serves index.html for client-side routes and allows 4 MiB
request bodies to match Connect's default limit. Private registries are
environment-only: NPM_REGISTRY_URL, CARGO_REGISTRY_URL, MAVEN_PROXY_URL, or
an optional CARGO_CONFIG_FILE BuildKit secret, mounted where Cargo reads it
so it never lands in a layer.

Strip the 447 npm proxy tarball URLs that ui-new/web/bun.lock has carried
since unitycatalog#1902; only the resolution fields change, not versions or integrity
hashes. Check ui-new/web/bun.lock for them in the lint workflow and in a
pre-commit hook next to the existing ui/bun.lock ones, and name the right
script in the check's hint. The lint workflow also runs shellcheck on the
container scripts, tests of config-init, start-server and storage-init
against stand-ins for the AWS CLI, the server launcher and bin/uc, and
docker compose config on both Compose files.

Closes unitycatalog#1893

Signed-off-by: Scott Haines <[email protected]>
Co-authored-by: Isaac <[email protected]>
@newfront
newfront force-pushed the feat/add-ui-docker-environments branch from 8e7afd5 to 0faa05d Compare November 30, 2026 20:06
@newfront

Copy link
Copy Markdown
Collaborator Author

Thanks. Nits 1, 3, 4 and 5 are addressed in 0faa05df, still one commit. I've left nit 2 as it is.

Nit 1: local Vite env files reach the image. ui-new/.dockerignore now ignores web/*.local, the files web/.gitignore keeps out of the repository, so web/.env.local and web/.env.*.local stay out of the build. I used *.local rather than .env* so that an env file committed later would still apply. With a web/.env.local setting VITE_API_BASE:

  • a plain bun run build bakes that address into the bundle
  • so does the image build without the new line
  • with the line, the address is absent from the image

Nit 2: PostgreSQL on host port 5432. Left as is. POSTGRES_PORT moves it when 5432 is taken, as the README documents, and reaching the database with psql from the host is useful when debugging the stack.

Nit 3: untested overrides and ownership. config-init-test.sh now checks each override appears once:

  • server.authorization=disable
  • server.s3-compatible-storage.enabled=true
  • storage-root.tables=s3://uc-warehouse
  • the PostgreSQL URL, driver and username

A stand-in chown checks the volume goes to -R 100:101, which let me drop the test-only CONF_OWNER setting from the script. The test fails against copies of config-init.sh without the table storage root, with authorization left on, without the driver, or with another owner.

Nit 4: reserved names and paired volumes. The README now says the credential and location names rustfs and rustfs_warehouse belong to the stack, and that storage-init overwrites a same-named one and stops if it can't. It also says to keep or remove the uc_conf and uc_postgres_data volumes together, as docker compose down --volumes does, since the fallback key lives in one and the credentials it encrypts in the other.

Nit 5: "copies etc/conf" and stale temporary files. The README, AGENTS.md, the script comment and the PR description now say the .properties files of etc/conf are copied. config-init also deletes leftover .*.properties.tmp files before copying, and the test checks that.

@roeap roeap left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments to look at.

Comment thread .pre-commit-config.yaml Outdated
entry: bash -c 'cd ui && bun run clean-bun-lock'
files: ^ui/bun\.lock$
pass_filenames: false
- id: clean-bun-lock-ui-new

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found doing this as a post-install action to be more convenient and robust. Maybe something to consider?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, switched in ad03e3c. clean-bun-lock now runs as the ui-new/web postinstall, and the ui-new pre-commit entry is gone, so this PR no longer touches .pre-commit-config.yaml. Bun saves the lockfile before it runs the root postinstall: a bun add that wrote 448 proxy URLs left none, and a bun install leaves the committed lockfile unchanged. The web image copies the script in before its bun install --frozen-lockfile, which would otherwise fail on the missing script. The lint step's --check stays as the CI gate.

Comment thread ui-new/server/Dockerfile Outdated
Comment on lines +4 to +8
FROM bufbuild/buf:1.72.0 AS buf

FROM rust:1.88-bookworm AS build

COPY --from=buf /usr/local/bin/buf /usr/local/bin/buf

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
FROM bufbuild/buf:1.72.0 AS buf
FROM rust:1.88-bookworm AS build
COPY --from=buf /usr/local/bin/buf /usr/local/bin/buf
FROM rust:1.88-bookworm AS build
COPY --from=bufbuild/buf:1.72.0 /usr/local/bin/buf /usr/local/bin/buf

I think this might also work.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in ad03e3c: COPY --from=bufbuild/buf:1.72.0@sha256:…, and the separate stage is gone.

Comment thread ui-new/server/Dockerfile Outdated
# The buf version web/bun.lock pins, which a local build.rs run uses.
FROM bufbuild/buf:1.72.0 AS buf

FROM rust:1.88-bookworm AS build

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should pin images with their SHA.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in ad03e3c. Every image is now tag@sha256: with its multi-arch digest, as the root Dockerfile and the Helm chart do: the # syntax= lines, rust, debian, buf, bun and nginx-unprivileged in the Dockerfiles, and postgres, aws-cli and rustfs (now with its 1.0.4 tag) in Compose.

Comment thread ui-new/server/Dockerfile Outdated
Comment on lines +33 to +59
FROM debian:bookworm-slim AS runtime

RUN apt-get update \
&& apt-get install --no-install-recommends -y ca-certificates curl \
&& rm -rf /var/lib/apt/lists/* \
&& groupadd --system --gid 10001 unitycatalog \
&& useradd --system --uid 10001 --gid unitycatalog --home-dir /app unitycatalog \
&& mkdir -p /app \
&& chown unitycatalog:unitycatalog /app

# Owned by root, so the unitycatalog user can run the binary but not replace it.
COPY --from=build /tmp/uc-ui-bridge /usr/local/bin/uc-ui-bridge

ENV PORT=8081

USER unitycatalog
WORKDIR /app

EXPOSE 8081

# The bridge shuts down gracefully, finishing in-flight RPCs, on SIGINT.
STOPSIGNAL SIGINT

HEALTHCHECK --interval=5s --timeout=3s --start-period=5s --retries=12 \
CMD ["curl", "--fail", "--silent", "http://localhost:8081/healthz"]

ENTRYPOINT ["uc-ui-bridge"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This being rust, I believe we might as well go distroless from the beginning? After some iteration i found that the pattern e.g. in https://github.com/open-lakehouse/headwaters/blob/main/Dockerfile work quite well and produces nice images. Also, adopting cargo-chef cuts down on build times significantly.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed on both, and thanks for the headwaters pointer. We're leaving them out of this PR and tracking them in #2412. From a first look: distroless cc-debian12 has the same glibc as the bookworm build image, and the bridge's rustls needs no OpenSSL. cargo chef cook replaces our build.rs with a stub, so the cached dependency layer needs no buf. The open points are the health check without curl, and getting CARGO_REGISTRY_URL to cook, which doesn't take our --config flags.

Comment thread ui-new/web/Dockerfile

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as the UI bridge is a hard requirement, does it make sense to just copy that bundle into the bridge image and serve it from there?

THe same image from above also contains that as an examplke. https://github.com/open-lakehouse/headwaters/blob/main/Dockerfile

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good point. Let me look at what you've done in the example.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up: we'll do this in #2413 rather than in this PR. It brings back the SPA serving that #2262 removed from the bridge (WEB_DIST), builds the bundle in a stage of the bridge image, and then drops the web image, nginx.conf and the web service from both Compose files. It pairs with #2412, since both reshape server/Dockerfile.

Comment thread ui-new/docker-compose.yaml Outdated
- uc_conf:/conf

postgres:
image: postgres:16.3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also SHA?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinned in ad03e3c, as postgres:16.3@sha256:…, along with the other images.

Addresses the review of the ui-new container environments:

- Pin every image as tag@sha256 with its multi-arch digest, as the root
  Dockerfile and the Helm chart do: the Dockerfile syntax image, rust,
  debian, buf, bun and nginx-unprivileged in the Dockerfiles, and
  postgres, aws-cli and rustfs in Compose.
- Copy buf straight from the bufbuild/buf image instead of a named
  stage.
- Run clean-bun-lock as the web package's postinstall, in place of the
  ui-new pre-commit hook. Bun saves the lockfile before the root
  postinstall runs, so bun install, add and update leave no proxy URLs
  to stage. The web image copies the script in before its install, and
  the lint workflow's --check stays as the CI gate.

Signed-off-by: Scott Haines <[email protected]>
Co-authored-by: Isaac <[email protected]>
@yili-db

yili-db commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

/review

@yili-db yili-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] Reviewed at ad03e3c. I ran the core stack (postgres, rustfs, config-init, upgrade-schema, unitycatalog, storage-init) on non-default ports and built the web image. storage-init creates the credential and location on first start and updates them on re-run. The lint steps pass locally. I could not run the bridge image: its cargo fetch needs index.crates.io, which does not resolve from my host. The first inline item is the one normal finding, and I reproduced it; the rest are nits.

dockerfile: web/Dockerfile
args:
NPM_REGISTRY_URL: "${NPM_REGISTRY_URL:-}"
restart: unless-stopped

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] web has no stop_grace_period, so on docker compose down Docker sends SIGKILL 10 seconds in, while nginx (graceful on SIGQUIT) may still be proxying a bridge RPC that has up to 30 seconds left. I reproduced this with a slow stub bridge: the request was cut at 10 seconds. With stop_grace_period: 35s on web, the same request returned 200 and the container exited 0. The rendered config differs by that one key. The web service in docker-compose-remote.yaml (line 32) needs the same change.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reproducing it. Fixed in cc4e9a0: web gets stop_grace_period: 35s in both files. I re-ran it with the bridge pointed at a server that accepts connections and never answers. With stop -t 10, the RPC was cut at 13 s and web exited 137. With the new value, the RPC finished with the bridge's timeout response at 30 s and web exited 0.


# The stand-in answers per STUB_MODE and records each write's arguments in
# STUB_CALLS. The real CLI exits 0 when it rejects its arguments, printing help.
cat > "$work/bin/uc" <<'EOF'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] The stub bin/uc accepts any option, so a renamed or removed CLI flag passes CI and only fails at docker compose up. Could the stub reject options that the real CLI does not list in its help, for example from bin/uc credential create --help? The full smoke run could go in a cross-linked followup issue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in cc4e9a0. The stand-in now reads the CLI's own option table at test time (CliUtils.cliOptions and commonOptions, with the names from CliParams) and takes only the options listed for each command. For any other option, or a missing required one, it prints help and exits 0, as UnityCatalogCli does; it also refuses an option without its leading --, which the CLI would ignore. A new check drops s3_endpoint from the table, as if the CLI no longer took it, and storage-init then fails on its first write. Commands are looked up by the CLI's own values, so a renamed entity or operation, or a table the test can't read, fails the test rather than accepting every option. The full smoke run is #2428.

Comment thread ui-new/web/nginx.conf Outdated

location /assets/ {
try_files $uri =404;
expires 1y;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] nit: expires 1y and the add_header Cache-Control both emit a Cache-Control header, so /assets/ gets two. Dropping expires and putting max-age in the add_header gives one header with the same routing.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in cc4e9a0: add_header Cache-Control "public, max-age=31536000, immutable" and no expires, so an asset now comes back with that one header.

Comment thread ui-new/docker-compose.yaml Outdated
command: ["sh", "/docker/start-server.sh"]
restart: unless-stopped
# The server can need 15 seconds to stop with its default settings; see
# server.shutdown-timeout in docs/server/configuration.md.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] nit: these comments cite other files by name: docs/server/configuration.md here, the Helm chart value names at lines 19-20 and 41, and the Helm chart in config-init.sh and start-server.sh. They will drift. Could we keep the why and drop the cross-references?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in cc4e9a0. The comments in the Compose file, config-init.sh and start-server.sh keep the reason and no longer name docs/server/configuration.md, the Helm chart or its values. storage-init.sh's "see the note there" now gives the reason itself.

else
fail "could not look up $entity $name:" "$output"
fi
log "${action%e}ing $entity $name"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] nit: ${action%e}ing works, but it is hard to read. Could each branch name its verb explicitly?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in cc4e9a0: each branch logs updating or creating itself.

Comment thread ui-new/server/Dockerfile Outdated
&& apt-get install --no-install-recommends -y ca-certificates curl \
&& rm -rf /var/lib/apt/lists/* \
&& groupadd --system --gid 10001 unitycatalog \
&& useradd --system --uid 10001 --gid unitycatalog --home-dir /app unitycatalog \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] nit: useradd --system --uid 10001 warns in the build log because the uid is above SYS_UID_MAX (999). Dropping --system or accepting the warning would both work.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped --system from both groupadd and useradd in cc4e9a0. The build log no longer warns, and the user is still uid and gid 10001.

# Authorization stays off: the stack sets up no identity provider.
{
printf '\n# Local Compose overrides generated by config-init.\n'
printf 'server.authorization=disable\n'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] nit: the overrides are appended, so server.authorization appears in both the template copy and the override, and hibernate.connection.url appears twice in hibernate.properties. Last wins and the test checks the last line, so this works. Filtering the keys before appending would leave one value per key. Optional.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in cc4e9a0. config-init copies each template without the keys the overrides set, so each key has one value. The test's templates now set some of those keys, plus server.authorization-url, which only shares a prefix and is kept. In a full run, each overridden key appeared once in the volume's server.properties and hibernate.properties.

Comment thread ui-new/README.md
catalog without one: `config-init` sets the deprecated `storage-root.tables`
fallback to the bucket.

To restart the stack in order, run `docker compose down` and then

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI Assisted] nit: with pull_policy: never, a plain docker compose up after a server code change keeps the old image. Could this paragraph say to use up --build after code changes?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in cc4e9a0: up starts the images it built before, so add --build after changing the server, bridge, or web code.

- Give the web service stop_grace_period: 35s in both Compose files.
  Nginx drains in-flight requests on SIGQUIT, but Docker killed it 10
  seconds in, cutting an RPC that was still waiting on the bridge's
  30-second Unity Catalog timeout.
- Have the storage-init test's bin/uc stand-in take only the options
  the CLI lists for each command, read from CliUtils.cliOptions and
  CliParams, and print help for any other, as the CLI does. A renamed
  or removed CLI option now fails the lint step instead of compose up.
- Copy each etc/conf template without the keys config-init overrides,
  so each key has one value, and check that in the test.
- Send one Cache-Control header for /assets/.
- Create the bridge image's user and group without --system, which
  warned for uid 10001.
- Log explicit verbs in storage-init, keep the reasons in comments
  without naming other files, and say in the README to add --build
  after code changes.

Signed-off-by: Scott Haines <[email protected]>
Co-authored-by: Isaac <[email protected]>
@newfront

newfront commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the review. Every inline item is addressed in cc4e9a0; the replies are on each thread, and the full Compose smoke run in CI is #2428.

On the bridge build: Cargo fetches from crates.io unless the build is pointed at a mirror. CARGO_REGISTRY_URL=<sparse registry URL>, or a CARGO_CONFIG_FILE with a source replacement, works with both Compose files, as the README's registry section describes.

@newfront

newfront commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

/review

- Print the last attempt's output when config-init's wait for RustFS
  or storage-init's wait for the server times out, so wrong RustFS keys
  or a CLI that can't start no longer look like a slow start.
- Run the container checks in their own lint workflow job, with each
  script's test in the image the script runs in: the AWS CLI image for
  config-init, and the server image's Alpine base for the others.
- Have storage-init-test name the CLI file it could not parse, and say
  above CliUtils.cliOptions that the test reads it.
- Check every credential argument on create and update, a first start
  that stopped after the credential, and both wait timeouts.
- Share the server image's definition between the three services that
  use it, and say at UI_AUTH_ENABLED and in the README that it gates
  only the UI.

Signed-off-by: Scott Haines <[email protected]>
Co-authored-by: Isaac <[email protected]>
@newfront
newfront requested a review from openinx as a code owner December 2, 2026 19:39
@newfront

newfront commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the AI review of cc4e9a0 in 4cc8c5d:

Nit 1: wait timeouts hide the cause. Fixed. Both waits keep each attempt's output. On timeout, config-init prints the AWS CLI's last error, and storage-init prints the CLI's last output without stack frames. New tests stand in for RustFS refusing its keys and for a server that never answers. They check that the script exits 1 and prints the error, once.

Nit 2: the storage-init test is coupled to the CLI's source.

  • Failure messages: when the test can't parse the CLI's source, its failure message names the file and what it couldn't read. For example: could not read commonOptions from examples/cli/src/main/java/io/unitycatalog/cli/utils/CliUtils.java; update its parser to match. I checked this by simulating three source changes: commonOptions built with List.of, a renamed command, and a renamed CliParams constant.
  • Comment: a two-line comment above CliUtils.cliOptions says the test reads it. The format check passes: google-java-format 1.28.0, the version the build pins, reports CliUtils.java unchanged.
  • Own job: the container checks now run in their own lint workflow job, "Check ui-new container files", so a failure there is named for what broke, apart from the format checks. It has no path filter; it takes well under a minute.

Nit 3: CI doesn't build or start the stack. This is #2428, already listed under Follow-ups. It builds the images, runs up --wait, loads the UI, a deep link, /config and a catalog RPC through the web port, and then runs up again to cover the re-run path. It needs path filtering, because the server image's sbt build takes several minutes, so it doesn't fit into this PR.

Nit 4: tests run under dash, not in the images. Fixed. The new job runs each test in the image its script runs in. config-init-test.sh runs in the AWS CLI image the Compose file names (Amazon Linux 2023, where sh is bash, with GNU tools). The other two run in the alpine runtime stage of the root Dockerfile (busybox sh). The job reads both image names from those files, so the job can't drift from them. It still runs every *-test.sh, so a new test is picked up; tests other than config-init's run in Alpine. I ran the job's steps, taken from the workflow file, locally with those images: all 42 checks passed.

Nit 5: credential arguments, the update path, and mixed states aren't checked. Fixed:

  • Create: every credential argument is checked: the endpoint, both keys (the defaults) and the role.
  • Update: the same arguments are checked with keys set through RUSTFS_ACCESS_KEY and RUSTFS_SECRET_KEY, along with the location's update arguments.
  • Half-finished first start: a new mode has the credential existing and the location NOT_FOUND. The test expects a credential update and a location create.

Swapping the keys, dropping the role, or registering the location only after creating the credential each fail the test.

Nit 6: UI_AUTH_ENABLED with an open Unity Catalog port. The README already said this in the paragraph about BIND_ADDRESS. It now also says what an open port allows: anyone who reaches it can change the catalog and get credentials for the bucket. A comment at UI_AUTH_ENABLED in the Compose file says it gates only the UI. I kept the setting in the full stack. The server still serves its token endpoint with authorization off, so it is how the sign-in screens and the pasted-token flow get tried against the local stack.

Nit 7: duplicated Compose definitions. In part:

  • Done: the three services that use the local server image now share one definition of its name and pull_policy, through an x-local-uc-image anchor. The rendered docker compose config of both files is otherwise unchanged.
  • Deferred: the bridge and web definitions repeated across the two files are left for [UI] ui-new: serve the SPA from the bridge image #2413. That change removes the web service from both files and is adding the shared bridge definition to its scope.

The PR description is updated to match.

@newfront

newfront commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

/review

newfront and others added 2 commits December 2, 2026 11:43
Picks up unitycatalog#2289, which moves the S3-compatible endpoint from the
credential to the external location and removes
server.s3-compatible-storage.enabled.

Signed-off-by: Scott Haines <[email protected]>
Co-authored-by: Isaac <[email protected]>
unitycatalog#2289 moved the S3-compatible endpoint from the credential to the
external location, renamed the credential type
s3_compatible_access_key, and removed
server.s3-compatible-storage.enabled. On main, storage-init's
credential create with --s3_endpoint printed the CLI's help and
stopped the stack; the storage-init test caught it on the PR's merge
with main.

- storage-init registers the credential with only the keys and the
  role, and the location with --endpoint http://rustfs:9000 and
  --path_style_access true: a virtual-hosted address such as
  uc-warehouse.rustfs doesn't resolve on the Compose network.
- config-init no longer writes the removed property.
- The tests, the README and the Compose comment follow.

Signed-off-by: Scott Haines <[email protected]>
Co-authored-by: Isaac <[email protected]>
@newfront

newfront commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

The new "Check ui-new container files" job failed on 4cc8c5d, and it was right to. CI tests the PR merged with main, and #2289 had just landed there. It moves the S3-compatible endpoint from the credential to the external location, renames the credential type s3_compatible_access_key, and removes server.s3-compatible-storage.enabled. On that merge, storage-init's credential create --s3_endpoint … printed the CLI's help, so the stack would have stopped at docker compose up. The storage-init test's stand-in, which now reads the CLI's real option table, caught it before anyone ran the stack.

I merged main into the branch (efa13a1) and moved the stack to the new model in f9aeef8:

  • Credential: storage-init registers it with only the keys and the role.
  • Location: storage-init registers it with --endpoint http://rustfs:9000 and --path_style_access true. Path-style is needed because a virtual-hosted address such as uc-warehouse.rustfs doesn't resolve on the Compose network.
  • Removed property: config-init no longer writes server.s3-compatible-storage.enabled.
  • Docs and tests: the tests, the README and a Compose comment follow. The renamed-option check now drops --endpoint from the location's options.

Verified on a fresh stack, with the server image rebuilt from the branch merged with main:

  • Registered objects: the credential is an s3_compatible_access_key with the role, and the location has endpoint http://rustfs:9000 and path_style_access true.
  • Vend: for a managed volume, WRITE_VOLUME credentials carried a session token, and their external_location_settings named http://rustfs:9000, us-east-1 and path-style access.
  • Scope: inside the Compose network, path-style, a PUT into the volume's path succeeded and read back, and a PUT elsewhere in the bucket got AccessDenied.
  • Re-run: a storage-init re-run with the location in use updated both objects and exited 0.
  • New key: with a new encryption key, storage-init re-encrypted the credential and vending still worked.
  • UI: the UI, a deep link, /config and ListCatalogs answered.
  • Container checks: the new job's steps pass locally in the real images (41 checks; the check for the removed property is gone).

A stack created before this change has its credential and location in the old form. #2289 doesn't let an update add an endpoint to a location that has none, so storage-init stops on such a stack. Remove its volumes with docker compose down --volumes, or delete the rustfs_warehouse location and the rustfs credential first.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI] Add new Dockerfiles, and docker-compose.yaml

3 participants