Skip to content

Commit

Permalink
CI: add mount pod upgrade test (#5240)
Browse files Browse the repository at this point in the history
  • Loading branch information
YunhuiChen authored Oct 23, 2024
1 parent 47cbcd6 commit de14b9b
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions .github/workflows/chaos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ on:
push:
branches:
- 'release-**'
- 'main'
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
branches:
- 'main'
- 'release-**'
paths:
- '**/chaos.yml'
workflow_dispatch:
inputs:
debug:
Expand Down Expand Up @@ -70,11 +77,12 @@ jobs:

- name: Build And Load CSI Docker Image
run: |
docker build -f .github/scripts/chaos/juicefs.Dockerfile -t juicedata/mount:ci .
version=`./juicefs version |awk '{print $3}' | cut -d '-' -f1`
docker build -f .github/scripts/chaos/juicefs.Dockerfile -t juicedata/mount:ee-${version} .
helm repo add juicefs https://juicedata.github.io/charts/
helm repo update
kind load docker-image juicedata/mount:ci --name chart-testing
kind load docker-image juicedata/mount:ee-${version} --name chart-testing
- name: Install JuiceFS CSI Driver
run: |
CHART_VERSION=$(helm search repo juicefs/juicefs-csi-driver --versions | grep juicefs | head -1 | awk -F" " '{print $2}')
Expand All @@ -91,7 +99,9 @@ jobs:
kubectl apply -f .github/scripts/chaos/minio.yaml
- name: Mount Juicefs
run: |
run: |
version=`./juicefs version |awk '{print $3}' | cut -d '-' -f1`
sed -i "s/mount:ci/mount:ee-$version/" .github/scripts/chaos/sc.yaml
kubectl apply -f .github/scripts/chaos/sc.yaml
kubectl apply -f .github/scripts/chaos/pvc.yaml
Expand Down Expand Up @@ -154,6 +164,26 @@ jobs:
fi
done
- name: Mount pod upgrade
timeout-minutes: 5
run: |
chaos=${{matrix.chaos}}
skip_conditions=("minio-io")
if [[ "${skip_conditions[*]}" =~ "$chaos" ]]; then
echo "skip mount pod upgrade"
exit 0
else
CSI_POD_NAME=$(kubectl get pods -n kube-system -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}' | grep juicefs-csi-node)
PVC_POD_NAME=$(kubectl get pods -n kube-system -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}' | grep juicefs-chart-testing-control-plane-pvc)
kubectl exec $CSI_POD_NAME -n kube-system -- juicefs-csi-driver upgrade $PVC_POD_NAME 2>&1 | tee upgrade.log
sleep 5
if ! grep "SUCCESS" upgrade.log;then exit -1;fi
rm upgrade.log
kubectl exec $CSI_POD_NAME -n kube-system -- juicefs-csi-driver upgrade $PVC_POD_NAME --restart 2>&1 | tee upgrade.log
sleep 5
if ! grep "SUCCESS" upgrade.log;then exit -1;fi
fi
- name: Check csi controller log
if: always()
run: |
Expand Down Expand Up @@ -238,4 +268,4 @@ jobs:

- name: Success
if: success()
run: echo "All Done"
run: echo "All Done"

0 comments on commit de14b9b

Please sign in to comment.