summaryrefslogtreecommitdiff
path: root/integration
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-11-29 10:49:01 +0000
committerGerrit Code Review <review@openstack.org>2020-11-29 10:49:01 +0000
commit774cb6667169105cd68cb844565e8ba965bc225d (patch)
tree5bf75b3b09d33c46d59a383f22d037c2e07a51e8 /integration
parent0c31076fe5631a30fbcb7d87fe83f0c14fbf237f (diff)
parenta97ff84c19580a9d6e3d393a33ee773ac4ecf3c8 (diff)
downloadtrove-774cb6667169105cd68cb844565e8ba965bc225d.tar.gz
Merge "Improve trove guest image build script"
Diffstat (limited to 'integration')
-rw-r--r--integration/scripts/files/elements/guest-agent/element-deps1
-rw-r--r--integration/scripts/files/elements/guest-agent/package-installs.yaml35
-rwxr-xr-xintegration/scripts/files/elements/guest-agent/post-install.d/99-clean-apt2
-rwxr-xr-xintegration/scripts/files/elements/ubuntu-docker/install.d/21-docker1
-rw-r--r--integration/scripts/functions_qemu44
5 files changed, 58 insertions, 25 deletions
diff --git a/integration/scripts/files/elements/guest-agent/element-deps b/integration/scripts/files/elements/guest-agent/element-deps
index ef309837..6dcd66dc 100644
--- a/integration/scripts/files/elements/guest-agent/element-deps
+++ b/integration/scripts/files/elements/guest-agent/element-deps
@@ -4,4 +4,3 @@ pkg-map
source-repositories
svc-map
pip-and-virtualenv
-ubuntu-docker
diff --git a/integration/scripts/files/elements/guest-agent/package-installs.yaml b/integration/scripts/files/elements/guest-agent/package-installs.yaml
index 37e7daa4..1cf7179f 100644
--- a/integration/scripts/files/elements/guest-agent/package-installs.yaml
+++ b/integration/scripts/files/elements/guest-agent/package-installs.yaml
@@ -1,15 +1,42 @@
guest-agent:
installtype: package
+acl:
+acpid:
+ arch: i386, amd64, arm64, s390x
+apparmor:
+apt-transport-https:
build-essential:
-python3-all:
-python3-all-dev:
-python3-pip:
-python3-sqlalchemy:
+cloud-guest-utils:
+cloud-init:
+cron:
+dbus:
+dkms:
+dmeventd:
+ethtool:
+gpg-agent:
+ifenslave:
+ifupdown:
+iptables:
+isc-dhcp-client:
libxml2-dev:
libxslt1-dev:
libffi-dev:
libssl-dev:
libyaml-dev:
+less:
+logrotate:
+netbase:
+open-vm-tools:
+ arch: i386, amd64
openssh-client:
openssh-server:
+pollinate:
+psmisc:
+python3-sqlalchemy:
rsync:
+rsyslog:
+ubuntu-cloudimage-keyring:
+ureadahead:
+uuid-runtime:
+vim-tiny:
+vlan:
diff --git a/integration/scripts/files/elements/guest-agent/post-install.d/99-clean-apt b/integration/scripts/files/elements/guest-agent/post-install.d/99-clean-apt
index 227c508d..35446f00 100755
--- a/integration/scripts/files/elements/guest-agent/post-install.d/99-clean-apt
+++ b/integration/scripts/files/elements/guest-agent/post-install.d/99-clean-apt
@@ -6,4 +6,4 @@
set -e
set -o xtrace
-apt-get clean
+apt-get --assume-yes purge --auto-remove
diff --git a/integration/scripts/files/elements/ubuntu-docker/install.d/21-docker b/integration/scripts/files/elements/ubuntu-docker/install.d/21-docker
index 44041384..5b8fe7fc 100755
--- a/integration/scripts/files/elements/ubuntu-docker/install.d/21-docker
+++ b/integration/scripts/files/elements/ubuntu-docker/install.d/21-docker
@@ -14,6 +14,7 @@ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu ${DIB_RELEASE} stable"
apt-get update
apt-get install -y -qq docker-ce >/dev/null
+apt-get clean
echo "Adding ${GUEST_USERNAME} user to docker group"
usermod -aG docker ${GUEST_USERNAME}
diff --git a/integration/scripts/functions_qemu b/integration/scripts/functions_qemu
index 12ff4f20..aa88f559 100644
--- a/integration/scripts/functions_qemu
+++ b/integration/scripts/functions_qemu
@@ -15,8 +15,14 @@ function build_guest_image() {
local working_dir=$(dirname ${image_output})
local root_password=${TROVE_ROOT_PASSWORD}
- local elementes="base vm"
local trove_elements_path=${PATH_TROVE}/integration/scripts/files/elements
+ # For system-wide installs, DIB will automatically find the elements, so we only check local path
+ if [[ "${DIB_LOCAL_ELEMENTS_PATH}" ]]; then
+ export ELEMENTS_PATH=${trove_elements_path}:${DIB_LOCAL_ELEMENTS_PATH}
+ else
+ export ELEMENTS_PATH=${trove_elements_path}
+ fi
+
local GUEST_IMAGESIZE=${GUEST_IMAGESIZE:-3}
local GUEST_CACHEDIR=${GUEST_CACHEDIR:-"$HOME/.cache/image-create"}
sudo rm -rf ${GUEST_CACHEDIR}
@@ -33,29 +39,29 @@ function build_guest_image() {
manage_ssh_keys
fi
- # For system-wide installs, DIB will automatically find the elements, so we only check local path
- if [[ "${DIB_LOCAL_ELEMENTS_PATH}" ]]; then
- export ELEMENTS_PATH=${trove_elements_path}:${DIB_LOCAL_ELEMENTS_PATH}
- else
- export ELEMENTS_PATH=${trove_elements_path}
- fi
+ TEMP=$(mktemp -d ${working_dir}/diskimage-create.XXXXXXX)
+ pushd $TEMP > /dev/null
- export DIB_RELEASE=${guest_release}
- export DIB_CLOUD_INIT_DATASOURCES="ConfigDrive"
+ # Prepare elements for diskimage-builder
export DIB_CLOUD_INIT_ETC_HOSTS="localhost"
+ local elementes="base vm"
- # https://cloud-images.ubuntu.com/releases is more stable than the daily
- # builds (https://cloud-images.ubuntu.com/xenial/current/),
- # e.g. sometimes SHA256SUMS file is missing in the daily builds website.
- # Ref: diskimage_builder/elements/ubuntu/root.d/10-cache-ubuntu-tarball
- declare -A image_file_mapping=( ["xenial"]="ubuntu-16.04-server-cloudimg-amd64-root.tar.gz" ["bionic"]="ubuntu-18.04-server-cloudimg-amd64.squashfs" )
- export DIB_CLOUD_IMAGES="https://cloud-images.ubuntu.com/releases/${DIB_RELEASE}/release/"
- export BASE_IMAGE_FILE=${image_file_mapping[${DIB_RELEASE}]}
+ # Only support ubuntu at the moment.
+ if [[ "${guest_os}" == "ubuntu" ]]; then
+ export DIB_RELEASE=${guest_release}
+ # https://cloud-images.ubuntu.com/releases is more stable than the daily
+ # builds (https://cloud-images.ubuntu.com/xenial/current/),
+ # e.g. sometimes SHA256SUMS file is missing in the daily builds website.
+ # Ref: diskimage_builder/elements/ubuntu/root.d/10-cache-ubuntu-tarball
+ declare -A image_file_mapping=( ["xenial"]="ubuntu-16.04-server-cloudimg-amd64-root.tar.gz" ["bionic"]="ubuntu-18.04-server-cloudimg-amd64.squashfs" )
+ export DIB_CLOUD_IMAGES="https://cloud-images.ubuntu.com/releases/${DIB_RELEASE}/release/"
+ export BASE_IMAGE_FILE=${image_file_mapping[${DIB_RELEASE}]}
+ elementes="$elementes ubuntu-minimal"
+ fi
- TEMP=$(mktemp -d ${working_dir}/diskimage-create.XXXXXXX)
- pushd $TEMP > /dev/null
+ export DIB_CLOUD_INIT_DATASOURCES=${DIB_CLOUD_INIT_DATASOURCES:-"ConfigDrive"}
+ elementes="$elementes cloud-init-datasources"
- elementes="$elementes ${guest_os}"
elementes="$elementes pip-and-virtualenv"
elementes="$elementes pip-cache"
elementes="$elementes guest-agent"