mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-06 03:56:34 +00:00
Merge pull request #10007 from wainersm/run_k8s_on_free_runners
ci: Transition GARM tests to free runners, pt. II
This commit is contained in:
commit
91084058ae
16
.github/workflows/ci.yaml
vendored
16
.github/workflows/ci.yaml
vendored
@ -152,21 +152,9 @@ jobs:
|
|||||||
target-branch: ${{ inputs.target-branch }}
|
target-branch: ${{ inputs.target-branch }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
run-k8s-tests-on-garm:
|
run-k8s-tests-on-amd64:
|
||||||
needs: publish-kata-deploy-payload-amd64
|
needs: publish-kata-deploy-payload-amd64
|
||||||
uses: ./.github/workflows/run-k8s-tests-on-garm.yaml
|
uses: ./.github/workflows/run-k8s-tests-on-amd64.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
|
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
repo: ${{ github.repository_owner }}/kata-deploy-ci
|
repo: ${{ github.repository_owner }}/kata-deploy-ci
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
name: CI | Run kubernetes tests on GARM
|
name: CI | Run kubernetes tests on amd64
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
@ -23,7 +23,7 @@ on:
|
|||||||
default: ""
|
default: ""
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-k8s-tests:
|
run-k8s-tests-amd64:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@ -33,19 +33,18 @@ jobs:
|
|||||||
- fc #firecracker
|
- fc #firecracker
|
||||||
- qemu
|
- qemu
|
||||||
- cloud-hypervisor
|
- cloud-hypervisor
|
||||||
|
container_runtime:
|
||||||
|
- containerd
|
||||||
snapshotter:
|
snapshotter:
|
||||||
- devmapper
|
- devmapper
|
||||||
k8s:
|
k8s:
|
||||||
- k3s
|
- k3s
|
||||||
instance:
|
|
||||||
- garm-ubuntu-2004
|
|
||||||
- garm-ubuntu-2004-smaller
|
|
||||||
include:
|
include:
|
||||||
- instance: garm-ubuntu-2004
|
- vmm: qemu
|
||||||
instance-type: normal
|
container_runtime: crio
|
||||||
- instance: garm-ubuntu-2004-smaller
|
snapshotter: ""
|
||||||
instance-type: small
|
k8s: k0s
|
||||||
runs-on: ${{ matrix.instance }}
|
runs-on: ubuntu-22.04
|
||||||
env:
|
env:
|
||||||
DOCKER_REGISTRY: ${{ inputs.registry }}
|
DOCKER_REGISTRY: ${{ inputs.registry }}
|
||||||
DOCKER_REPO: ${{ inputs.repo }}
|
DOCKER_REPO: ${{ inputs.repo }}
|
||||||
@ -53,9 +52,10 @@ jobs:
|
|||||||
PR_NUMBER: ${{ inputs.pr-number }}
|
PR_NUMBER: ${{ inputs.pr-number }}
|
||||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||||
KUBERNETES: ${{ matrix.k8s }}
|
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 }}
|
SNAPSHOTTER: ${{ matrix.snapshotter }}
|
||||||
USING_NFD: "false"
|
USING_NFD: "false"
|
||||||
K8S_TEST_HOST_TYPE: ${{ matrix.instance-type }}
|
K8S_TEST_HOST_TYPE: all
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@ -68,15 +68,20 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TARGET_BRANCH: ${{ inputs.target-branch }}
|
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 }}
|
- name: Deploy ${{ matrix.k8s }}
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh deploy-k8s
|
run: bash tests/integration/kubernetes/gha-run.sh deploy-k8s
|
||||||
|
|
||||||
- name: Configure the ${{ matrix.snapshotter }} snapshotter
|
- name: Configure the ${{ matrix.snapshotter }} snapshotter
|
||||||
|
if: matrix.snapshotter != ''
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh configure-snapshotter
|
run: bash tests/integration/kubernetes/gha-run.sh configure-snapshotter
|
||||||
|
|
||||||
- name: Deploy Kata
|
- name: Deploy Kata
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh deploy-kata-garm
|
run: bash tests/integration/kubernetes/gha-run.sh deploy-kata
|
||||||
|
|
||||||
- name: Install `bats`
|
- name: Install `bats`
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh install-bats
|
run: bash tests/integration/kubernetes/gha-run.sh install-bats
|
||||||
@ -93,10 +98,10 @@ jobs:
|
|||||||
- name: Archive artifacts ${{ matrix.vmm }}
|
- name: Archive artifacts ${{ matrix.vmm }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: k8s-tests-garm-${{ matrix.vmm }}-${{ matrix.snapshotter }}-${{ matrix.k8s }}-${{ matrix.instance }}-${{ inputs.tag }}
|
name: k8s-tests-${{ matrix.vmm }}-${{ matrix.snapshotter }}-${{ matrix.k8s }}-${{ matrix.instance }}-${{ inputs.tag }}
|
||||||
path: /tmp/artifacts
|
path: /tmp/artifacts
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
- name: Delete kata-deploy
|
- name: Delete kata-deploy
|
||||||
if: always()
|
if: always()
|
||||||
run: bash tests/integration/kubernetes/gha-run.sh cleanup-garm
|
run: bash tests/integration/kubernetes/gha-run.sh cleanup
|
@ -1,86 +0,0 @@
|
|||||||
name: CI | Run kubernetes tests, using CRI-O, on GARM
|
|
||||||
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:
|
|
||||||
- garm-ubuntu-2204
|
|
||||||
- garm-ubuntu-2204-smaller
|
|
||||||
include:
|
|
||||||
- instance: garm-ubuntu-2204
|
|
||||||
instance-type: normal
|
|
||||||
- instance: garm-ubuntu-2204-smaller
|
|
||||||
instance-type: small
|
|
||||||
- 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: ${{ matrix.instance-type }}
|
|
||||||
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-garm
|
|
||||||
|
|
||||||
- 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-garm
|
|
@ -146,7 +146,7 @@ function deploy_coco_kbs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function deploy_kata() {
|
function deploy_kata() {
|
||||||
platform="${1}"
|
platform="${1:-}"
|
||||||
ensure_helm
|
ensure_helm
|
||||||
ensure_yq
|
ensure_yq
|
||||||
|
|
||||||
@ -389,7 +389,7 @@ function cleanup_kata_deploy() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
platform="${1}"
|
platform="${1:-}"
|
||||||
test_type="${2:-k8s}"
|
test_type="${2:-k8s}"
|
||||||
ensure_yq
|
ensure_yq
|
||||||
|
|
||||||
@ -559,6 +559,7 @@ function main() {
|
|||||||
install-kbs-client) install_kbs_client ;;
|
install-kbs-client) install_kbs_client ;;
|
||||||
install-kubectl) install_kubectl ;;
|
install-kubectl) install_kubectl ;;
|
||||||
get-cluster-credentials) get_cluster_credentials ;;
|
get-cluster-credentials) get_cluster_credentials ;;
|
||||||
|
deploy-kata) deploy_kata ;;
|
||||||
deploy-kata-aks) deploy_kata "aks" ;;
|
deploy-kata-aks) deploy_kata "aks" ;;
|
||||||
deploy-kata-kcli) deploy_kata "kcli" ;;
|
deploy-kata-kcli) deploy_kata "kcli" ;;
|
||||||
deploy-kata-kubeadm) deploy_kata "kubeadm" ;;
|
deploy-kata-kubeadm) deploy_kata "kubeadm" ;;
|
||||||
@ -571,6 +572,7 @@ function main() {
|
|||||||
run-tests) run_tests ;;
|
run-tests) run_tests ;;
|
||||||
run-tests-kcli) run_tests "kcli" ;;
|
run-tests-kcli) run_tests "kcli" ;;
|
||||||
collect-artifacts) collect_artifacts ;;
|
collect-artifacts) collect_artifacts ;;
|
||||||
|
cleanup) cleanup ;;
|
||||||
cleanup-kcli) cleanup "kcli" ;;
|
cleanup-kcli) cleanup "kcli" ;;
|
||||||
cleanup-sev) cleanup "sev" ;;
|
cleanup-sev) cleanup "sev" ;;
|
||||||
cleanup-snp) cleanup "snp" ;;
|
cleanup-snp) cleanup "snp" ;;
|
||||||
|
Loading…
Reference in New Issue
Block a user