Merge pull request #5827 from GabyCT/topic/cachevirtofsdccc

CCv0: use virtiofsd cache
This commit is contained in:
GabyCT 2022-12-05 09:31:31 -06:00 committed by GitHub
commit 7830e94e8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View File

@ -236,10 +236,11 @@ install_cc_shimv2() {
# Install static CC virtiofsd asset
install_cc_virtiofsd() {
local virtiofsd_version="$(get_from_kata_deps "externals.virtiofsd.version")-$(get_from_kata_deps "externals.virtiofsd.toolchain")"
install_cached_component \
"virtiofsd" \
"${jenkins_url}/job/kata-containers-2.0-virtiofsd-cc-$(uname -m)/${cached_artifacts_path}" \
"$(get_from_kata_deps "assets.externals.virtiofsd.version")" \
"${virtiofsd_version}" \
"$(get_virtiofsd_image_name)" \
"${final_tarball_name}" \
"${final_tarball_path}" \

View File

@ -67,6 +67,13 @@ cache_firmware_artifacts() {
create_cache_asset "${firmware_tarball_name}" "${current_firmware_version}" "${current_firmware_image}"
}
cache_virtiofsd_artifacts() {
local virtiofsd_tarball_name="kata-static-cc-virtiofsd.tar.xz"
local current_virtiofsd_version="$(get_from_kata_deps "externals.virtiofsd.version")-$(get_from_kata_deps "externals.virtiofsd.toolchain")"
local current_virtiofsd_image="$(get_virtiofsd_image_name)"
create_cache_asset "${virtiofsd_tarball_name}" "${current_virtiofsd_version}" "${current_virtiofsd_image}"
}
create_cache_asset() {
local component_name="${1}"
local component_version="${2}"
@ -101,6 +108,7 @@ Usage: $0 "[options]"
* Requires FIRMWARE environment variable set, valid values are:
* tdvf
* td-shim
-v Virtiofsd cache
-h Shows help
EOF
)"
@ -111,8 +119,9 @@ main() {
local qemu_component="${qemu_component:-}"
local kernel_component="${kernel_component:-}"
local firmware_component="${firmware_component:-}"
local virtiofsd_component="${virtiofsd_component:-}"
local OPTIND
while getopts ":ckqfh:" opt
while getopts ":ckqfvh:" opt
do
case "$opt" in
c)
@ -127,6 +136,9 @@ main() {
f)
firmware_component="1"
;;
v)
virtiofsd_component="1"
;;
h)
help
exit 0;
@ -144,6 +156,7 @@ main() {
[[ -z "${kernel_component}" ]] && \
[[ -z "${qemu_component}" ]] && \
[[ -z "${firmware_component}" ]] && \
[[ -z "${virtiofsd_component}" ]] && \
help && die "Must choose at least one option"
mkdir -p "${WORKSPACE}/artifacts"
@ -154,6 +167,7 @@ main() {
[ "${kernel_component}" == "1" ] && cache_kernel_artifacts
[ "${qemu_component}" == "1" ] && cache_qemu_artifacts
[ "${firmware_component}" == "1" ] && cache_firmware_artifacts
[ "${virtiofsd_component}" == "1" ] && cache_virtiofsd_artifacts
ls -la "${WORKSPACE}/artifacts/"
popd