From f0a535271c285a83d6df1f42010170a13540d2e6 Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Tue, 22 Feb 2022 15:33:25 +0000 Subject: [PATCH] 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 --- .../changes/2022-02-22-configurable-image-compression.md | 2 ++ jenkins/vms.sh | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 changelog/changes/2022-02-22-configurable-image-compression.md diff --git a/changelog/changes/2022-02-22-configurable-image-compression.md b/changelog/changes/2022-02-22-configurable-image-compression.md new file mode 100644 index 0000000000..a06c7a31eb --- /dev/null +++ b/changelog/changes/2022-02-22-configurable-image-compression.md @@ -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. diff --git a/jenkins/vms.sh b/jenkins/vms.sh index 4beb63653e..06e3972eb2 100755 --- a/jenkins/vms.sh +++ b/jenkins/vms.sh @@ -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