Merge pull request #6686 from sprt/sprt/mariner-ci

gha: Create Mariner host as part of k8s tests
This commit is contained in:
Fabiano Fidêncio
2023-05-27 05:34:28 +02:00
committed by GitHub
3 changed files with 33 additions and 2 deletions

View File

@@ -17,10 +17,15 @@ jobs:
strategy:
fail-fast: false
matrix:
host_os:
- ubuntu
vmm:
- clh
- dragonball
- qemu
include:
- host_os: cbl-mariner
vmm: clh
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@@ -46,7 +51,8 @@ jobs:
-n "${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-${{ matrix.vmm }}-amd64" \
-s "Standard_D4s_v5" \
--node-count 1 \
--generate-ssh-keys
--generate-ssh-keys \
${{ matrix.host_os == 'cbl-mariner' && '--os-sku mariner --workload-runtime KataMshvVmIsolation' }}
- name: Install `bats`
run: |
@@ -79,10 +85,11 @@ jobs:
sleep 240s
pushd tests/integration/kubernetes
sed -i -e 's|runtimeClassName: kata|runtimeClassName: kata-${{ matrix.vmm }}|' runtimeclass_workloads/*.yaml
bash setup.sh
bash run_kubernetes_tests.sh
popd
env:
KATA_HOST_OS: ${{ matrix.host_os }}
KATA_HYPERVISOR: ${{ matrix.vmm }}
- name: Delete AKS cluster

View File

@@ -54,6 +54,10 @@ else
)
fi
if [ ${KATA_HOST_OS} == "cbl-mariner" ]; then
exit 0
fi
# we may need to skip a few test cases when running on non-x86_64 arch
arch_config_file="${kubernetes_dir}/filter_out_per_arch/${TARGET_ARCH}.yaml"
if [ -f "${arch_config_file}" ]; then

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Copyright (c) 2023 Microsoft Corporation
#
# SPDX-License-Identifier: Apache-2.0
set -o errexit
set -o nounset
set -o pipefail
kubernetes_dir=$(dirname "$(readlink -f "$0")")
set_runtime_class() {
sed -i -e "s|runtimeClassName: kata|runtimeClassName: kata-${KATA_HYPERVISOR}|" ${kubernetes_dir}/runtimeclass_workloads/*.yaml
}
main() {
set_runtime_class
}
main "$@"