Merge pull request #8953 from ChengyuZhu6/ci-guest-pull

gha: Enable nydus snapshotter in CoCo ci tests
This commit is contained in:
Wainer Moschetta 2024-02-06 09:36:59 -03:00 committed by GitHub
commit f1ca5d1563
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 62 additions and 0 deletions

View File

@ -29,6 +29,10 @@ jobs:
matrix: matrix:
vmm: vmm:
- qemu-tdx - qemu-tdx
snapshotter:
- nydus
pull-type:
- guest-pull
runs-on: tdx runs-on: tdx
env: env:
DOCKER_REGISTRY: ${{ inputs.registry }} DOCKER_REGISTRY: ${{ inputs.registry }}
@ -38,6 +42,8 @@ jobs:
KATA_HYPERVISOR: ${{ matrix.vmm }} KATA_HYPERVISOR: ${{ matrix.vmm }}
KUBERNETES: "k3s" KUBERNETES: "k3s"
USING_NFD: "true" USING_NFD: "true"
SNAPSHOTTER: ${{ matrix.snapshotter }}
PULL_TYPE: ${{ matrix.pull-type }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@ -59,6 +65,10 @@ jobs:
matrix: matrix:
vmm: vmm:
- qemu-tdx - qemu-tdx
snapshotter:
- nydus
pull-type:
- guest-pull
runs-on: tdx runs-on: tdx
env: env:
DOCKER_REGISTRY: ${{ inputs.registry }} DOCKER_REGISTRY: ${{ inputs.registry }}
@ -69,6 +79,8 @@ jobs:
KUBERNETES: "k3s" KUBERNETES: "k3s"
USING_NFD: "true" USING_NFD: "true"
K8S_TEST_HOST_TYPE: "baremetal" K8S_TEST_HOST_TYPE: "baremetal"
SNAPSHOTTER: ${{ matrix.snapshotter }}
PULL_TYPE: ${{ matrix.pull-type }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@ -81,6 +93,10 @@ jobs:
env: env:
TARGET_BRANCH: ${{ inputs.target-branch }} TARGET_BRANCH: ${{ inputs.target-branch }}
- name: Deploy Snapshotter
timeout-minutes: 5
run: bash tests/integration/kubernetes/gha-run.sh deploy-snapshotter
- name: Deploy Kata - name: Deploy Kata
timeout-minutes: 10 timeout-minutes: 10
run: bash tests/integration/kubernetes/gha-run.sh deploy-kata-tdx run: bash tests/integration/kubernetes/gha-run.sh deploy-kata-tdx
@ -93,12 +109,20 @@ jobs:
if: always() if: always()
run: bash tests/integration/kubernetes/gha-run.sh cleanup-tdx run: bash tests/integration/kubernetes/gha-run.sh cleanup-tdx
- name: Delete Snapshotter
if: always()
run: bash tests/integration/kubernetes/gha-run.sh cleanup-snapshotter
run-k8s-tests-on-sev: run-k8s-tests-on-sev:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
vmm: vmm:
- qemu-sev - qemu-sev
snapshotter:
- nydus
pull-type:
- guest-pull
runs-on: sev runs-on: sev
env: env:
DOCKER_REGISTRY: ${{ inputs.registry }} DOCKER_REGISTRY: ${{ inputs.registry }}
@ -110,6 +134,8 @@ jobs:
KUBERNETES: "vanilla" KUBERNETES: "vanilla"
USING_NFD: "false" USING_NFD: "false"
K8S_TEST_HOST_TYPE: "baremetal" K8S_TEST_HOST_TYPE: "baremetal"
SNAPSHOTTER: ${{ matrix.snapshotter }}
PULL_TYPE: ${{ matrix.pull-type }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@ -122,6 +148,10 @@ jobs:
env: env:
TARGET_BRANCH: ${{ inputs.target-branch }} TARGET_BRANCH: ${{ inputs.target-branch }}
- name: Deploy Snapshotter
timeout-minutes: 5
run: bash tests/integration/kubernetes/gha-run.sh deploy-snapshotter
- name: Deploy Kata - name: Deploy Kata
timeout-minutes: 10 timeout-minutes: 10
run: bash tests/integration/kubernetes/gha-run.sh deploy-kata-sev run: bash tests/integration/kubernetes/gha-run.sh deploy-kata-sev
@ -134,12 +164,20 @@ jobs:
if: always() if: always()
run: bash tests/integration/kubernetes/gha-run.sh cleanup-sev run: bash tests/integration/kubernetes/gha-run.sh cleanup-sev
- name: Delete Snapshotter
if: always()
run: bash tests/integration/kubernetes/gha-run.sh cleanup-snapshotter
run-k8s-tests-sev-snp: run-k8s-tests-sev-snp:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
vmm: vmm:
- qemu-snp - qemu-snp
snapshotter:
- nydus
pull-type:
- guest-pull
runs-on: sev-snp runs-on: sev-snp
env: env:
DOCKER_REGISTRY: ${{ inputs.registry }} DOCKER_REGISTRY: ${{ inputs.registry }}
@ -151,6 +189,8 @@ jobs:
KUBERNETES: "vanilla" KUBERNETES: "vanilla"
USING_NFD: "false" USING_NFD: "false"
K8S_TEST_HOST_TYPE: "baremetal" K8S_TEST_HOST_TYPE: "baremetal"
SNAPSHOTTER: ${{ matrix.snapshotter }}
PULL_TYPE: ${{ matrix.pull-type }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@ -163,6 +203,10 @@ jobs:
env: env:
TARGET_BRANCH: ${{ inputs.target-branch }} TARGET_BRANCH: ${{ inputs.target-branch }}
- name: Deploy Snapshotter
timeout-minutes: 5
run: bash tests/integration/kubernetes/gha-run.sh deploy-snapshotter
- name: Deploy Kata - name: Deploy Kata
timeout-minutes: 10 timeout-minutes: 10
run: bash tests/integration/kubernetes/gha-run.sh deploy-kata-snp run: bash tests/integration/kubernetes/gha-run.sh deploy-kata-snp
@ -174,3 +218,7 @@ jobs:
- name: Delete kata-deploy - name: Delete kata-deploy
if: always() if: always()
run: bash tests/integration/kubernetes/gha-run.sh cleanup-snp run: bash tests/integration/kubernetes/gha-run.sh cleanup-snp
- name: Delete Snapshotter
if: always()
run: bash tests/integration/kubernetes/gha-run.sh cleanup-snapshotter

View File

@ -241,6 +241,18 @@ install_kata_tools_placeholder() {
"after CI picks up the gha yaml changes required to test that installation." "after CI picks up the gha yaml changes required to test that installation."
} }
function deploy_snapshotter() {
echo "::group::Deploying ${SNAPSHOTTER:-}"
#TODO Add the deployment logic for the snapshotter in PR https://github.com/kata-containers/kata-containers/pull/8585.
echo "::endgroup::"
}
function cleanup_snapshotter() {
echo "::group::Cleanuping ${SNAPSHOTTER:-}"
#TODO Add the logic for cleaning up the snapshotter in PR https://github.com/kata-containers/kata-containers/pull/8585.
echo "::endgroup::"
}
function main() { function main() {
export KATA_HOST_OS="${KATA_HOST_OS:-}" export KATA_HOST_OS="${KATA_HOST_OS:-}"
export K8S_TEST_HOST_TYPE="${K8S_TEST_HOST_TYPE:-}" export K8S_TEST_HOST_TYPE="${K8S_TEST_HOST_TYPE:-}"
@ -267,6 +279,7 @@ function main() {
deploy-kata-tdx) deploy_kata "tdx" ;; deploy-kata-tdx) deploy_kata "tdx" ;;
deploy-kata-garm) deploy_kata "garm" ;; deploy-kata-garm) deploy_kata "garm" ;;
deploy-kata-zvsi) deploy_kata "zvsi" ;; deploy-kata-zvsi) deploy_kata "zvsi" ;;
deploy-snapshotter) deploy_snapshotter ;;
run-tests) run_tests ;; run-tests) run_tests ;;
run-tests-kcli) run_tests "kcli" ;; run-tests-kcli) run_tests "kcli" ;;
cleanup-kcli) cleanup "kcli" ;; cleanup-kcli) cleanup "kcli" ;;
@ -275,6 +288,7 @@ function main() {
cleanup-tdx) cleanup "tdx" ;; cleanup-tdx) cleanup "tdx" ;;
cleanup-garm) cleanup "garm" ;; cleanup-garm) cleanup "garm" ;;
cleanup-zvsi) cleanup "zvsi" ;; cleanup-zvsi) cleanup "zvsi" ;;
cleanup-snapshotter) cleanup_snapshotter ;;
delete-cluster) cleanup "aks" ;; delete-cluster) cleanup "aks" ;;
delete-cluster-kcli) delete_cluster_kcli ;; delete-cluster-kcli) delete_cluster_kcli ;;
*) >&2 echo "Invalid argument"; exit 2 ;; *) >&2 echo "Invalid argument"; exit 2 ;;