Use gzip compression for OpenStack images

This change makes the Jenkins job output openstack images using gzip
compression format. This allows OpenStack users to directly consume images
by simply specifying the URL to the image. Glance will then download the
image, unarchive it and add it to it's catalogue.

Fixes #575

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2022-02-22 15:33:25 +00:00
parent 571de4064b
commit f0a535271c
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,2 @@
- Image compression format is now configurable. Supported formats are: bz2, gz, zip, none. Selecting the image format can now be done by passing the ```--image_compression_format``` option to ```image_to_vm.sh```
- The Jenkins ```vms.sh``` script sets the image compression format to ```gz``` for OpenStack images, which allows Glance to directly consume the images by simply passing in the URL of the image.

View File

@ -113,6 +113,12 @@ for FORMAT in ${FORMATS}; do
UPLOAD_ROOT=${UPLOAD_PRIVATE_ROOT}
fi
COMPRESSION_FORMAT="bz2"
if [[ "${FORMAT}" =~ ^(openstack|openstack_mini)$ ]];then
COMPRESSION_FORMAT="gz"
fi
script image_to_vm.sh \
--board="${BOARD}" \
--format="${FORMAT}" \
@ -124,6 +130,7 @@ for FORMAT in ${FORMATS}; do
--sign_digests="${SIGNING_USER}" \
--download_root="${DOWNLOAD_ROOT}" \
--upload_root="${UPLOAD_ROOT}" \
--image_compression_format="${COMPRESSION_FORMAT}"
--upload \
${PRIVATE_UPLOAD_OPT}
done