From f92f97f53e3ee43c5d3b75673122ec9f94db196e Mon Sep 17 00:00:00 2001 From: mbeierl Date: Tue, 12 Sep 2017 16:34:24 -0400 Subject: Add Multi Arch to Docker Adds multi arch support to the launching of the containers. Change-Id: Iee89cfad3dc455fe8fdd7861d73fadbe314c2c1e JIRA: STORPERF-220 Signed-off-by: mbeierl --- ci/create_glance_image.sh | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'ci/create_glance_image.sh') diff --git a/ci/create_glance_image.sh b/ci/create_glance_image.sh index 8811897..e99de8c 100755 --- a/ci/create_glance_image.sh +++ b/ci/create_glance_image.sh @@ -8,13 +8,38 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -echo "Checking for Ubuntu 16.04 image in Glance" -IMAGE=`openstack image list | grep "Ubuntu 16.04 x86_64"` +ARCH="${ARCH:-$(uname -m)}" + +IMAGE_NAME="Ubuntu 16.04 ${ARCH}" + +echo "Checking for ${IMAGE_NAME} in Glance" + +IMAGE="$(openstack image list | grep "${IMAGE_NAME}")" +PROPERTIES="" if [ -z "$IMAGE" ] then - wget -q https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img - openstack image create "Ubuntu 16.04 x86_64" --disk-format qcow2 --public \ - --container-format bare --file ubuntu-16.04-server-cloudimg-amd64-disk1.img + + case "${ARCH}" in + aarch64) + FILE=ubuntu-16.04-server-cloudimg-arm64-uefi1.img + PROPERTIES="--property hw_firmware_type=uefi --property hw_video_model=vga" + ;; + armhf) + FILE=ubuntu-16.04-server-cloudimg-armhf-disk1.img + ;; + x86_64) + FILE=ubuntu-16.04-server-cloudimg-amd64-disk1.img + ;; + *) + echo "Unsupported architecture: ${ARCH}" + exit 1 + ;; + esac + + wget --continue -q "https://cloud-images.ubuntu.com/releases/16.04/release/${FILE}" + openstack image create "${IMAGE_NAME}" --disk-format qcow2 --public \ + ${PROPERTIES} \ + --container-format bare --file "${FILE}" fi -openstack image show "Ubuntu 16.04 x86_64" +openstack image show "${IMAGE_NAME}" -- cgit 1.2.3-korg