Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/helm-chart-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Helm Chart Tests

# Pull requests only: their caches are scoped to the pull request, so this job can't write caches that main reads.
on:
pull_request:
paths:
- "helm/**"
- "ui/**"
- "Dockerfile"
- ".github/workflows/helm-chart-tests.yml"

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
helm-chart:
name: Lint and install the Helm chart
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up Helm
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
with:
version: v3.20.0

- name: Set up chart-testing
uses: helm/chart-testing-action@720270857a28afd41e2426521a7801db09e9b510 # v2.9.0
with:
uv_version: 0.13.1

- name: Check that the chart README is up to date
run: |
docker run --rm --user "$(id -u):$(id -g)" -v "$PWD/helm:/helm-docs" \
jnorwood/helm-docs:v1.14.2@sha256:7e562b49ab6b1dbc50c3da8f2dd6ffa8a5c6bba327b1c6335cc15ce29267979c
# helm-docs may only regenerate helm/README.md; any other change under helm/ also fails.
if [ -n "$(git status --porcelain -- helm)" ]; then
git status --short -- helm
echo "::error::helm-docs changed files under helm/. If only helm/README.md changed, regenerate it with helm-docs v1.14.2 (pre-commit run helm-docs --all-files) and commit the result."
exit 1
fi

- name: Lint the chart
run: ct lint --charts helm --validate-maintainers=false --check-version-increment=false

- name: Build the server and UI images
run: |
docker build -t unitycatalog:ci .
docker build -t unitycatalog-ui:ci ui

- name: Create kind cluster
uses: helm/kind-action@1544676c07bb3570fcb70166beaa07c4528fd4aa # v1.15.1
with:
version: v0.33.0
node_image: kindest/node:v1.37.0@sha256:a1ed56cfb0e7b93589bdf97c8cd566405a265939e3620fc4f5de89adff580ae5
kubectl_version: v1.37.1

- name: Load the images into kind
run: kind load docker-image unitycatalog:ci unitycatalog-ui:ci --name chart-testing

- name: Install the chart and run helm test
run: |
helm install uc helm --namespace uc --create-namespace --wait --timeout 600s \
--set server.deployment.image.repository=unitycatalog \
--set server.deployment.image.tag=ci \
--set server.deployment.image.pullPolicy=Never \
--set ui.deployment.image.repository=unitycatalog-ui \
--set ui.deployment.image.tag=ci \
--set ui.deployment.image.pullPolicy=Never
helm test uc --namespace uc --logs
72 changes: 57 additions & 15 deletions helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ The following table lists the configurable parameters of the Unity Catalog chart
<th>Description</th>
</thead>
<tbody>
<tr>
<td>auth.accessTokenTimeout</td>
<td>string</td>
<td><pre lang="">
PT24H
</pre>
</td>
<td>UC access token lifetime for token exchange

Example: `PT24H` (24 hours), `P7D` (7 days)
</td>
</tr>
<tr>
<td>auth.allowedIssuers</td>
<td>string</td>
Expand All @@ -60,6 +72,9 @@ https://accounts.google.com
<td>Comma-separated list of allowed token issuers

When authorization is enabled, tokens will only be accepted from issuers in this list.
Supports exact match or wildcard patterns with * (single DNS label per wildcard).
Cannot be "*" alone. Wildcard issuers are evaluated before signature verification;
see docs/server/auth.md.

Example for Google: `https://accounts.google.com`
Example for Microsoft Entra ID: `https://login.microsoftonline.com/{tenant-id}/v2.0`
Expand All @@ -86,9 +101,9 @@ not set
</td>
<td>Comma-separated list of expected JWT audience values

When authorization is enabled, tokens must contain one of these audience values.
This ensures tokens are intended for this Unity Catalog instance.
Typically your application's client ID or API identifier.
When authorization is enabled, tokens must contain an aud value matching one of these entries.
Supports exact match or wildcard patterns with * (same rules as allowedIssuers).
Use "*" alone to disable audience validation (issuer and user checks still apply).
</td>
</tr>
<tr>
Expand Down Expand Up @@ -127,18 +142,6 @@ Client secret must contain the following keys:
<td>OAuth cookie timeout

Example: `P5D` (5 days)
</td>
</tr>
<tr>
<td>auth.accessTokenTimeout</td>
<td>string</td>
<td><pre lang="json">
"PT24H"
</pre>
</td>
<td>UC access token lifetime for token exchange

Example: `PT24H` (24 hours), `P7D` (7 days)
</td>
</tr>
<tr>
Expand Down Expand Up @@ -1169,6 +1172,45 @@ not set
<td>Root path for the model storage

Example: `s3://bucket/path`
</td>
</tr>
<tr>
<td>test.image.pullPolicy</td>
<td>string</td>
<td><pre lang="json">
"IfNotPresent"
</pre>
</td>
<td>Pull policy for the `helm test` pod image</td>
</tr>
<tr>
<td>test.image.repository</td>
<td>string</td>
<td><pre lang="json">
"busybox"
</pre>
</td>
<td>Repository for the `helm test` pod image</td>
</tr>
<tr>
<td>test.image.tag</td>
<td>string</td>
<td><pre lang="json">
"1.37.0@sha256:bdf57e528e45e4433820e045b29b4597825a1c9e38353532d90a01445013f82e"
</pre>
</td>
<td>Tag for the `helm test` pod image, pinned by digest</td>
</tr>
<tr>
<td>test.imagePullSecrets</td>
<td>array</td>
<td><pre lang="">
not set
</pre>
</td>
<td>Image pull secrets for the `helm test` pod

[Kubernetes docs](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod)
</td>
</tr>
<tr>
Expand Down
41 changes: 41 additions & 0 deletions helm/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- $checkServer := and .Values.server.enabled (not .Values.auth.enabled) }}
{{- $checkProxy := and $checkServer .Values.ui.enabled (eq (include "unitycatalog.ui.proxyApiRequests" .) "true") }}
{{- if or $checkServer .Values.ui.enabled }}
{{- $server := printf "http://%s:%v" (include "unitycatalog.server.fullname" .) .Values.server.service.port }}
{{- $ui := printf "http://%s:%v" (include "unitycatalog.ui.fullname" .) .Values.ui.service.port }}
apiVersion: v1
kind: Pod
metadata:
name: {{ printf "%s-test-connection" (include "unitycatalog.fullname" .) | quote }}
labels: {{- include "unitycatalog.commonLabels" . | nindent 4 }}
annotations:
helm.sh/hook: test
helm.sh/hook-delete-policy: before-hook-creation
spec:
restartPolicy: Never
{{- with .Values.test.imagePullSecrets }}
imagePullSecrets: {{- toYaml . | nindent 4 }}
{{- end }}
containers:
- name: test-connection
image: "{{ .Values.test.image.repository }}:{{ .Values.test.image.tag }}"
imagePullPolicy: {{ .Values.test.image.pullPolicy }}
command: ["sh", "-c"]
args:
- |
check() {
{{- if $checkServer }}
wget -q -T 5 -O - --header "Accept: application/json" "{{ $server }}/api/2.1/unity-catalog/catalogs" | grep -q '"catalogs"' || { echo "Server API check failed"; return 1; }
{{- end }}
{{- if .Values.ui.enabled }}
# In proxy mode the UI dev server rejects Service hostnames, so send Host: localhost as a port-forwarded browser does.
wget -q -T 5 -O - --header "Host: localhost" "{{ $ui }}/" | grep -q "<title>Unity Catalog" || { echo "UI page check failed"; return 1; }
{{- end }}
{{- if $checkProxy }}
# The UI proxies /api to the server.
wget -q -T 5 -O - --header "Host: localhost" --header "Accept: application/json" "{{ $ui }}/api/2.1/unity-catalog/catalogs" | grep -q '"catalogs"' || { echo "UI /api proxy check failed"; return 1; }
{{- end }}
}
Comment thread
shba24 marked this conversation as resolved.
Resolved
for i in $(seq 1 30); do check && exit 0; sleep 5; done
exit 1
{{- end }}
3 changes: 2 additions & 1 deletion helm/templates/ui/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ spec:
jq '.proxy = null' package.json > temp.json
{{- end }}
mv temp.json package.json
yarn start
# The UI runs on bun; the published unitycatalog-ui:main image predates bun and has yarn.
if command -v bun >/dev/null; then exec bun run start; else exec yarn start; fi
env:
{{- if .Values.auth.enabled }}
- name: REACT_APP_GOOGLE_AUTH_ENABLED
Expand Down
Loading
Loading