From d11ce129ac3eff94dc74f7ea4085a3ca625f7db1 Mon Sep 17 00:00:00 2001 From: Wainer dos Santos Moschetta Date: Fri, 12 Jul 2024 16:40:23 -0300 Subject: [PATCH] workflows: merge run-k8s-tests-on-garm and run-k8s-tests-with-crio-on-garm Created the run-k8s-tests-on-amd64.yaml which is a merge of run-k8s-tests-on-garm.yaml and run-k8s-tests-with-crio-on-garm.yaml ps: renamed the job from 'run-k8s-tests' to 'run-k8s-tests-on-amd64' to it is easier to find on Github UI and be distinguished from s390x, ppc64le, etc... Signed-off-by: Wainer dos Santos Moschetta --- .github/workflows/ci.yaml | 16 +--- ...-garm.yaml => run-k8s-tests-on-amd64.yaml} | 18 ++++- .../run-k8s-tests-with-crio-on-garm.yaml | 81 ------------------- 3 files changed, 18 insertions(+), 97 deletions(-) rename .github/workflows/{run-k8s-tests-on-garm.yaml => run-k8s-tests-on-amd64.yaml} (80%) delete mode 100644 .github/workflows/run-k8s-tests-with-crio-on-garm.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fc230490bb..79feb3ce31 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -152,21 +152,9 @@ jobs: target-branch: ${{ inputs.target-branch }} secrets: inherit - run-k8s-tests-on-garm: + run-k8s-tests-on-amd64: needs: publish-kata-deploy-payload-amd64 - uses: ./.github/workflows/run-k8s-tests-on-garm.yaml - with: - registry: ghcr.io - repo: ${{ github.repository_owner }}/kata-deploy-ci - tag: ${{ inputs.tag }}-amd64 - commit-hash: ${{ inputs.commit-hash }} - pr-number: ${{ inputs.pr-number }} - target-branch: ${{ inputs.target-branch }} - secrets: inherit - - run-k8s-tests-with-crio-on-garm: - needs: publish-kata-deploy-payload-amd64 - uses: ./.github/workflows/run-k8s-tests-with-crio-on-garm.yaml + uses: ./.github/workflows/run-k8s-tests-on-amd64.yaml with: registry: ghcr.io repo: ${{ github.repository_owner }}/kata-deploy-ci diff --git a/.github/workflows/run-k8s-tests-on-garm.yaml b/.github/workflows/run-k8s-tests-on-amd64.yaml similarity index 80% rename from .github/workflows/run-k8s-tests-on-garm.yaml rename to .github/workflows/run-k8s-tests-on-amd64.yaml index 9b8c4c4eea..d069ee81e3 100644 --- a/.github/workflows/run-k8s-tests-on-garm.yaml +++ b/.github/workflows/run-k8s-tests-on-amd64.yaml @@ -1,4 +1,4 @@ -name: CI | Run kubernetes tests +name: CI | Run kubernetes tests on amd64 on: workflow_call: inputs: @@ -23,7 +23,7 @@ on: default: "" jobs: - run-k8s-tests: + run-k8s-tests-amd64: strategy: fail-fast: false matrix: @@ -33,12 +33,20 @@ jobs: - fc #firecracker - qemu - cloud-hypervisor + container_runtime: + - containerd snapshotter: - devmapper k8s: - k3s instance: - ubuntu-22.04 + include: + - vmm: qemu + container_runtime: crio + snapshotter: "" + instance: ubuntu-22.04 + k8s: k0s runs-on: ${{ matrix.instance }} env: DOCKER_REGISTRY: ${{ inputs.registry }} @@ -47,6 +55,7 @@ jobs: PR_NUMBER: ${{ inputs.pr-number }} KATA_HYPERVISOR: ${{ matrix.vmm }} KUBERNETES: ${{ matrix.k8s }} + KUBERNETES_EXTRA_PARAMS: ${{ matrix.container_runtime != 'crio' && '' || '--cri-socket remote:unix:///var/run/crio/crio.sock --kubelet-extra-args --cgroup-driver="systemd"' }} SNAPSHOTTER: ${{ matrix.snapshotter }} USING_NFD: "false" K8S_TEST_HOST_TYPE: all @@ -62,10 +71,15 @@ jobs: env: TARGET_BRANCH: ${{ inputs.target-branch }} + - name: Configure CRI-O + if: matrix.container_runtime == 'crio' + run: bash tests/integration/kubernetes/gha-run.sh setup-crio + - name: Deploy ${{ matrix.k8s }} run: bash tests/integration/kubernetes/gha-run.sh deploy-k8s - name: Configure the ${{ matrix.snapshotter }} snapshotter + if: matrix.snapshotter != '' run: bash tests/integration/kubernetes/gha-run.sh configure-snapshotter - name: Deploy Kata diff --git a/.github/workflows/run-k8s-tests-with-crio-on-garm.yaml b/.github/workflows/run-k8s-tests-with-crio-on-garm.yaml deleted file mode 100644 index e6cd8c139a..0000000000 --- a/.github/workflows/run-k8s-tests-with-crio-on-garm.yaml +++ /dev/null @@ -1,81 +0,0 @@ -name: CI | Run kubernetes tests, using CRI-O -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: - - k0s - instance: - - ubuntu-22.04 - include: - - k8s: k0s - k8s-extra-params: '--cri-socket remote:unix:///var/run/crio/crio.sock --kubelet-extra-args --cgroup-driver="systemd"' - runs-on: ${{ matrix.instance }} - 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 }} - KUBERNETES_EXTRA_PARAMS: ${{ matrix.k8s-extra-params }} - USING_NFD: "false" - K8S_TEST_HOST_TYPE: all - steps: - - 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: Configure CRI-O - run: bash tests/integration/kubernetes/gha-run.sh setup-crio - - - name: Deploy ${{ matrix.k8s }} - run: bash tests/integration/kubernetes/gha-run.sh deploy-k8s - - - name: Deploy Kata - timeout-minutes: 10 - run: bash tests/integration/kubernetes/gha-run.sh deploy-kata - - - name: Install `bats` - run: bash tests/integration/kubernetes/gha-run.sh install-bats - - - name: Run tests - timeout-minutes: 30 - run: bash tests/integration/kubernetes/gha-run.sh run-tests - - - name: Delete kata-deploy - if: always() - run: bash tests/integration/kubernetes/gha-run.sh cleanup