Repository navigation
[Helm] Start the UI with bun and test the chart install in CI - #2019
Conversation
751d257 to
450ced0
Compare
|
/review |
067e6eb to
a1a706e
Compare
|
AI review, run locally on the whole stack (#2019 → #2020 → #2021) I ran this repository's AI reviewer locally: the six roles in
Known and left as is: until a release publishes |
|
/review |
newfront
left a comment
There was a problem hiding this comment.
This looks good to me. ![]()
roeap
left a comment
There was a problem hiding this comment.
small nits, otherwise looking good.
|
|
||
| # -- (string) PostgreSQL user password secret key | ||
| # @default -- password | ||
| passwordSecretKey: password |
There was a problem hiding this comment.
hmm, not sure its a good practice to set a default password, if we need this for tests, lets overwrite the value in the helm deploy command there.
There was a problem hiding this comment.
passwordSecretKey isn't a password. It's the name of the key inside the Secret named by passwordSecretName: the chart reads the password with secretKeyRef: {name: passwordSecretName, key: passwordSecretKey} (server/deployment.yaml). passwordSecretName has no default, so no password is set out of the box. This line is unchanged from main; this PR only re-indents it to fix a yamllint error. CI uses H2, so it doesn't set either value.
18a9a46 to
1743734
Compare
The UI moved from yarn to bun (unitycatalog#1732), but the chart still starts it with `yarn start`. Yarn 1 refuses to run because package.json declares `packageManager: bun@...`, so the UI pod crash-loops on any image built from the current ui/ directory. The published unitycatalog-ui:main image (May 2025) predates bun and still needs `yarn start`, so after this change the chart needs a UI image built from today's ui/; the next PR pins one. - Start the UI with `bun run start`. - Add a Helm test hook that checks the server API, the UI page and the UI's /api proxy (API checks only when auth is off), and names the check that failed. Its busybox image is pinned by digest. - Add a Helm Chart Tests workflow for pull requests: helm-docs freshness (failing on any change under helm/), ct lint, and a helm install plus helm test on kind with server and UI images built from the same commit. It uses no secrets, runs only on pull requests so it can't write caches that main reads, and pins uv, kind, the kind node image and kubectl. - Regenerate the chart README (it missed the unitycatalog#1689/unitycatalog#1690 values) and fix the two yamllint errors in values.yaml (whitespace only). Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
The published unitycatalog-ui:main image predates bun, so with bun run start a default install would crash-loop the UI pod until a release publishes a bun-based UI image. A default install now runs only the server; set ui.enabled=true for the UI. CI sets it, so the chart test still checks the UI. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
…ute example The helm test pod image now comes from test.image, with test.imagePullSecrets, so a mirrored registry can run helm test. values.httproute.yaml turns the UI on, because the example serves the API and the UI on one hostname and the UI is now off by default. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
CI regenerates the README with helm-docs v1.14.2, and the README footer records that version, so a README made with another local version still fails the check. The message now points to the pre-commit hook, which pins the same version. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
Pinned by commit SHA, like the other actions in the workflow. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
A call that connects but never gets an answer now fails after 5 seconds, so the retry loop can try again. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
1743734 to
583eaca
Compare
|
/review |
The published unitycatalog-ui:main image predates bun and only has yarn, so the start command uses bun when the image has it and yarn otherwise. That keeps a default install and helm upgrade working on today's image, so ui.enabled stays true, as on main. Co-authored-by: Isaac <[email protected]> Signed-off-by: Shubham Bansal <[email protected]>
## 🥞 Stacked PR Use this [link](https://github.com/unitycatalog/unitycatalog/pull/2020/files) to review incremental changes. - [**stack/ep3-helm-release**](#2020) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2020/files)] ← _this PR_ - [stack/ep3-helm-docs](#2021) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2021/files/22d5742dcd3de2ec7784ec335f32eb4aca321559..dc242459fb5b9bf7e5ddd757cb988fad092be25e)] - [stack/ep3-helm-graceful-shutdown](#2060) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2060/files/dc242459fb5b9bf7e5ddd757cb988fad092be25e..21484d93c12f0b49af7b37cb86f5905983d85588)] - [stack/ep14-helm-readyz](#2063) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/2063/files/21484d93c12f0b49af7b37cb86f5905983d85588..c2bc7a8976ff0757c1b79d22724a4df534608453)] --------- **Description of changes** The chart has been version `0.0.1-pre.1` with app version `main` since May 2025. A default install therefore runs the `main` server image, a March 2026 development build, and there is no published chart: users clone the repository and install from the folder (#1058, #1025). This PR makes the chart releasable: - **Published name:** the chart is named `unitycatalog-chart`, to be published at `oci://registry-1.docker.io/unitycatalog/unitycatalog-chart`. Docker Hub stores a chart in a repository named after the chart, and `unitycatalog/unitycatalog` already holds the server image. - **Versions from the release:** `Chart.yaml` keeps placeholder versions. `helm/package-chart.sh X.Y.Z` packages chart X.Y.Z with app version `vX.Y.Z`, so a release chart runs that release's server image by default. It rejects a version with a leading `v`, which would point at a `vvX.Y.Z` image. - **UI version:** the UI image keeps the chart's default tag, the app version. Chart X.Y.Z runs `unitycatalog/unitycatalog:vX.Y.Z` and `unitycatalog/unitycatalog-ui:vX.Y.Z`, and each release publishes both. - **README:** install from the OCI registry, which needs Helm 3.8 or later. - **Package contents:** `.helmignore` excludes `*.sh`, so `package-chart.sh` and `generate-docs.sh` don't ship in the published chart. The README drops the version badges, which showed the `0.0.0-dev` and `main` placeholders in a released chart. - **CI:** the workflow packages the chart with the same script and installs that package. Both image tags come only from the version the script stamps. - **Pinned helper images:** the Alpine and busybox helper images move from `latest` to `alpine:3.24.2` and `busybox:1.37.0`, pinned by digest, so every install of a release runs the same images. Each release updates them to the latest stable release (step in #2021's `RELEASING.md`). **User impact.** The published chart is named `unitycatalog-chart`, but resource names don't change: the name helpers fall back to `unitycatalog`, the chart's old name, instead of the chart name. Release `unitycatalog` still creates `unitycatalog-server`, so an install from a cloned folder upgrades in place and keeps its database volume and signing key, with no `nameOverride`. The default is in the helpers rather than `values.yaml`, so a `helm upgrade --reuse-values` keeps it too. I checked with `helm template` that `main`'s chart and this one give the same resource names, apart from the new test pod. **Before the first release.** Docker Hub has only `unitycatalog-ui:main` (May 2025, which predates bun), which the chart starts with yarn (#2019). Each release publishes `unitycatalog-ui:vX.Y.Z`, built with bun (steps in #2021); 0.8.0 is the first. **Tests:** on kind, the chart packaged by `package-chart.sh 0.0.0-ci` ran `unitycatalog:v0.0.0-ci` (built from source) and `unitycatalog-ui:v0.0.0-ci` with no tag override, and `helm test` passed. CI installs that package with the chart's default values, so the UI runs too. `package-chart.sh` rejects `v0.8.0`, `0.8` and `foo`, and accepts `0.8.0`, `0.8.0-rc0` and `0.0.0-ci`. <details><summary><b>📐 Design notes & details</b></summary> **Why placeholders instead of keeping `Chart.yaml` in sync with `version.sbt`.** The release version passed to the script is the only source, so there's no second file to keep in sync and nothing to compare. The Unity Catalog images rendered after packaging 0.7.0: ``` unitycatalog/unitycatalog:v0.7.0 unitycatalog/unitycatalog-ui:v0.7.0 ``` **Why chart version = Unity Catalog version.** A user who asks for chart 0.8.1 expects server 0.8.1. The cost is that a chart-only fix ships with the next release. **Why the UI uses the server's version.** Releases are published by hand. A separate UI version would add a decision and a pin bump to every release, and CI couldn't test a pinned tag before it was published. Rebuilding an unchanged UI image for a release takes a few minutes. **Why not a separate Docker Hub namespace for charts** (for example `unitycatalogcharts/unitycatalog`): - Docker Hub namespaces allow only lowercase letters and digits, and repositories can't be nested. - The `unitycatalog` organization's open-source program benefits apply per organization, and a new organization would start without them. **CI step.** Both images are loaded into kind only as `unitycatalog:v0.0.0-ci` and `unitycatalog-ui:v0.0.0-ci`, with `pullPolicy: Never`. If the stamping broke (for example, the app version stayed `main`), the pods couldn't start and the install would fail. **Pinned helper images.** The chart's helper images used `latest`, so CI and every install could pull different bytes from one run to the next. Tags move too: `busybox:1.37.0` was rebuilt under the same tag on 2026-09-23. They are now pinned by digest: `alpine:3.24.2@sha256:294b…` for the config init container and the create-users job, and `busybox:1.37.0@sha256:bdf5…` for the UI init container. The config init container still runs `apk add` at start (signed packages; versions follow Alpine 3.24); building those tools into an image is a separate change (#1019). The security review of the CI build is in #2019. **Measured with auth on** (kind, `auth.users` set): the create-users job ran on the pinned Alpine, created `[email protected]` and granted CREATE CATALOG. `GET /api/2.1/unity-catalog/catalogs` returned 401 without a token and 401 with a forged token. </details> **PR Checklist** - [x] 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. - [x] If you've fixed a bug or added code that should be tested, add tests! - [ ] If you've added or modified a feature, documentation in `docs` is updated This pull request and its description were written by Isaac. --------- Signed-off-by: Shubham Bansal <[email protected]> Co-authored-by: Isaac <[email protected]>
🥞 Stacked PR
Use this link to review incremental changes.
Description of changes
The UI moved from yarn to bun in #1732, but the Helm chart still starts it with
yarn start. Yarn 1 refuses to run in a project whosepackage.jsondeclarespackageManager: bun@…. So with any UI image built from today'sui/, the UI pod crash-loops andhelm install --waittimes out.This PR:
bun run startwhen the image has bun, and withyarn startotherwise. The UI stays on by default, as on main;helm testhook that checks the server API, the UI page and the UI's/apiproxy. Its image is set bytest.image(withtest.imagePullSecrets), so a mirrored registry can run it;helm/,ui/or theDockerfile. It checks that the chart README is current (helm-docs), runsct lint, installs the chart on kind with server and UI images built from the PR, and runshelm test;values.yaml. The yamllint fixes are whitespace only, and the parsed values are identical.UI images built from today's
ui/now start with bun. The publishedunitycatalog-ui:mainimage (May 2025) predates bun and has only yarn, so it keeps starting with yarn, and a default install orhelm upgradefrom main keeps its UI. bun is checked first, because a bun image also has yarn (fromnode:18), but yarn refuses to run there. Once each release publishes a bun-based UI image (#2020, #2021), the yarn branch can go.Tests: on a local kind cluster, the unchanged chart crash-loops the UI as described above. With this PR, the install is ready in about 30 seconds and
helm testpasses. CI installs the chart with its default values, with server and UI images built from the PR. This stack changes no JVM code, and the fullbuild/sbt testsuite passes locally.📐 Design notes & details
Repro of the bug (kind with Kubernetes 1.32, server image
v0.7.0, UI image built frommain):With
bun run start, the following all returned 200 through a port-forward: the UI page, the server API, a read through the UI's/apiproxy, and creating and deleting a catalog and a schema through that proxy.Why this workflow builds Docker images. #1420 disabled the image publishing workflows to protect their Docker Hub secrets. This workflow builds images only to load them into a throwaway kind cluster:
permissions: contents: readandpersist-credentials: false;pull_request, notpull_request_target;What the test checks.
localhost,*.localhostand IP addresses, and rejects other hostnames such as the Service name (see Getting Invalid Host header error in browser with https URL #753). The test sendsHost: localhost, as a browser onkubectl port-forwarddoes. Ingress and HTTPRoute mode turn the proxy off, and the test then skips the proxy check.auth.enabled, the test has no token, so it checks only the UI page. With auth on and the UI off, there is nothing to check, and no test pod is rendered.helm test --logsso the output reaches the job log. The test pod is kept after it passes and replaced on the next run, because--logsreads it after the test finishes.index.htmleven after a compile error.Local limits. This machine can't build the server image from source (old Docker and kernel), so locally I ran the same steps with the released
v0.7.0server image. The first from-source build in this workflow is this PR's CI run.Tools: Helm 3.20.0, chart-testing-action 2.9.0 (ct 3.15.0), kind-action 1.15.1, helm-docs 1.14.2.
Measured results (kind, chart from this PR, UI on, images built from the PR):
GET /api/2.1/unity-catalog/catalogsGET /withHost: localhost:3000GET /withHost: uc.example.comInvalid Host header(the dev server's rejection page, see #753)GET /api/2.1/unity-catalog/catalogsPOST /catalogs {"name": "ep3"}POSTagainGET /catalogs/missingDELETE /catalogs/ep3yarn start)helm install --waittimes outSecurity review: building images in CI again. #1420 turned off the workflows that built and pushed images, because they held Docker Hub secrets. This workflow builds images again, for testing only. I reviewed it, and also ran GLM 5.3 and Claude Opus reviews; every point below was checked against the files, the actions at their pinned commits, and a CI run.
If a container in this job is compromised:
docker build(a base image, or an npm, Maven, apk or apt package)GITHUB_TOKEN, no secrets, no way to push images, charts or code; it can make the test pass or fail wronglyThe one way out of the job was the GitHub Actions cache. A job running on
mainwrites caches that other workflows onmainrestore, including the sbt and bun caches andai-review.yml, which holds secrets. So the workflow runs only on pull requests: a pull request's caches are scoped to that pull request, andmainnever reads them. A tampered helm-docs image could edit chart files before the install, so the check now fails on any change underhelm/, not onlyREADME.md.Docker Hub credentials: this workflow can't reach them under any trigger. GitHub gives a job only the secrets it names, and this workflow names none; pull requests from forks get no secrets at all. Before anyone turns the old image workflows back on: they log in to Docker Hub and use the
type=ghabuild cache in the same job, so a poisoned cache could reach the published images.Pinned inputs: actions by commit SHA (
actions/checkoutat v7.0.1); helm-docs, the Dockerfiles' base images and syntax frontend, thehelm testimage and the kind node image (kindest/node:v1.37.0@sha256:a1ed…) by digest; kind v0.33.0, kubectl v1.37.1, helm v3.20.0 and uv 0.13.1 by version; the UI's npm packages bybun.lock. The chart's other helper images still uselatesthere; #2020 pins them. Not pinned, and pre-existing:apk add bashandapt-get install jqduring the image builds andapk addin the config init container (signed packages, but versions move), and sbt's Maven downloads and launcher jar (no hash lock).Follow-ups (not in this stack): zizmor checks for all workflows. Separately, the existing cache exposure this workflow avoids stays as it is:
unit-tests.yml,lint-check.ymlandcross-spark-build.ymlwrite caches onmain, andai-review.ymlrestores caches while holding secrets. zizmor's cache-poisoning audit doesn't flag theai-review.ymlcase (0 findings when run on it).PR Checklist
docsis updatedThis pull request and its description were written by Isaac.