From 612d743eba6cd74390782628a8829b8e9d56cb2b Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 21 Jul 2023 13:47:05 +0800 Subject: [PATCH] ci: remove k8s 1.18,1.19, and add 1.25,1.26,1.27 --- .github/workflows/chart_test.yml | 178 ++++++++++++++++++++++++++++--- 1 file changed, 164 insertions(+), 14 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index 13b716ab4..518ea3ef3 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -79,7 +79,7 @@ jobs: helm plugin install https://github.com/quintush/helm-unittest helm unittest ${{ steps.list-changed.outputs.chart_name }} - install-on-v1-18: + install-on-v1-20: runs-on: ubuntu-latest needs: basic-tests steps: @@ -121,7 +121,7 @@ jobs: - name: Create kind cluster run: | - ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.18.20 + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.20.15 docker pull "$SN_IMAGE" kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" @@ -153,8 +153,81 @@ jobs: timeout-minutes: 10 if: failure() + install-on-v1-21: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: clean disk + run: | + df -h + sudo swapoff -a + sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc "$AGENT_TOOLSDIRECTORY" + sudo apt clean + docker rmi $(docker images -q) -f + df -h + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.12.1 + + - uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.4.0 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') + if [[ -n "$changed" ]]; then + echo "changed=true" >> $GITHUB_OUTPUT + echo "chart_name=$chart_name" >> $GITHUB_OUTPUT + fi + + - name: Create kind cluster + run: | + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.21.14 + docker pull "$SN_IMAGE" + kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" + + env: + KIND_VERSION: 0.20.0 + SN_IMAGE: streamnative/sn-platform:2.10.4.3 + if: steps.list-changed.outputs.changed == 'true' + - install-on-v1-19: + # Install the pulsar operator before testing the sn-platform + - name: Install the pulsar operator + if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + run: | + helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com + helm -n sn-system install sn charts/pulsar-operator --create-namespace + kubectl -n sn-system get deploy + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-pulsar-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-zookeeper-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-bookkeeper-controller-manager + helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/vault-operator + df -h + + - name: Run chart-testing (install) + run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 10 + if: failure() + + install-on-v1-22: runs-on: ubuntu-latest needs: basic-tests steps: @@ -196,7 +269,7 @@ jobs: - name: Create kind cluster run: | - ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.19.11 + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.22.17 docker pull "$SN_IMAGE" kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" @@ -227,9 +300,8 @@ jobs: uses: mxschmitt/action-tmate@v3 timeout-minutes: 10 if: failure() - - install-on-v1-20: + install-on-v1-23: runs-on: ubuntu-latest needs: basic-tests steps: @@ -271,7 +343,7 @@ jobs: - name: Create kind cluster run: | - ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.21.12 + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.23.17 docker pull "$SN_IMAGE" kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" @@ -302,7 +374,8 @@ jobs: uses: mxschmitt/action-tmate@v3 timeout-minutes: 10 if: failure() - install-on-v1-22: + + install-on-v1-24: runs-on: ubuntu-latest needs: basic-tests steps: @@ -344,7 +417,7 @@ jobs: - name: Create kind cluster run: | - ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.22.9 + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.24.16 docker pull "$SN_IMAGE" kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" @@ -376,7 +449,8 @@ jobs: timeout-minutes: 10 if: failure() - install-on-v1-23: + + install-on-v1-25: runs-on: ubuntu-latest needs: basic-tests steps: @@ -418,7 +492,7 @@ jobs: - name: Create kind cluster run: | - ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.23.6 + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.25.12 docker pull "$SN_IMAGE" kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" @@ -449,8 +523,9 @@ jobs: uses: mxschmitt/action-tmate@v3 timeout-minutes: 10 if: failure() - - install-on-v1-24: + + + install-on-v1-26: runs-on: ubuntu-latest needs: basic-tests steps: @@ -492,7 +567,7 @@ jobs: - name: Create kind cluster run: | - ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.24.0 + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.26.7 docker pull "$SN_IMAGE" kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" @@ -523,3 +598,78 @@ jobs: uses: mxschmitt/action-tmate@v3 timeout-minutes: 10 if: failure() + + + install-on-v1-27: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: clean disk + run: | + df -h + sudo swapoff -a + sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc "$AGENT_TOOLSDIRECTORY" + sudo apt clean + docker rmi $(docker images -q) -f + df -h + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.12.1 + + - uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.4.0 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') + if [[ -n "$changed" ]]; then + echo "changed=true" >> $GITHUB_OUTPUT + echo "chart_name=$chart_name" >> $GITHUB_OUTPUT + fi + + - name: Create kind cluster + run: | + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.27.4 + docker pull "$SN_IMAGE" + kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" + + env: + KIND_VERSION: 0.20.0 + SN_IMAGE: streamnative/sn-platform:2.10.4.3 + if: steps.list-changed.outputs.changed == 'true' + + + # Install the pulsar operator before testing the sn-platform + - name: Install the pulsar operator + if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + run: | + helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com + helm -n sn-system install sn charts/pulsar-operator --create-namespace + kubectl -n sn-system get deploy + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-pulsar-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-zookeeper-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-bookkeeper-controller-manager + helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/vault-operator + df -h + + - name: Run chart-testing (install) + run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 10 + if: failure() \ No newline at end of file