diff --git a/integration/scripts/files/elements/guest-agent/element-deps b/integration/scripts/files/elements/guest-agent/element-deps index ef30983797..6dcd66dc2b 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 37e7daa4b3..1cf7179f26 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 227c508db1..35446f00ae 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 44041384a4..5b8fe7fc96 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 12ff4f20db..aa88f55980 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 - - export DIB_RELEASE=${guest_release} - export DIB_CLOUD_INIT_DATASOURCES="ConfigDrive" - export DIB_CLOUD_INIT_ETC_HOSTS="localhost" - - # 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}]} - TEMP=$(mktemp -d ${working_dir}/diskimage-create.XXXXXXX) pushd $TEMP > /dev/null - elementes="$elementes ${guest_os}" + # Prepare elements for diskimage-builder + export DIB_CLOUD_INIT_ETC_HOSTS="localhost" + local elementes="base vm" + + # 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 + + export DIB_CLOUD_INIT_DATASOURCES=${DIB_CLOUD_INIT_DATASOURCES:-"ConfigDrive"} + elementes="$elementes cloud-init-datasources" + elementes="$elementes pip-and-virtualenv" elementes="$elementes pip-cache" elementes="$elementes guest-agent"