mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-30 19:54:28 +01:00
packaging: Adding caching capability for SEV kernel and initrd
Cache and reuse initrd binary whenever possible. Fixes: #6176 Signed-off-by: Unmesh Deodhar <udeodhar@amd.com>
This commit is contained in:
committed by
Fabiano Fidêncio
parent
3e3a1bab70
commit
321b061a53
@@ -237,14 +237,20 @@ install_cc_image() {
|
||||
local component="rootfs-image"
|
||||
local root_hash_vanilla="root_hash_vanilla.txt"
|
||||
local root_hash_tdx=""
|
||||
local initramfs_last_commit=""
|
||||
if [ -n "${tee}" ]; then
|
||||
jenkins="${jenkins_url}/job/kata-containers-2.0-rootfs-image-${tee}-cc-$(uname -m)/${cached_artifacts_path}"
|
||||
if [ "${tee}" == "tdx" ]; then
|
||||
jenkins="${jenkins_url}/job/kata-containers-2.0-rootfs-image-${tee}-cc-$(uname -m)/${cached_artifacts_path}"
|
||||
component="${tee}-rootfs-image"
|
||||
root_hash_vanilla=""
|
||||
root_hash_tdx="root_hash_${tee}.txt"
|
||||
fi
|
||||
fi
|
||||
if [ "${tee}" == "sev" ]; then
|
||||
component="${tee}-rootfs-initrd"
|
||||
root_hash_vanilla=""
|
||||
initramfs_last_commit="$(get_initramfs_image_name)"
|
||||
fi
|
||||
fi
|
||||
|
||||
local osbuilder_last_commit="$(echo $(get_last_modification "${repo_root_dir}/tools/osbuilder") | sed s/-dirty//)"
|
||||
local guest_image_last_commit="$(get_last_modification "${repo_root_dir}/tools/packaging/guest-image")"
|
||||
@@ -259,7 +265,7 @@ install_cc_image() {
|
||||
install_cached_component \
|
||||
"${component}" \
|
||||
"${jenkins}" \
|
||||
"${osbuilder_last_commit}-${guest_image_last_commit}-${agent_last_commit}-${libs_last_commit}-${attestation_agent_version}-${gperf_version}-${libseccomp_version}-${pause_version}-${rust_version}-${image_type}-${AA_KBC}" \
|
||||
"${osbuilder_last_commit}-${guest_image_last_commit}$-${initramfs_last_commit}-${agent_last_commit}-${libs_last_commit}-${attestation_agent_version}-${gperf_version}-${libseccomp_version}-${pause_version}-${rust_version}-${image_type}-${AA_KBC}" \
|
||||
"" \
|
||||
"${final_tarball_name}" \
|
||||
"${final_tarball_path}" \
|
||||
|
||||
@@ -92,6 +92,7 @@ cache_rootfs_artifacts() {
|
||||
local rust_version="$(get_from_kata_deps "languages.rust.meta.newest-version")"
|
||||
local rootfs_tarball_name="kata-static-cc-rootfs-image.tar.xz"
|
||||
local aa_kbc="offline_fs_kbc"
|
||||
local initramfs_last_commit=""
|
||||
local image_type="image"
|
||||
local root_hash_vanilla="${repo_root_dir}/tools/osbuilder/root_hash_vanilla.txt"
|
||||
local root_hash_tdx=""
|
||||
@@ -103,8 +104,14 @@ cache_rootfs_artifacts() {
|
||||
root_hash_vanilla=""
|
||||
root_hash_tdx="${repo_root_dir}/tools/osbuilder/root_hash_tdx.txt"
|
||||
fi
|
||||
if [ "${TEE}" == "sev" ]; then
|
||||
rootfs_tarball_name="kata-static-cc-sev-rootfs-initrd.tar.xz"
|
||||
aa_kbc="online_sev_kbc"
|
||||
image_type="initrd"
|
||||
initramfs_last_commit="$(get_initramfs_image_name)"
|
||||
fi
|
||||
fi
|
||||
local current_rootfs_version="${osbuilder_last_commit}-${guest_image_last_commit}-${agent_last_commit}-${libs_last_commit}-${attestation_agent_version}-${gperf_version}-${libseccomp_version}-${pause_version}-${rust_version}-${image_type}-${aa_kbc}"
|
||||
local current_rootfs_version="${osbuilder_last_commit}-${guest_image_last_commit}-${initramfs_last_commit}-${agent_last_commit}-${libs_last_commit}-${attestation_agent_version}-${gperf_version}-${libseccomp_version}-${pause_version}-${rust_version}-${image_type}-${aa_kbc}"
|
||||
create_cache_asset "${rootfs_tarball_name}" "${current_rootfs_version}" "" "${root_hash_vanilla}" "${root_hash_tdx}"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user