mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-01 11:56:29 +00:00
tools: Add support for caching Firecracker artefacts
Let's add support for caching Firecracker artefacts that are generated using the kata-deploy local-build scripts. Right now those are not used, but we'll switch to using them very soon as part of upcoming changes of how we build the components we test in our CI. Fixes: #6480 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com> Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
This commit is contained in:
parent
6b1b424fc7
commit
762f9f4c3e
@ -18,6 +18,12 @@ cache_clh_artifacts() {
|
||||
create_cache_asset "${clh_tarball_name}" "${current_clh_version}" ""
|
||||
}
|
||||
|
||||
cache_firecracker_artifacts() {
|
||||
local fc_tarball_name="kata-static-firecracker.tar.xz"
|
||||
local current_fc_version="$(get_from_kata_deps "assets.hypervisor.firecracker.version")"
|
||||
create_cache_asset "${fc_tarball_name}" "${current_fc_version}" ""
|
||||
}
|
||||
|
||||
create_cache_asset() {
|
||||
local component_name="${1}"
|
||||
local component_version="${2}"
|
||||
@ -40,6 +46,7 @@ Usage: $0 "[options]"
|
||||
Builds the cache of several kata components.
|
||||
Options:
|
||||
-c Cloud hypervisor cache
|
||||
-F Firecracker cache
|
||||
-h Shows help
|
||||
EOF
|
||||
)"
|
||||
@ -47,13 +54,17 @@ EOF
|
||||
|
||||
main() {
|
||||
local cloud_hypervisor_component="${cloud_hypervisor_component:-}"
|
||||
local firecracker_component="${firecracker_component:-}"
|
||||
local OPTIND
|
||||
while getopts ":ch:" opt
|
||||
while getopts ":cFh:" opt
|
||||
do
|
||||
case "$opt" in
|
||||
c)
|
||||
cloud_hypervisor_component="1"
|
||||
;;
|
||||
F)
|
||||
firecracker_component="1"
|
||||
;;
|
||||
h)
|
||||
help
|
||||
exit 0;
|
||||
@ -68,6 +79,7 @@ main() {
|
||||
shift $((OPTIND-1))
|
||||
|
||||
[[ -z "${cloud_hypervisor_component}" ]] && \
|
||||
[[ -z "${firecracker_component}" ]] && \
|
||||
help && die "Must choose at least one option"
|
||||
|
||||
mkdir -p "${WORKSPACE}/artifacts"
|
||||
@ -75,6 +87,7 @@ main() {
|
||||
echo "Artifacts:"
|
||||
|
||||
[ "${cloud_hypervisor_component}" == "1" ] && cache_clh_artifacts
|
||||
[ "${firecracker_component}" == "1" ] && cache_firecracker_artifacts
|
||||
|
||||
ls -la "${WORKSPACE}/artifacts/"
|
||||
popd
|
||||
|
Loading…
Reference in New Issue
Block a user