test/system: Drop extra pull when caching images
In 54a2ca1 image caching has been done by first pulling using Podman and
then moving the image from the local container store to a directory. The
pull to the local container store can be skipped and instead we can use
Skopeo to directly save the pulled image into a directory.
On my machine this reduced the time of the system test setup "test" by
about 50 seconds. This speed-up largely depends on the available network
connection, though.
This commit is contained in:
parent
f10fe7fbb2
commit
8f6deadaef
|
|
@ -75,7 +75,7 @@ function _clean_temporary_storage() {
|
|||
function _pull_and_cache_distro_image() {
|
||||
local num_of_retries=5
|
||||
local timeout=10
|
||||
local pulled=false
|
||||
local cached=false
|
||||
local distro
|
||||
local version
|
||||
local image
|
||||
|
|
@ -100,29 +100,23 @@ function _pull_and_cache_distro_image() {
|
|||
return 0
|
||||
fi
|
||||
|
||||
if [ ! -d ${IMAGE_CACHE_DIR} ]; then
|
||||
run mkdir -p ${IMAGE_CACHE_DIR}
|
||||
assert_success
|
||||
fi
|
||||
|
||||
for ((i = ${num_of_retries}; i > 0; i--)); do
|
||||
run $PODMAN pull ${image}
|
||||
run $SKOPEO copy --dest-compress docker://${image} dir:${IMAGE_CACHE_DIR}/${image_archive}
|
||||
|
||||
if [ "$status" -eq 0 ]; then
|
||||
pulled=true
|
||||
cached=true
|
||||
break
|
||||
fi
|
||||
|
||||
sleep $timeout
|
||||
done
|
||||
|
||||
if ! $pulled; then
|
||||
echo "Failed to pull image ${image}"
|
||||
assert_success
|
||||
fi
|
||||
|
||||
if [ ! -d ${IMAGE_CACHE_DIR} ]; then
|
||||
mkdir -p ${IMAGE_CACHE_DIR}
|
||||
fi
|
||||
|
||||
run $SKOPEO copy --dest-compress containers-storage:${image} dir:${IMAGE_CACHE_DIR}/${image_archive}
|
||||
|
||||
if [ "$status" -ne 0 ]; then
|
||||
if ! $cached; then
|
||||
echo "Failed to cache image ${image} to ${IMAGE_CACHE_DIR}/${image_archive}"
|
||||
assert_success
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in New Issue