Skip to content

chore: add ci to test deploy with helm #377

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
41 changes: 41 additions & 0 deletions .github/workflows/test-chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# validate any chart changes under charts directory
name: Chart Test

env:
HELM_VERSION: v3.17.3

on:
push:
# Exclude branches created by Dependabot to avoid triggering current workflow
# for PRs initiated by Dependabot.
branches-ignore:
- 'dependabot/**'
pull_request:
# paths:
Copy link
Member

Choose a reason for hiding this comment

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

Should we only check the chart/** ? I think we're only verifying that the helm chart is deployed as expected not the function, right?

# - "charts/**"

permissions:
contents: read

jobs:
chart-lint-test:
Copy link
Member

Choose a reason for hiding this comment

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

chart-deploy-verify?

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Set up Helm
uses: azure/setup-helm@v4
Copy link
Author

Choose a reason for hiding this comment

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

Perhaps the preference is to complete the installation of helm in the Makefile. Here, it's just a quick start. I'd be more than happy to update. like add a command: make helm to install helm.

Copy link
Member

Choose a reason for hiding this comment

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

Feel free to polish this in the follow up.

with:
version: ${{ env.HELM_VERSION }}

- name: Run test-deploy-with-helm
run: |
make test-deploy-with-helm
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ test-integration: manifests fmt vet envtest ginkgo ## Run integration tests.
test-e2e: kustomize manifests fmt vet envtest ginkgo kind-image-build
E2E_KIND_NODE_VERSION=$(E2E_KIND_NODE_VERSION) KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) KIND=$(KIND) KUBECTL=$(KUBECTL) KUSTOMIZE=$(KUSTOMIZE) GINKGO=$(GINKGO) USE_EXISTING_CLUSTER=$(USE_EXISTING_CLUSTER) IMAGE_TAG=$(IMG) ENVTEST_LWS_VERSION=$(ENVTEST_LWS_VERSION) ./hack/e2e-test.sh

test-deploy-with-helm: kind-image-build
E2E_KIND_NODE_VERSION=$(E2E_KIND_NODE_VERSION) KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) KIND=$(KIND) KUBECTL=$(KUBECTL) USE_EXISTING_CLUSTER=$(USE_EXISTING_CLUSTER) IMAGE_TAG=$(IMG) LOADER_IMAGE_TAG=${LOADER_IMAGE_TAG} ./hack/test-deploy-with-helm.sh

GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.63.4
golangci-lint:
Expand Down Expand Up @@ -258,6 +261,7 @@ $(LOCALBIN):
## Tool Binaries
KUBECTL ?= kubectl
KUSTOMIZE ?= $(LOCALBIN)/kustomize
HELM_EXT_OPTS ?=
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest

Expand Down Expand Up @@ -316,7 +320,7 @@ helm: manifests kustomize helmify

.PHONY: helm-install
helm-install: helm
helm upgrade --install llmaz ./chart -f ./chart/values.global.yaml --dependency-update
helm upgrade --install llmaz ./chart -f ./chart/values.global.yaml --dependency-update $(HELM_EXT_OPTS)

.PHONY: helm-upgrade
helm-upgrade: image-push artifacts helm-install
Expand Down
4 changes: 2 additions & 2 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ dependencies:
condition: open-webui.enabled
- name: gateway-helm
version: 0.0.0-latest
repository: "oci://registry-1.docker.io/envoyproxy/"
repository: "oci://registry-1.docker.io/envoyproxy"
condition: envoy-gateway.enabled
- name: ai-gateway-helm
version: v0.0.0-latest
repository: "oci://registry-1.docker.io/envoyproxy/"
repository: "oci://registry-1.docker.io/envoyproxy"
Comment on lines -30 to +34
Copy link
Author

@liangyuanpeng liangyuanpeng Apr 24, 2025

Choose a reason for hiding this comment

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

I just got the error when I run make helm-install , but this change fixed it.

...
Downloading open-webui from repo https://helm.openwebui.com/
Downloading gateway-helm from repo oci://registry-1.docker.io/envoyproxy/
Save error occurred:  could not download oci://registry-1.docker.io/envoyproxy//gateway-helm: invalid_reference: invalid repository
Error: could not download oci://registry-1.docker.io/envoyproxy//gateway-helm: invalid_reference: invalid repository

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, it's strange, I didn't encounter this. I will ask someone else to verify this because it may break users like you.

condition: envoy-ai-gateway.enabled
40 changes: 40 additions & 0 deletions hack/test-deploy-with-helm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..

export CWD=$(pwd)
function cleanup {
if [ $USE_EXISTING_CLUSTER == 'false' ]
then
$KIND delete cluster --name $KIND_CLUSTER_NAME
fi
}
function startup {
if [ $USE_EXISTING_CLUSTER == 'false' ]
then
$KIND create cluster --name $KIND_CLUSTER_NAME --image $E2E_KIND_NODE_VERSION --config ./hack/kind-config.yaml
fi
}
function kind_load {
$KIND load docker-image $IMAGE_TAG --name $KIND_CLUSTER_NAME
}
function deploy {
cd $CWD
HELM_EXT_OPTS='--namespace=llmaz-system --create-namespace --set controllerManager.manager.image.tag=${LOADER_IMAGE_TAG}' make helm-install
$KUBECTL wait --timeout=3m --for=condition=ready pods --namespace=llmaz-system -l app!=certgen
echo "all pods of llmaz-system is ready..."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
echo "all pods of llmaz-system is ready..."
echo "All pods of llmaz are ready..."

$KUBECTL get pod -n llmaz-system
}
function deploy_kube_prometheus {
LATEST=$(curl -s https://api.github.com/repos/prometheus-operator/prometheus-operator/releases/latest | jq -cr .tag_name)
Copy link
Member

Choose a reason for hiding this comment

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

We may make the prometheus operator as a dependency of helm chart as well in the future.

curl -sL https://github.com/prometheus-operator/prometheus-operator/releases/download/${LATEST}/bundle.yaml | $KUBECTL create -f -
}
trap cleanup EXIT
startup
kind_load
deploy_kube_prometheus
deploy
Comment on lines +9 to +40
Copy link
Author

Choose a reason for hiding this comment

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

Just quickly work, I am very willing to reuse it in util.sh in this PR or the next PR.

Loading