From 2213660bf3ecdb47111f8e3ad149a0674e522e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 25 Jul 2023 13:51:25 +0200 Subject: [PATCH 1/2] cc: cache: shim-v2: Allow root_hashes to be downloaded MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We should not return, in case cache is not used, before actually downloading the root_hash_*.txt provided by the other components, otherwise the job used to do the caching will always fail. Fixes: #7422 Signed-off-by: Fabiano FidĂȘncio --- .../kata-deploy/local-build/kata-deploy-binaries.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh index 17171e5a2e..386fdf1509 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh @@ -175,10 +175,6 @@ install_cached_cc_shim_v2() { ;; esac - if [ "${USE_CACHE}" != "yes" ]; then - return 1 - fi - local component="${1}" local jenkins_build_url="${2}" local current_version="${3}" @@ -222,6 +218,10 @@ install_cached_cc_shim_v2() { wget "${jenkins_build_url}/root_hash_tdx.txt" -O "shim_v2_root_hash_tdx.txt" || return 1 diff "${root_hash_tdx}" "shim_v2_root_hash_tdx.txt" > /dev/null || return 1 + if [ "${USE_CACHE}" != "yes" ]; then + return 1 + fi + install_cached_tarball_component \ "${component}" \ "${jenkins_build_url}" \ From ad8c96b6c07d8d910622ee15fe1e2b21aeb80683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Tue, 25 Jul 2023 18:26:55 +0200 Subject: [PATCH 2/2] cc: cache: Enable more cached components after rebuild was done MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's re-enabled caching for the following components, as those were rebuilt with the new prefix: * cc-rootfs-image * cc-rootfs-initrd * cc-tdx-rootfs-image * cc-tdx-td-shim * cc-sev-rootfs-initrd "cc-se-image" was part of the list, but we never had a target for it. Signed-off-by: Fabiano FidĂȘncio --- .../kata-deploy/local-build/kata-deploy-binaries.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh index 386fdf1509..4ee73d39f1 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh @@ -124,12 +124,6 @@ cleanup_and_fail() { } install_cached_tarball_component() { - case ${5} in - "kata-static-cc-rootfs-image.tar.xz" | "kata-static-cc-rootfs-initrd.tar.xz" | "kata-static-cc-se-image.tar.xz" | "kata-static-cc-tdx-rootfs-image.tar.xz" | "kata-static-cc-tdx-td-shim.tar.xz" | "kata-static-cc-sev-rootfs-initrd.tar.xz" ) - USE_CACHE="no" - ;; - esac - if [ "${USE_CACHE}" != "yes" ]; then return 1 fi