From 80e3a2d408c81757e03574723088587bf2950ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Sat, 15 Apr 2023 13:27:34 +0200 Subject: [PATCH 1/3] cache-components: Fix TDX QEMU caching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TDX QEMU caching is not working as expected, as we're checking for its version looking at "assets.hypervisor.${QEMU_FLAVOUR}.version", which is correct for standard QEMU. However, for TDX QEMU we should be checking for "assets.hypervisor.${QEMU_FLAVOUR}.tag" Fixes: #6668 Signed-off-by: Fabiano FidĂȘncio --- tools/packaging/static-build/cache_components_main.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/packaging/static-build/cache_components_main.sh b/tools/packaging/static-build/cache_components_main.sh index 804df1cbf4..656a906d89 100755 --- a/tools/packaging/static-build/cache_components_main.sh +++ b/tools/packaging/static-build/cache_components_main.sh @@ -53,6 +53,7 @@ cache_ovmf_artifacts() { cache_qemu_artifacts() { local qemu_tarball_name="kata-static-${QEMU_FLAVOUR}.tar.xz" local current_qemu_version=$(get_from_kata_deps "assets.hypervisor.${QEMU_FLAVOUR}.version") + [ -z "${current_qemu_version}" ] && current_qemu_version=$(get_from_kata_deps "assets.hypervisor.${QEMU_FLAVOUR}.tag") local qemu_sha=$(calc_qemu_files_sha256sum) local current_qemu_image="$(get_qemu_image_name)" create_cache_asset "${qemu_tarball_name}" "${current_qemu_version}-${qemu_sha}" "${current_qemu_image}" From 3fa0890e5e372dcc8006bf81267d65ea65407ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Sat, 15 Apr 2023 14:02:18 +0200 Subject: [PATCH 2/3] cache-components: Fix TDVF caching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TDVF caching is not working as the tarball name is incorrect. The result expected is kata-static-tdvf.tar.xz, but it's looking for kata-static-tdx.tar.xz. This happens as a logic to convert tdx -> tdvf has been added as part of the building scripts, but I missed doing this as part of the caching scripts. Fixes: #6669 Signed-off-by: Fabiano FidĂȘncio --- tools/packaging/static-build/cache_components_main.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/packaging/static-build/cache_components_main.sh b/tools/packaging/static-build/cache_components_main.sh index 656a906d89..0e8a0120f8 100755 --- a/tools/packaging/static-build/cache_components_main.sh +++ b/tools/packaging/static-build/cache_components_main.sh @@ -44,8 +44,9 @@ cache_nydus_artifacts() { } cache_ovmf_artifacts() { - local ovmf_tarball_name="kata-static-${OVMF_FLAVOUR}.tar.xz" local current_ovmf_version="$(get_from_kata_deps "externals.ovmf.${OVMF_FLAVOUR}.version")" + [ "${OVMF_FLAVOUR}" == "tdx" ] && OVMF_FLAVOUR="tdvf" + local ovmf_tarball_name="kata-static-${OVMF_FLAVOUR}.tar.xz" local current_ovmf_image="$(get_ovmf_image_name)" create_cache_asset "${ovmf_tarball_name}" "${current_ovmf_version}" "${current_ovmf_image}" } From a1272bcf1dd03e920db92d6e7666d8f31521842c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Sat, 15 Apr 2023 15:00:06 +0200 Subject: [PATCH 3/3] gha: tdx: Fix typo overlay -> overlays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The beauty of GHA not allowing us to easily test changes in the yaml files as part of the PR has hit us again. :-/ The correct path for the k3s deployment is tools/packaging/kata-deploy/kata-deploy/overlays/k3s instead of tools/packaging/kata-deploy/kata-deploy/overlay/k3s. Signed-off-by: Fabiano FidĂȘncio --- .github/workflows/run-k8s-tests-on-tdx.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-k8s-tests-on-tdx.yaml b/.github/workflows/run-k8s-tests-on-tdx.yaml index 4c38b9d234..1777a16c80 100644 --- a/.github/workflows/run-k8s-tests-on-tdx.yaml +++ b/.github/workflows/run-k8s-tests-on-tdx.yaml @@ -34,7 +34,7 @@ jobs: cat tools/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml | grep "${{ inputs.registry }}/${{ inputs.repo }}:${{ inputs.tag }}" || die "Failed to setup the tests image" kubectl apply -f tools/packaging/kata-deploy/kata-rbac/base/kata-rbac.yaml - kubectl apply -k tools/packaging/kata-deploy/kata-deploy/overlay/k3s + kubectl apply -k tools/packaging/kata-deploy/kata-deploy/overlays/k3s kubectl -n kube-system wait --timeout=10m --for=condition=Ready -l name=kata-deploy pod kubectl apply -f tools/packaging/kata-deploy/runtimeclasses/kata-runtimeClasses.yaml @@ -51,7 +51,7 @@ jobs: - name: Delete kata-deploy if: always() run: | - kubectl delete -k tools/packaging/kata-deploy/kata-deploy/overlay/k3s + kubectl delete -k tools/packaging/kata-deploy/kata-deploy/overlays/k3s kubectl -n kube-system wait --timeout=10m --for=delete -l name=kata-deploy pod sed -i -e "s|quay.io/kata-containers/kata-deploy:latest|${{ inputs.registry }}/${{ inputs.repo }}:${{ inputs.tag }}|g" tools/packaging/kata-deploy/kata-cleanup/base/kata-cleanup.yaml