From c67e7ed15ede7e3d387dca82c06845f0c0e332f9 Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Thu, 6 Oct 2016 14:29:23 -0700 Subject: [PATCH 01/16] Generate ssh-hostkeys on boot for ironic agent Ironic agent images should have ssh hostkeys in image on boot. Change-Id: If8d42bb8b8bff417d5b1d4d8bc371425697edde5 Closes-Bug: #1556145 --- elements/ironic-agent/element-deps | 1 + 1 file changed, 1 insertion(+) diff --git a/elements/ironic-agent/element-deps b/elements/ironic-agent/element-deps index 27cda407b..39d864612 100644 --- a/elements/ironic-agent/element-deps +++ b/elements/ironic-agent/element-deps @@ -3,5 +3,6 @@ no-final-image package-installs pip-and-virtualenv pkg-map +runtime-ssh-host-keys source-repositories svc-map From 3417bd6298f6121deddfa25005e9bcdaf100bde6 Mon Sep 17 00:00:00 2001 From: Saverio Proto Date: Mon, 12 Dec 2016 18:05:36 +0100 Subject: [PATCH 02/16] Support sysv init system used by Debian Wheezy Change-Id: Ia6ca11ab78f16a51aba7b627c72c615c184d338d --- .../openssh-server/post-install.d/80-enable-sshd-service | 6 +++++- elements/runtime-ssh-host-keys/post-install.d/80-ssh-keygen | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/elements/openssh-server/post-install.d/80-enable-sshd-service b/elements/openssh-server/post-install.d/80-enable-sshd-service index 50238bbcc..ee59b3a41 100755 --- a/elements/openssh-server/post-install.d/80-enable-sshd-service +++ b/elements/openssh-server/post-install.d/80-enable-sshd-service @@ -22,8 +22,12 @@ case "$DIB_INIT_SYSTEM" in # let dib-init-system's postinstall handle enabling init scripts exit 0 ;; + sysv) + # ssh is enabled by default, nothing to do + exit 0 + ;; *) - echo "Unsupported init system" + echo "Unsupported init system $DIB_INIT_SYSTEM" exit 1 ;; esac diff --git a/elements/runtime-ssh-host-keys/post-install.d/80-ssh-keygen b/elements/runtime-ssh-host-keys/post-install.d/80-ssh-keygen index 926a12d69..48a844485 100755 --- a/elements/runtime-ssh-host-keys/post-install.d/80-ssh-keygen +++ b/elements/runtime-ssh-host-keys/post-install.d/80-ssh-keygen @@ -24,8 +24,12 @@ case "$DIB_INIT_SYSTEM" in # let dib-init-system's postinstall handle enabling init scripts exit 0 ;; + sysv) + # nothing to do + exit 0 + ;; *) - echo "Unsupported init system" + echo "Unsupported init system $DIB_INIT_SYSTEM" exit 1 ;; esac From 9d7725b47585edf4d2276b18fd68e4ea53c46387 Mon Sep 17 00:00:00 2001 From: Mikhail S Medvedev Date: Thu, 15 Dec 2016 17:58:14 -0600 Subject: [PATCH 03/16] Fix bootloader element on ppc For some reason [1] introduced -m option without ever checking that the mapping exists. Because there is no grub-ieee1275 mapping anywhere (not in base, not in bootloader), pkg-map fails. So stop using the mapping in package-install of grub-ieee1275 on ppc. There is another patch that tries to solve the same bug by adding the mapping [2]. I think it is better to undo the breakage introduced in [1] first, and then, if various distributions have differing names for the package, introduce various mappings. My reasoning is that at the moment this element is broken for all ppc64 distributions. This patch would fix it for some (namely, Ubuntu). Then we can add mappings as tests are done for other distributions. [1] Ibca43173c30c2a74a73a2e2d9dd6d6d832c62694 [2] Id2b0f63a7015f883070fd59b79fd96a1c024858a Change-Id: I8425876c26e9e416c8ce2f53a4e38d26b4208633 Closes-Bug: #1624021 --- elements/bootloader/finalise.d/50-bootloader | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elements/bootloader/finalise.d/50-bootloader b/elements/bootloader/finalise.d/50-bootloader index b64f4e7df..1b479d46f 100755 --- a/elements/bootloader/finalise.d/50-bootloader +++ b/elements/bootloader/finalise.d/50-bootloader @@ -59,7 +59,7 @@ function install_grub2 { if [ -f "/tmp/grub/install" ] ; then source /tmp/grub/install elif [[ "$ARCH" =~ "ppc" ]]; then - install-packages -m bootloader grub-ieee1275 + install-packages grub-ieee1275 else install-packages -m bootloader grub-pc fi From ba93e6314501697024d3f17d4cc339387ecf4617 Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Sat, 17 Dec 2016 11:51:32 +0800 Subject: [PATCH 04/16] FIx the DIB_CLOUD_INIT_ALLOW_SSH_PWAUTH variable name in README file DIB_CLOUD_INIT_ALLOW_SSH_PWAUTH is the correct one. Change-Id: I3813cadf21327fcc8d960deb43df2309d812a05a --- elements/cloud-init/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elements/cloud-init/README.rst b/elements/cloud-init/README.rst index e76e956bf..707823e48 100644 --- a/elements/cloud-init/README.rst +++ b/elements/cloud-init/README.rst @@ -10,7 +10,7 @@ Currently only supports Gentoo. Environment Variables --------------------- -DIB_CLOUD_INIT_ALLOW_PASS_AUTH +DIB_CLOUD_INIT_ALLOW_SSH_PWAUTH :Required: No :Default: password authentication disabled when cloud-init installed :Description: customize cloud-init to allow ssh password From 54f4e127654e1adabaebbe37f943b0ca45ea47c8 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 9 Dec 2016 11:33:56 +0100 Subject: [PATCH 05/16] Switch to openSUSE Leap 42.2 release by default openSUSE 13.1 was discontinued on Feb 3rd, 2016, so defaulting to it doesn't make sense (see https://en.opensuse.org/Lifetime). Leap 42.2 is the most current release that is supported by disk-image-builder and being tested in a 3rd party ci. Enable functests for it to ensure we're not regressing again. Moved to non-voting gate first. Depends-On: Iff495b3cd0b6c3558c44cf4883651eca67b572d6 Change-Id: Iae6cd34a5853f1e309861c554d94d8595cbd9993 --- elements/opensuse-minimal/README.rst | 2 +- .../opensuse-minimal/environment.d/10-opensuse-distro-name.bash | 2 +- elements/opensuse/README.rst | 2 +- elements/opensuse/environment.d/10-opensuse-distro-name.bash | 2 +- elements/opensuse/test-elements/build-succeeds/README.rst | 1 + elements/zypper-minimal/root.d/08-zypper-chroot | 2 +- tests/run_functests.sh | 1 + 7 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 elements/opensuse/test-elements/build-succeeds/README.rst diff --git a/elements/opensuse-minimal/README.rst b/elements/opensuse-minimal/README.rst index 46df3c17c..7abe6e5b9 100644 --- a/elements/opensuse-minimal/README.rst +++ b/elements/opensuse-minimal/README.rst @@ -13,7 +13,7 @@ Environment Variables DIB_RELEASE :Required: No - :Default: 42.1 + :Default: 42.2 :Description: Set the desired openSUSE release. DIB_OPENSUSE_MIRROR: diff --git a/elements/opensuse-minimal/environment.d/10-opensuse-distro-name.bash b/elements/opensuse-minimal/environment.d/10-opensuse-distro-name.bash index c6aafbbc2..db0f47566 100644 --- a/elements/opensuse-minimal/environment.d/10-opensuse-distro-name.bash +++ b/elements/opensuse-minimal/environment.d/10-opensuse-distro-name.bash @@ -1,5 +1,5 @@ export DISTRO_NAME=opensuse -DIB_RELEASE=${DIB_RELEASE:-42.1} +DIB_RELEASE=${DIB_RELEASE:-42.2} export DIB_RELEASE=${DIB_RELEASE,,} export DIB_OPENSUSE_MIRROR=${DIB_OPENSUSE_MIRROR:-http://download.opensuse.org} case ${DIB_RELEASE} in diff --git a/elements/opensuse/README.rst b/elements/opensuse/README.rst index 5ca0da5e4..287f7db2e 100644 --- a/elements/opensuse/README.rst +++ b/elements/opensuse/README.rst @@ -18,7 +18,7 @@ Environment Variables DIB_RELEASE :Required: No - :Default: 13.1 + :Default: 42.2 :Description: Set the desired openSUSE release. DIB_CLOUD_IMAGES diff --git a/elements/opensuse/environment.d/10-opensuse-distro-name.bash b/elements/opensuse/environment.d/10-opensuse-distro-name.bash index 38efb86fc..a9d195eb1 100644 --- a/elements/opensuse/environment.d/10-opensuse-distro-name.bash +++ b/elements/opensuse/environment.d/10-opensuse-distro-name.bash @@ -1,5 +1,5 @@ export DISTRO_NAME=opensuse -export DIB_RELEASE=${DIB_RELEASE:-13.1} +export DIB_RELEASE=${DIB_RELEASE:-42.2} case ${DIB_RELEASE} in # Old openSUSE releases 13*) export OPENSUSE_REPO_DIR=openSUSE_${DIB_RELEASE} ;; diff --git a/elements/opensuse/test-elements/build-succeeds/README.rst b/elements/opensuse/test-elements/build-succeeds/README.rst new file mode 100644 index 000000000..49ba1444a --- /dev/null +++ b/elements/opensuse/test-elements/build-succeeds/README.rst @@ -0,0 +1 @@ +Verify we can build an openSUSE image. diff --git a/elements/zypper-minimal/root.d/08-zypper-chroot b/elements/zypper-minimal/root.d/08-zypper-chroot index 7e4b22d08..81d491761 100755 --- a/elements/zypper-minimal/root.d/08-zypper-chroot +++ b/elements/zypper-minimal/root.d/08-zypper-chroot @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright 2016 SUSE Linux Products Gmb +# Copyright 2016 SUSE Linux GmbH # Copyright 2015 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may diff --git a/tests/run_functests.sh b/tests/run_functests.sh index 84b6d38e8..68c80b150 100755 --- a/tests/run_functests.sh +++ b/tests/run_functests.sh @@ -18,6 +18,7 @@ DEFAULT_SKIP_TESTS=( fedora/build-succeeds # in non-voting gentoo/build-succeeds + opensuse/build-succeeds # good to have the test case around - but because of changes # in testing does not work always. debian-minimal/testing-build-succeeds From da41ee6012b064aa6901c871a1104a3a3933117e Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Sat, 17 Dec 2016 16:41:14 -0500 Subject: [PATCH 06/16] Add output image format tgz support We now support tgz (tar.gz) as an output format. Change-Id: Iadec92f2f96c3f904f28bd49f87ffc7d48ef7bd7 Signed-off-by: Paul Belanger --- bin/disk-image-create | 6 +++++- doc/source/user_guide/building_an_image.rst | 1 + lib/img-functions | 3 +++ tests/run_output_format_test.sh | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/disk-image-create b/bin/disk-image-create index 943cf6c6d..eee85c011 100755 --- a/bin/disk-image-create +++ b/bin/disk-image-create @@ -102,7 +102,7 @@ function show_options () { echo "Options:" echo " -a i386|amd64|armhf -- set the architecture of the image(default amd64)" echo " -o imagename -- set the imagename of the output image file(default image)" - echo " -t qcow2,tar,vhd,docker,aci,raw -- set the image types of the output image files (default qcow2)" + echo " -t qcow2,tar,tgz,vhd,docker,aci,raw -- set the image types of the output image files (default qcow2)" echo " File types should be comma separated. VHD outputting requires the vhd-util" echo " executable be in your PATH. ACI outputting requires the ACI_MANIFEST " echo " environment variable be a path to a manifest file." @@ -258,6 +258,10 @@ for X in ${!IMAGE_TYPES[@]}; do exit 1 fi ;; + tgz) + # Force tar to be created. + IMAGE_TYPES+=('tar') + ;; vhd) if [ -z "$(which vhd-util)" ]; then echo "vhd output format specified but no vhd-util executable found." diff --git a/doc/source/user_guide/building_an_image.rst b/doc/source/user_guide/building_an_image.rst index 16dccc110..a401a96f6 100644 --- a/doc/source/user_guide/building_an_image.rst +++ b/doc/source/user_guide/building_an_image.rst @@ -51,6 +51,7 @@ formats are: * qcow2 * tar + * tgz * vhd * docker * raw diff --git a/lib/img-functions b/lib/img-functions index f64a95a53..6ba0dfe45 100644 --- a/lib/img-functions +++ b/lib/img-functions @@ -122,6 +122,9 @@ function compress_and_save_image () { fi if [ "$IMAGE_TYPE" = "raw" ]; then mv $TMP_IMAGE_PATH $1-new + elif [ "$IMAGE_TYPE" == "tgz" ]; then + gzip -9 < $IMAGE_NAME.tar > $1-new + rm $IMAGE_NAME.tar elif [ "$IMAGE_TYPE" == "vhd" ]; then cp $TMP_IMAGE_PATH $1-intermediate vhd-util convert -s 0 -t 1 -i $1-intermediate -o $1-intermediate diff --git a/tests/run_output_format_test.sh b/tests/run_output_format_test.sh index b2f435ad4..6d0f21c7f 100755 --- a/tests/run_output_format_test.sh +++ b/tests/run_output_format_test.sh @@ -59,7 +59,7 @@ function build_test_image() { fi } -test_formats="tar raw qcow2 docker aci" +test_formats="tar tgz raw qcow2 docker aci" for binary in qemu-img docker ; do if [ -z "$(which $binary)" ]; then echo "Warning: No $binary binary found, cowardly refusing to run tests." From 9d13084c4183b63587e1f5e4b03395a8df6538f6 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Sun, 18 Dec 2016 01:59:07 +0000 Subject: [PATCH 07/16] Add squashfs output image format The squashfs format brings a couple of advantages over the other formats. Image is often an order of magnitude smaller and it can be used natively, either as an initrd, either with loop mount. Change-Id: If72940b0c4dafb2504c52dd0429a8eb3f8305751 --- bin/disk-image-create | 14 ++++++++++++-- bindep.txt | 1 + doc/source/user_guide/building_an_image.rst | 1 + .../notes/squashfs-output-91c1f0dc37474d3c.yaml | 3 +++ tests/run_output_format_test.sh | 4 ++-- 5 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/squashfs-output-91c1f0dc37474d3c.yaml diff --git a/bin/disk-image-create b/bin/disk-image-create index eee85c011..e70bc94f1 100755 --- a/bin/disk-image-create +++ b/bin/disk-image-create @@ -102,7 +102,7 @@ function show_options () { echo "Options:" echo " -a i386|amd64|armhf -- set the architecture of the image(default amd64)" echo " -o imagename -- set the imagename of the output image file(default image)" - echo " -t qcow2,tar,tgz,vhd,docker,aci,raw -- set the image types of the output image files (default qcow2)" + echo " -t qcow2,tar,tgz,squashfs,vhd,docker,aci,raw -- set the image types of the output image files (default qcow2)" echo " File types should be comma separated. VHD outputting requires the vhd-util" echo " executable be in your PATH. ACI outputting requires the ACI_MANIFEST " echo " environment variable be a path to a manifest file." @@ -268,6 +268,12 @@ for X in ${!IMAGE_TYPES[@]}; do exit 1 fi ;; + squashfs) + if [ -z "$(which mksquashfs)" ]; then + echo "squashfs output format specified but no mksquashfs executable found." + exit 1 + fi + ;; docker) if [ -z "$(which docker)" ]; then echo "docker output format specified but no docker executable found." @@ -452,6 +458,10 @@ for X in ${!IMAGE_TYPES[@]} ; do fi sudo chown $USER: $IMAGE_NAME.${IMAGE_TYPES[$X]} unset IMAGE_TYPES[$X] + elif [ "${IMAGE_TYPES[$x]}" == "squashfs" ]; then + sudo mksquashfs ${TMP_BUILD_DIR}/mnt $IMAGE_NAME.squash -comp xz \ + -noappend -root-becomes ${TMP_BUILD_DIR}/mnt \ + -wildcards -e "proc/*" -e "sys/*" -no-recovery elif [ "${IMAGE_TYPES[$X]}" == "docker" ]; then sudo tar -C ${TMP_BUILD_DIR}/mnt -cf - --exclude ./sys \ --exclude ./proc --xattrs --xattrs-include=\* . \ @@ -476,7 +486,7 @@ if [[ (! $IMAGE_ELEMENT =~ no-final-image) && "$IS_RAMDISK" == "0" ]]; then # We have to do raw last because it is destructive if [ "$IMAGE_TYPE" = "raw" ]; then has_raw_type=1 - else + elif [ "$IMAGE_TYPE" != "squashfs" ]; then compress_and_save_image $IMAGE_NAME.$IMAGE_TYPE fi done diff --git a/bindep.txt b/bindep.txt index 4f9b42547..5a9c382ed 100644 --- a/bindep.txt +++ b/bindep.txt @@ -1,2 +1,3 @@ # This is a cross-platform list tracking distribution packages needed by tests; # see http://docs.openstack.org/infra/bindep/ for additional information. +squashfs-tools diff --git a/doc/source/user_guide/building_an_image.rst b/doc/source/user_guide/building_an_image.rst index a401a96f6..ebacfd9b4 100644 --- a/doc/source/user_guide/building_an_image.rst +++ b/doc/source/user_guide/building_an_image.rst @@ -52,6 +52,7 @@ formats are: * qcow2 * tar * tgz + * squashfs * vhd * docker * raw diff --git a/releasenotes/notes/squashfs-output-91c1f0dc37474d3c.yaml b/releasenotes/notes/squashfs-output-91c1f0dc37474d3c.yaml new file mode 100644 index 000000000..98b1c5a2b --- /dev/null +++ b/releasenotes/notes/squashfs-output-91c1f0dc37474d3c.yaml @@ -0,0 +1,3 @@ +--- +features: + - New squashfs image output format. diff --git a/tests/run_output_format_test.sh b/tests/run_output_format_test.sh index 6d0f21c7f..8f2e968ad 100755 --- a/tests/run_output_format_test.sh +++ b/tests/run_output_format_test.sh @@ -59,8 +59,8 @@ function build_test_image() { fi } -test_formats="tar tgz raw qcow2 docker aci" -for binary in qemu-img docker ; do +test_formats="tar tgz squashfs raw qcow2 docker aci" +for binary in qemu-img docker mksquashfs; do if [ -z "$(which $binary)" ]; then echo "Warning: No $binary binary found, cowardly refusing to run tests." exit 1 From 4789aa317e02995cfaddeaf548624df82813fb4f Mon Sep 17 00:00:00 2001 From: Noam Angel Date: Mon, 19 Dec 2016 09:26:42 +0200 Subject: [PATCH 08/16] set default DIB_PYTHON_VERSION=2 for rhel7 python 3 not exist on minimal/KVM guest image. set default python version 2 for rhel7 also. Change-Id: Icbc10e742da8dded25625a1eed0a79065702837d --- elements/dib-python/environment.d/50-dib-python-version | 2 ++ 1 file changed, 2 insertions(+) diff --git a/elements/dib-python/environment.d/50-dib-python-version b/elements/dib-python/environment.d/50-dib-python-version index 27331dbd6..58a5dc7a9 100644 --- a/elements/dib-python/environment.d/50-dib-python-version +++ b/elements/dib-python/environment.d/50-dib-python-version @@ -16,6 +16,8 @@ if [ -z "${DIB_PYTHON_VERSION:-}" ]; then DIB_PYTHON_VERSION=2 elif [ "$DISTRO_NAME" == "centos7" ]; then DIB_PYTHON_VERSION=2 + elif [ "$DISTRO_NAME" == "rhel7" ]; then + DIB_PYTHON_VERSION=2 elif [ "$DISTRO_NAME" == "opensuse" ]; then DIB_PYTHON_VERSION=2 fi From 7c4c304f8aee21cec8a98cf8eec55c0f2ff6cb4f Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Mon, 19 Dec 2016 18:51:55 +0000 Subject: [PATCH 09/16] Update our package classifiers Our setuptools action classifiers are woefully out of date, notably: we are no longer alpha and we support python3. Change-Id: I2425152129406e22073936275761bd5d850903fb --- setup.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 3b9368752..f352c6d81 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,10 +8,11 @@ author-email = openstack-dev@lists.openstack.org license: Apache License (2.0) home-page = http://docs.openstack.org/developer/diskimage-builder/ classifier = - Development Status :: 3 - Alpha + Development Status :: 5 - Production/Stable License :: OSI Approved :: Apache Software License Operating System :: POSIX :: Linux Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3 Environment :: Console [build_sphinx] From 54dd54d81d38a1f4e027aa68b3249130258e58cf Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Mon, 19 Dec 2016 23:21:24 +0000 Subject: [PATCH 10/16] Switch py34 tests to py35 Py35 is now commonly available on things like -infra test nodes, lets use that instead. Change-Id: I554ec84d709a9937df5ec3c2fa7eab8f158cf64e --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 605eeb397..16a7cf9ed 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py34,py27,pep8 +envlist = py35,py27,pep8 minversion = 1.6 skipsdist = True From 61087d33e9ef67f05ef4a3b0dfc90ab521604292 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 2 Dec 2016 14:08:06 +1100 Subject: [PATCH 11/16] Set grub timeout default Set the grub timeout to 5 seconds by default, and add notes on how to update this. This will stop infra having to carry an element that goes and rewrites the grub configuration. Change-Id: I556b3f48eff1b67ee8c4b9b64f749af95100fb99 --- elements/bootloader/README.rst | 15 +++++++++++---- elements/bootloader/finalise.d/50-bootloader | 1 + .../notes/grub-timeout-1cdd14a2b1467d89.yaml | 6 ++++++ 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/grub-timeout-1cdd14a2b1467d89.yaml diff --git a/elements/bootloader/README.rst b/elements/bootloader/README.rst index ecfefc428..86f759143 100644 --- a/elements/bootloader/README.rst +++ b/elements/bootloader/README.rst @@ -1,7 +1,14 @@ ========== bootloader ========== -Installs grub[2] on boot partition on the system. In case GRUB2 -is not available in the system, a fallback to Extlinux will happen. It's -also possible to enforce the use of Extlinux by exporting a DIB_EXTLINUX -variable to the environment. + +Installs ``grub[2]`` on boot partition on the system. In case GRUB2 is +not available in the system, a fallback to Extlinux will happen. It's +also possible to enforce the use of Extlinux by exporting a +``DIB_EXTLINUX`` variable to the environment. + +Arguments +========= + +* ``DIB_GRUB_TIMEOUT`` sets the ``grub`` menu timeout. It defaults to + 5 seconds. Set this to 0 (no timeout) for fast boot times. diff --git a/elements/bootloader/finalise.d/50-bootloader b/elements/bootloader/finalise.d/50-bootloader index 1b479d46f..fbf9e56c8 100755 --- a/elements/bootloader/finalise.d/50-bootloader +++ b/elements/bootloader/finalise.d/50-bootloader @@ -133,6 +133,7 @@ function install_grub2 { GRUB_CFG=/boot/grub/grub.cfg fi + echo "GRUB_TIMEOUT=${DIB_GRUB_TIMEOUT:-5}" >>/etc/default/grub echo 'GRUB_TERMINAL="serial console"' >>/etc/default/grub echo 'GRUB_GFXPAYLOAD_LINUX=text' >>/etc/default/grub echo 'GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200 no_timer_check"' >>/etc/default/grub diff --git a/releasenotes/notes/grub-timeout-1cdd14a2b1467d89.yaml b/releasenotes/notes/grub-timeout-1cdd14a2b1467d89.yaml new file mode 100644 index 000000000..cedbc2fd6 --- /dev/null +++ b/releasenotes/notes/grub-timeout-1cdd14a2b1467d89.yaml @@ -0,0 +1,6 @@ +--- +features: + - The ``bootloader`` element will explicitly set the timeout to + ``5`` seconds when using ``grub`` (previously this was undefined, + but platform defaults were usually 5 seconds). Set this to ``0`` + for faster boots. From d9dcb3fe99a4782b1cb4ddb9179a5e86ff73be96 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Fri, 16 Dec 2016 11:42:59 -0500 Subject: [PATCH 12/16] Increase func testing for ubuntu-minimal element Since we still run these 3 version of ubuntu-minimal elements in openstack-infra, also run functional testing for them. Trusty and xenial will be in voting gate, precise added as skipped for non-voting. Add the default skip/run status to the "-l" output just to confirm this too. Change-Id: Icfbfd0cb7d9acae824972474b77e2fe0486c4f69 Signed-off-by: Paul Belanger --- .../{build-succeeds => precise-build-succeeds}/README.rst | 0 .../environment.d/10-set-distro.bash | 1 + .../test-elements/trusty-build-succeeds/README.rst | 1 + .../environment.d/10-set-distro.bash | 1 + .../test-elements/xenial-build-succeeds/README.rst | 1 + .../environment.d/10-set-distro.bash | 1 + tests/run_functests.sh | 8 +++++++- 7 files changed, 12 insertions(+), 1 deletion(-) rename elements/ubuntu-minimal/test-elements/{build-succeeds => precise-build-succeeds}/README.rst (100%) create mode 100644 elements/ubuntu-minimal/test-elements/precise-build-succeeds/environment.d/10-set-distro.bash create mode 100644 elements/ubuntu-minimal/test-elements/trusty-build-succeeds/README.rst create mode 100644 elements/ubuntu-minimal/test-elements/trusty-build-succeeds/environment.d/10-set-distro.bash create mode 100644 elements/ubuntu-minimal/test-elements/xenial-build-succeeds/README.rst create mode 100644 elements/ubuntu-minimal/test-elements/xenial-build-succeeds/environment.d/10-set-distro.bash diff --git a/elements/ubuntu-minimal/test-elements/build-succeeds/README.rst b/elements/ubuntu-minimal/test-elements/precise-build-succeeds/README.rst similarity index 100% rename from elements/ubuntu-minimal/test-elements/build-succeeds/README.rst rename to elements/ubuntu-minimal/test-elements/precise-build-succeeds/README.rst diff --git a/elements/ubuntu-minimal/test-elements/precise-build-succeeds/environment.d/10-set-distro.bash b/elements/ubuntu-minimal/test-elements/precise-build-succeeds/environment.d/10-set-distro.bash new file mode 100644 index 000000000..3747859b1 --- /dev/null +++ b/elements/ubuntu-minimal/test-elements/precise-build-succeeds/environment.d/10-set-distro.bash @@ -0,0 +1 @@ +export DIB_RELEASE=precise diff --git a/elements/ubuntu-minimal/test-elements/trusty-build-succeeds/README.rst b/elements/ubuntu-minimal/test-elements/trusty-build-succeeds/README.rst new file mode 100644 index 000000000..b7190827e --- /dev/null +++ b/elements/ubuntu-minimal/test-elements/trusty-build-succeeds/README.rst @@ -0,0 +1 @@ +Verify we can build a ubuntu-minimal image. diff --git a/elements/ubuntu-minimal/test-elements/trusty-build-succeeds/environment.d/10-set-distro.bash b/elements/ubuntu-minimal/test-elements/trusty-build-succeeds/environment.d/10-set-distro.bash new file mode 100644 index 000000000..02d902a4b --- /dev/null +++ b/elements/ubuntu-minimal/test-elements/trusty-build-succeeds/environment.d/10-set-distro.bash @@ -0,0 +1 @@ +export DIB_RELEASE=trusty diff --git a/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/README.rst b/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/README.rst new file mode 100644 index 000000000..b7190827e --- /dev/null +++ b/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/README.rst @@ -0,0 +1 @@ +Verify we can build a ubuntu-minimal image. diff --git a/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/environment.d/10-set-distro.bash b/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/environment.d/10-set-distro.bash new file mode 100644 index 000000000..7cc2c8877 --- /dev/null +++ b/elements/ubuntu-minimal/test-elements/xenial-build-succeeds/environment.d/10-set-distro.bash @@ -0,0 +1 @@ +export DIB_RELEASE=xenial diff --git a/tests/run_functests.sh b/tests/run_functests.sh index 9c1e3ed48..36896e3cb 100755 --- a/tests/run_functests.sh +++ b/tests/run_functests.sh @@ -19,6 +19,7 @@ DEFAULT_SKIP_TESTS=( # in non-voting gentoo/build-succeeds opensuse/build-succeeds + ubuntu-minimal/precise-build-succeeds # good to have the test case around - but because of changes # in testing does not work always. debian-minimal/testing-build-succeeds @@ -194,7 +195,12 @@ while getopts ":hlj:t" opt; do echo "The available functional tests are:" echo for t in ${TESTS[@]}; do - echo " $t" + echo -n " $t" + if [[ " ${DEFAULT_SKIP_TESTS[@]} " =~ " ${t} " ]]; then + echo " [skip]" + else + echo " [run]" + fi done echo exit 0 From 9d9a1e3000b72a5ab2de0366d5068af89e252cd8 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Fri, 16 Dec 2016 12:30:10 -0500 Subject: [PATCH 13/16] Start func testing on centos-minimal again Because we run this image in openstack-infra, we want to increase our test coverage to help avoid potential breaks to our CI systems. Change-Id: I26405e3f7465654075278ec35b5e0da1338bb45e Signed-off-by: Paul Belanger --- tests/run_functests.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/run_functests.sh b/tests/run_functests.sh index 36896e3cb..14bd39654 100755 --- a/tests/run_functests.sh +++ b/tests/run_functests.sh @@ -7,6 +7,10 @@ BASE_DIR=$(cd $(dirname "$0")/.. && pwd) export DIB_ELEMENTS=$BASE_DIR/elements export DIB_CMD=$BASE_DIR/bin/disk-image-create +# Setup sane locale defaults, because this information is leaked into DIB. +export LANG=en_US.utf8 +export LC_ALL= + # # Default skip tests # @@ -23,8 +27,6 @@ DEFAULT_SKIP_TESTS=( # good to have the test case around - but because of changes # in testing does not work always. debian-minimal/testing-build-succeeds - # Currently failing due to bug in locale generation - centos-minimal/build-succeeds # No longer reasonable to test upstream (lacks a mirror in infra) centos/build-succeeds ) From 2978ff885b1084fee923be7efcac3524d6ee2b56 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 21 Dec 2016 05:11:07 +0000 Subject: [PATCH 14/16] Revert Xenial to Python 2 There are issues with pip packages and a python3 only Xenial systems. This is occuring after Ie609de51cc5fcde701296c9474e315981d9778a2. We believe the issue is with VIRTUAL_ENV being set within the chroot and messing up pip installs (Icdb769541eee9793f261b4b8ec563be76ee13fe2) but a full solution is not yet clear. For now, set Xenial to ensure we use python2. Install the package for the ubuntu element (75-debian-minimal-baseinstall will install python2 for the minimal elements). Change-Id: Id403919b0af93b375a900186c01a0d3a3bdfafea --- .../dib-python/environment.d/50-dib-python-version | 2 ++ elements/ubuntu/pre-install.d/00-install-python | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100755 elements/ubuntu/pre-install.d/00-install-python diff --git a/elements/dib-python/environment.d/50-dib-python-version b/elements/dib-python/environment.d/50-dib-python-version index 58a5dc7a9..783126e83 100644 --- a/elements/dib-python/environment.d/50-dib-python-version +++ b/elements/dib-python/environment.d/50-dib-python-version @@ -5,6 +5,8 @@ if [ -z "${DIB_PYTHON_VERSION:-}" ]; then DIB_PYTHON_VERSION=2 elif [ "$DIB_RELEASE" == "trusty" ]; then DIB_PYTHON_VERSION=2 + elif [ "$DIB_RELEASE" == "xenial" ]; then + DIB_PYTHON_VERSION=2 fi elif [ "$DISTRO_NAME" == "debian" ]; then DIB_PYTHON_VERSION=2 diff --git a/elements/ubuntu/pre-install.d/00-install-python b/elements/ubuntu/pre-install.d/00-install-python new file mode 100755 index 000000000..19ae8f66e --- /dev/null +++ b/elements/ubuntu/pre-install.d/00-install-python @@ -0,0 +1,10 @@ +#!/bin/bash +if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then + set -x +fi +set -eu +set -o pipefail + +# hack to get python into Xenial python3 only images, while we +# work-around issues. +apt-get -y install python || true From 54b2733ad8b5807fdae1267c5475d4a0fba38237 Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Wed, 21 Dec 2016 08:17:40 +0000 Subject: [PATCH 15/16] Dont run with VIRTUAL_ENV set debian ships a modified site.py which has some interesting behavior when VIRTUAL_ENV is set. In this case it will add /usr/lib/pythonx.x/site-packages to the start of sys.path. This causes pip to install packages to this location (rather than /usr/local). As a result, later on when booting where VIRTUAL_ENV is not set this branch is not hit and the path where python packages were installed is not part of sys.path. Change-Id: Icdb769541eee9793f261b4b8ec563be76ee13fe2 --- lib/img-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/img-functions b/lib/img-functions index 6ba0dfe45..d803cc81c 100644 --- a/lib/img-functions +++ b/lib/img-functions @@ -63,7 +63,7 @@ function run_in_target () { # Bug: #1330290 # Force the inclusion of a typical set of dirs in PATH, this is needed for guest # distros that have path elements not in the host PATH. - sudo -E chroot $TMP_MOUNT_PATH env -u TMPDIR PATH="\$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" sh -c "$cmd" + sudo -E chroot $TMP_MOUNT_PATH env -u TMPDIR -u VIRTUAL_ENV PATH="\$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" sh -c "$cmd" export HOME=$ORIG_HOME } From 7603f97cadbf92c79549547dabbe252650343cac Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Wed, 21 Dec 2016 17:39:27 +0000 Subject: [PATCH 16/16] Revert "Revert Xenial to Python 2" We landed the fix for this in Icdb769541eee9793f261b4b8ec563be76ee13fe2. This reverts commit 2978ff885b1084fee923be7efcac3524d6ee2b56. Change-Id: Iecfc41ab2aad57bc4f6f86a13810b534d19a8fd5 --- .../dib-python/environment.d/50-dib-python-version | 2 -- elements/ubuntu/pre-install.d/00-install-python | 10 ---------- 2 files changed, 12 deletions(-) delete mode 100755 elements/ubuntu/pre-install.d/00-install-python diff --git a/elements/dib-python/environment.d/50-dib-python-version b/elements/dib-python/environment.d/50-dib-python-version index 783126e83..58a5dc7a9 100644 --- a/elements/dib-python/environment.d/50-dib-python-version +++ b/elements/dib-python/environment.d/50-dib-python-version @@ -5,8 +5,6 @@ if [ -z "${DIB_PYTHON_VERSION:-}" ]; then DIB_PYTHON_VERSION=2 elif [ "$DIB_RELEASE" == "trusty" ]; then DIB_PYTHON_VERSION=2 - elif [ "$DIB_RELEASE" == "xenial" ]; then - DIB_PYTHON_VERSION=2 fi elif [ "$DISTRO_NAME" == "debian" ]; then DIB_PYTHON_VERSION=2 diff --git a/elements/ubuntu/pre-install.d/00-install-python b/elements/ubuntu/pre-install.d/00-install-python deleted file mode 100755 index 19ae8f66e..000000000 --- a/elements/ubuntu/pre-install.d/00-install-python +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then - set -x -fi -set -eu -set -o pipefail - -# hack to get python into Xenial python3 only images, while we -# work-around issues. -apt-get -y install python || true