Skip to content

Commit 3bdf850

Browse files
Add helm ci test
Co-authored-by: liangyuanpeng <[email protected]>
1 parent 9f1f543 commit 3bdf850

File tree

4 files changed

+82
-4
lines changed

4 files changed

+82
-4
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Helm Chart Verify
2+
3+
env:
4+
HELM_VERSION: v3.17.3
5+
6+
on:
7+
push:
8+
# Exclude branches created by Dependabot to avoid triggering current workflow
9+
# for PRs initiated by Dependabot.
10+
branches-ignore:
11+
- 'dependabot/**'
12+
pull_request:
13+
# paths:
14+
# - "charts/**"
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
test-deploy-with-helm:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: install Go
29+
uses: actions/setup-go@v5
30+
with:
31+
go-version-file: go.mod
32+
33+
- name: Set up Helm
34+
uses: azure/setup-helm@v4
35+
with:
36+
version: ${{ env.HELM_VERSION }}
37+
38+
- name: Run
39+
run: |
40+
make test-deploy-with-helm

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,12 @@ test-integration: manifests fmt vet envtest ginkgo ## Run integration tests.
135135
$(GINKGO) --junit-report=junit.xml --output-dir=$(ARTIFACTS) -v $(INTEGRATION_TARGET)
136136

137137
.PHONY: test-e2e
138-
# FIXME: we should install lws CRD.
139138
test-e2e: kustomize manifests fmt vet envtest ginkgo kind-image-build
140139
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
141140

141+
test-deploy-with-helm: kind-image-build
142+
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) TAG=$(GIT_TAG) ./hack/test-deploy-with-helm.sh
143+
142144
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
143145
GOLANGCI_LINT_VERSION ?= v1.63.4
144146
golangci-lint:
@@ -269,6 +271,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
269271
## Tool Versions
270272
KUSTOMIZE_VERSION ?= v5.2.1
271273
CONTROLLER_TOOLS_VERSION ?= v0.16.1
274+
HELM_EXT_OPTS ?=
272275

273276
.PHONY: kustomize
274277
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
@@ -321,7 +324,7 @@ helm: manifests kustomize helmify
321324

322325
.PHONY: helm-install
323326
helm-install: helm
324-
helm upgrade --namespace llmaz-system --install llmaz ./chart -f ./chart/values.global.yaml --dependency-update --create-namespace
327+
helm upgrade --namespace llmaz-system --install llmaz ./chart -f ./chart/values.global.yaml --dependency-update --create-namespace $(HELM_EXT_OPTS)
325328

326329
.PHONY: helm-upgrade
327330
helm-upgrade: image-push artifacts helm-install

hack/test-deploy-with-helm.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit
4+
set -o nounset
5+
set -o pipefail
6+
7+
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
8+
9+
export CWD=$(pwd)
10+
function cleanup {
11+
if [ $USE_EXISTING_CLUSTER == 'false' ]
12+
then
13+
$KIND delete cluster --name $KIND_CLUSTER_NAME
14+
fi
15+
}
16+
function startup {
17+
if [ $USE_EXISTING_CLUSTER == 'false' ]
18+
then
19+
$KIND create cluster --name $KIND_CLUSTER_NAME --image $E2E_KIND_NODE_VERSION --config ./hack/kind-config.yaml
20+
fi
21+
}
22+
function kind_load {
23+
$KIND load docker-image $IMAGE_TAG --name $KIND_CLUSTER_NAME
24+
}
25+
function deploy {
26+
cd $CWD
27+
HELM_EXT_OPTS='--set controllerManager.manager.image.tag=${TAG}' make helm-install
28+
$KUBECTL wait --timeout=30m --for=condition=ready pods --namespace=llmaz-system -l app.kubernetes.io/component!=open-webui,app!=certgen
29+
echo "all pods of llmaz-system is ready..."
30+
$KUBECTL get pod -n llmaz-system
31+
}
32+
trap cleanup EXIT
33+
startup
34+
kind_load
35+
deploy

test/config/lws/leaderworkerset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16664,7 +16664,7 @@ metadata:
1666416664
name: lws-controller-manager
1666516665
namespace: lws-system
1666616666
spec:
16667-
replicas: 2
16667+
replicas: 1
1666816668
selector:
1666916669
matchLabels:
1667016670
control-plane: controller-manager
@@ -16680,7 +16680,7 @@ spec:
1668016680
- --zap-log-level=2
1668116681
command:
1668216682
- /manager
16683-
image: registry.k8s.io/lws/lws:v0.5.0
16683+
image: registry.k8s.io/lws/lws:v0.6.1
1668416684
livenessProbe:
1668516685
httpGet:
1668616686
path: /healthz

0 commit comments

Comments
 (0)