Repository navigation
[Helm] Start the UI with bun and test the chart install in CI #2019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1e90c81
[Helm] Start the UI with bun and test the chart install in CI
shba24 a3fde67
[Helm] Turn the UI off by default
shba24 dd2e92c
[Helm] Let the test image be overridden and keep the UI in the HTTPRo…
shba24 fb9a83d
[Helm] Name the pinned helm-docs version in the README check message
shba24 e6e9311
[Helm] Use actions/checkout v7.0.1 in the chart test workflow
shba24 583eaca
[Helm] Time out each helm test call after 5 seconds
shba24 9090e88
[Helm] Keep the UI on by default and start it with bun or yarn
shba24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} | ||
| } | ||
| for i in $(seq 1 30); do check && exit 0; sleep 5; done | ||
| exit 1 | ||
| {{- end }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.