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

@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# Build tools # Build tools
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
automake \ automake \
bash \ bash \
bc \ bc \
binutils \ binutils \
@ -31,13 +31,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
file \ file \
git \ git \
graphviz \ graphviz \
help2man \ help2man \
jq \ jq \
make \ make \
ncurses-dev \ ncurses-dev \
openssh-client \ openssh-client \
patch \ patch \
perl \ perl \
pigz \
python3 \ python3 \
python3-matplotlib \ python3-matplotlib \
python-is-python3 \ python-is-python3 \
@ -45,7 +46,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
rsync \ rsync \
skopeo \ skopeo \
sudo \ sudo \
texinfo \ texinfo \
unzip \ unzip \
vim \ vim \
wget \ wget \

View File

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