From bc1450e7eee3bdb266b2f3e6a9c06978fedb150e Mon Sep 17 00:00:00 2001 From: Amulyam24 Date: Thu, 18 Jan 2024 10:32:22 +0530 Subject: [PATCH] k8s-workflow-ppc --- .github/workflows/ci.yaml | 13 +++- .../workflows/run-k8s-tests-on-ppc64le.yaml | 69 +++++++++++++++++++ .../kata-deploy-build-and-upload-payload.sh | 2 +- 3 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/run-k8s-tests-on-ppc64le.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 02b6dda2597c..70c501aaf24e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -69,7 +69,7 @@ jobs: with: tarball-suffix: -${{ inputs.tag }} registry: ghcr.io - repo: ${{ github.repository_owner }}/kata-deploy-ci + repo: amulyam24/kata-deploy-ci tag: ${{ inputs.tag }}-ppc64le commit-hash: ${{ inputs.commit-hash }} target-branch: ${{ inputs.target-branch }} @@ -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 000000000000..89ccb4909967 --- /dev/null +++ b/.github/workflows/run-k8s-tests-on-ppc64le.yaml @@ -0,0 +1,69 @@ +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: ${HOME}/scripts/prepare_runner.sh + + - name: Set the KUBECONFIG for kubeadm + run: export KUBECONFIG="$HOME/.kube/config" + - 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: 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 + + diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh index af746e79c5ba..1cd948bb9978 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh @@ -23,7 +23,7 @@ pushd ${KATA_DEPLOY_DIR} arch=$(uname -m) [ "$arch" = "x86_64" ] && arch="amd64" -IMAGE_TAG="${REGISTRY}:kata-containers-$(git rev-parse HEAD)-${arch}" +IMAGE_TAG="ghcr.io/amulyam24/kata-containers-$(git rev-parse HEAD)-${arch}" sudo chown -R $USER $HOME/.docker