From f8585db8d9351aeaa9a4d9ae578ed62edac940b4 Mon Sep 17 00:00:00 2001 From: Amulyam24 Date: Tue, 30 Jan 2024 15:48:40 +0530 Subject: [PATCH] gha: add kubernetes tests workflow for ppc64le This PR adds workflow for running kubernetes test suite on ppc64le. It uses scripts to create and delete the cluster using kubeadm as none of the current cluster creation tools are supported on Power. Fixes: #7950 Signed-off-by: Amulyam24 --- .github/workflows/ci.yaml | 11 +++ .../workflows/run-k8s-tests-on-ppc64le.yaml | 81 +++++++++++++++++++ tests/integration/kubernetes/gha-run.sh | 1 + 3 files changed, 93 insertions(+) create mode 100644 .github/workflows/run-k8s-tests-on-ppc64le.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 02b6dda259..d92177e286 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -202,6 +202,17 @@ jobs: commit-hash: ${{ inputs.commit-hash }} pr-number: ${{ inputs.pr-number }} target-branch: ${{ inputs.target-branch }} + + run-k8s-tests-on-ppc64le: + needs: publish-kata-deploy-payload-ppc64le + uses: ./.github/workflows/run-k8s-tests-on-ppc64le.yaml + with: + registry: ghcr.io + repo: ${{ github.repository_owner }}/kata-deploy-ci + tag: ${{ inputs.tag }}-ppc64le + commit-hash: ${{ inputs.commit-hash }} + pr-number: ${{ inputs.pr-number }} + target-branch: ${{ inputs.target-branch }} run-metrics-tests: needs: build-kata-static-tarball-amd64 diff --git a/.github/workflows/run-k8s-tests-on-ppc64le.yaml b/.github/workflows/run-k8s-tests-on-ppc64le.yaml new file mode 100644 index 0000000000..3b91f5f011 --- /dev/null +++ b/.github/workflows/run-k8s-tests-on-ppc64le.yaml @@ -0,0 +1,81 @@ +name: CI | Run kubernetes tests on Power(ppc64le) +on: + workflow_call: + inputs: + registry: + required: true + type: string + repo: + required: true + type: string + tag: + required: true + type: string + pr-number: + required: true + type: string + commit-hash: + required: false + type: string + target-branch: + required: false + type: string + default: "" + +jobs: + run-k8s-tests: + strategy: + fail-fast: false + matrix: + vmm: + - qemu + k8s: + - kubeadm + runs-on: ppc64le + env: + DOCKER_REGISTRY: ${{ inputs.registry }} + DOCKER_REPO: ${{ inputs.repo }} + DOCKER_TAG: ${{ inputs.tag }} + PR_NUMBER: ${{ inputs.pr-number }} + KATA_HYPERVISOR: ${{ matrix.vmm }} + KUBERNETES: ${{ matrix.k8s }} + USING_NFD: "false" + TARGET_ARCH: "ppc64le" + steps: + - name: Prepare the self-hosted runner + run: | + bash ${HOME}/scripts/prepare_runner.sh + sudo rm -rf $GITHUB_WORKSPACE/* + + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.commit-hash }} + fetch-depth: 0 + + - name: Rebase atop of the latest target branch + run: | + ./tests/git-helper.sh "rebase-atop-of-the-latest-target-branch" + env: + TARGET_BRANCH: ${{ inputs.target-branch }} + + - name: Install golang + run: | + ./tests/install_go.sh -f -p + echo "/usr/local/go/bin" >> $GITHUB_PATH + + - name: Prepare the runner for k8s cluster creation + run: bash ${HOME}/scripts/k8s_cluster_cleanup.sh + + - name: Create k8s cluster using kubeadm + run: bash ${HOME}/scripts/k8s_cluster_create.sh + + - name: Deploy Kata + timeout-minutes: 10 + run: bash tests/integration/kubernetes/gha-run.sh deploy-kata-kubeadm + + - name: Run tests + timeout-minutes: 30 + run: bash tests/integration/kubernetes/gha-run.sh run-tests + + - name: Delete cluster and post cleanup actions + run: bash ${HOME}/scripts/k8s_cluster_cleanup.sh diff --git a/tests/integration/kubernetes/gha-run.sh b/tests/integration/kubernetes/gha-run.sh index 717744aa5c..86c7da7f9e 100755 --- a/tests/integration/kubernetes/gha-run.sh +++ b/tests/integration/kubernetes/gha-run.sh @@ -261,6 +261,7 @@ function main() { get-cluster-credentials) get_cluster_credentials ;; deploy-kata-aks) deploy_kata "aks" ;; deploy-kata-kcli) deploy_kata "kcli" ;; + deploy-kata-kubeadm) deploy_kata "kubeadm" ;; deploy-kata-sev) deploy_kata "sev" ;; deploy-kata-snp) deploy_kata "snp" ;; deploy-kata-tdx) deploy_kata "tdx" ;;