Create VM image .zip files in parallel using pigz (#4067)

When creating OVA image, the CPU is slacking at the end of the build because it
is creating three ZIP archives, each one on a single CPU only. As we're
creating only single-entry archives, we can use pigz to use all cores.

The actual speedup on my machine (16C/32T) reflects the number of cores - it
takes around 2 seconds instead of 1 minute.
This commit is contained in:
Jan Čermák 2025-05-19 12:43:23 +02:00 committed by GitHub
parent 5ebc3a0761
commit 834c51ca84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -38,6 +38,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
openssh-client \
patch \
perl \
pigz \
python3 \
python3-matplotlib \
python-is-python3 \

View File

@ -100,5 +100,5 @@ function convert_disk_image_zip() {
hdd_img="$(hassos_image_name "${hdd_ext}")"
rm -f "${hdd_img}.zip"
zip -j -m -q -r "${hdd_img}.zip" "${hdd_img}"
pigz -q -K -S ".zip" "${hdd_img}"
}