Commit Graph

4303 Commits

Author SHA1 Message Date
Zuul
8690088ecd Merge "debian-minimal: remove old testing targets" 2022-01-27 23:53:26 +00:00
Zuul
6ca42f2a9d Merge "Add debian-bullseye-arm64 build test" 2022-01-27 23:49:09 +00:00
Ian Wienand
27feef8a26 debian-minimal: remove old testing targets
We've moved away from building "stable"/"testing" targets, as they
move over time so you never know what you're building.

These testing targets are unused, remove them to remove confusion.

Change-Id: I2a53f70ed07873b9a408972d2162b6c10b050db5
2022-01-25 15:54:39 +11:00
Ian Wienand
fa56c21109 Add debian-bullseye-arm64 build test
This does a basic vm build test of bullseye-arm64, which currently is
missing from the ARM64 testing.

To keep runtimes a bit more reasonable, split the job into two parts,
one for deb distros and one for rpm.

Change-Id: I0f28ff92e1b8d08d56b82b392e2cc355d567d007
2022-01-25 15:54:39 +11:00
Harald Jensås
e7c52139aa dhcp-all-interfaces: opt let NetworkManager doit.
NetworkManager is quite capable to do automatic
interface configuration. NetworkManager will by default
try to auto-configure any interface with no configuration.
It will use DHCP for IPv4 and Router Advertisements to
decide how to initialize IPv6.

It will most likely do it just as good, or better than the
dhcp-all-interfaces.sh script.

Since dhcp-all-interfaces clean out all ifcfg files in
60-remove-cloud-image-interfaces it means NetworkManager will
by default attempt auto configuration for all interfaces.

This change add's and environment variable:
  DIB_DHCP_NETWORK_MANAGER_AUTO (default: false)

When DIB_DHCP_NETWORK_MANAGER_AUTO is set to `true` only the
NetworkManager config will be written. The dhcp-all-interfaces
service will not be installed. Hence dhcp-all-interfaces will
not write any config files, allowing NetworkManager to just do
it's thing.

Change-Id: Id6f8d6aaaf52a78175bb6c065ec88274c364834e
2022-01-24 01:45:49 +01:00
Eduardo Santos
ca812ec5d7 Don't run functional tests on doc changes
Change-Id: I85f282c3d1ffa58f73f6c23871d970178fa1d586
2022-01-21 19:23:23 -03:00
Eduardo Santos
5779fa8525 General improvements to the ubuntu-minimal docs
This change:
- adds a note regarding an error when building focal ubuntu-minimal
  images on operating systems with older versions of debootstrap
- adds a reference to where the DIB_RELEASE variable definition can be
  found

Closes-Bug: #1941831
Change-Id: Ibc1e04dba0562c4f4909a8cb8af041d9b8ac45c4
2022-01-21 19:21:00 -03:00
Steve Baker
0d0f7f8075 Rename existing BLS entry with the new machine-id
This change replaces the call to grub2-switch-to-blscfg with a file
rename to update it to the actual machine-id.

grub2-switch-to-blscfg has issues in some build environments:
- When the build host is EFI boot, it assumes the image is, and
  fails when config file /etc/grub2-efi.cfg is missing
- With recent cento9 images and a fedora build host it fails with:
  grub2-probe: error: cannot find a device for / (is /dev mounted?)

Change-Id: I74ad800b702f2b491d958555cef8d7c7f63d74ac
2022-01-21 15:36:49 +13:00
Zuul
3df51c5279 Merge "Fixes for centos-9-stream efi behaviour" 2022-01-19 21:27:14 +00:00
Harald Jensås
9c5f5a56d4 Remove centos 9 and rhel 8 block in grub2 pkg-map
In the grub2 element the grub2-efi-x64-modules package
is missing in the centos 9 section, this cause a failure
because grub2 cannot find the neccecary files when
installing the bootloader on EFI systems.

It seems grub2-efi-x64-modules was not included in release
9, this is likely why the block was added initially without
this package. Since it is now there, the Centos 9 specific
block is no longer needed.

Removing the rhel 8 block as well, as it is identical to the
family "redhat" block i.e it is redundant.

Closes-Bug: #1957169
Change-Id: Ia6b0ecf0cd15fb23c6740543940ee513a8602afe
2022-01-17 23:40:24 +01:00
Steve Baker
a2cc17ad75 Fixes for centos-9-stream efi behaviour
This change removes the uninstall grub2-efi which was required for
prerelease rhel-9 images but now breaks current centos-9-stream
images. A different approach may be required for rhel-9 if the base
image remains different to centos-9-stream (such as populating the
empty /boot/efi partition from the base image)

This change also fixes the detection of whether this is an efi build
to check the block device instead of checking for whether a grub efi
package is installed. This fixes building a centos-9-stream whole-disk
image when package grub2-efi-x64 is installed but a legacy fallback
grub also needs to be installed.

Change-Id: I24baf553e1acd15a66737fc0b2a79d5335e28aa5
Partial-Bug: #1957789
2022-01-18 09:22:33 +13:00
Zuul
bef53f2674 Merge "enable cloud-init by default on systemd" 2022-01-14 19:47:41 +00:00
Steve Baker
9a7c107741 Use https for base centos image download
Change-Id: I85879ad784995405a1fa9fe8178e1b1d53d9e41a
2022-01-14 10:00:15 +13:00
Zuul
a32b969d95 Merge "Bump Ubuntu release to focal" 2022-01-11 11:21:13 +00:00
Zuul
83bbac0c2b Merge "centos: work around 9-stream BLS issues" 2022-01-11 09:38:35 +00:00
Chandan Kumar (raukadah)
e5617355fa Remove opensuse related funtests
https://zuul.opendev.org/t/openstack/builds?job_name=dib-functests&project=openstack/diskimage-builder
is currently broken and is not actively maintained.

In order to get other DIB patches in, It removes the
testing of opensuse element.

Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
Change-Id: I7ff67208f24369944106a7fed59487f0fcab0ecb
2022-01-10 21:45:23 +05:30
Dr. Jens Harbott
9d60202d1c Remove extra if/then/else construct in pip element
This was introduced in [0] but we can include it in the existing elif
series instead.

[0] I2b75afd310f009ae8614f6ca75bb984b56d25c45

Change-Id: Ibe05f367be997efbd8c5ebec77503ebd9cda1c8b
2021-12-29 16:43:00 +01:00
Ian Wienand
53d04d27c6 centos: work around 9-stream BLS issues
Per the bug mentioned upstream, grub2-mkconfig will currently not set
the kernel options for BLS entries prefixed with a machine-id
different to the running system.

This affects the centos element, as the upstream .qcow2 comes with a
pre-existing BLS entry but a blank machine-id.  This only affects
9-stream -- prior releases either don't use BLS or have entries
configured to use a common variable from grubenv which is updated
correctly.

We currently can not end-to-end test this in OpenDev because we run
our functional tests on Ubuntu Focal (they use devstack), whose kernel
can not read the XFS format on the 9-stream .qcow2.  This expands the
functional tests (that run on Debian Buster, with a later kernel) to
add the vm element, so the bootloader path is exercised (this requires
a block-device too).  This at least runs the bootloader install, we
can confirm the kernel options look right from the dumping provided
the logs.

Change-Id: I327f5e7a95e47905c01138c8c4483f3f03e8efff
2021-12-22 21:07:23 +11:00
Riccardo Pittau
f576658a4f Avoid unbound variable error when installing pip
The pip_args variable is not initialized when installing pip for
bullseye resulting in an unbound variable error when running
install_python3_pip on that debian version.
This patch fixes the issue moving pip_args inizialization to a common
place.

Change-Id: I1603c97871449b4f73e3062a705d655e9454bf33
2021-12-20 16:06:44 +01:00
Matthew Thode
902b7454c3
enable cloud-init by default on systemd
Change-Id: Ie908f7c5b9ea2c1b97daf149ef70f4c68ddf73a0
Signed-off-by: Matthew Thode <mthode@mthode.org>
2021-12-18 17:51:18 -06:00
Dr. Jens Harbott
f884b626b2 Fix failure in pip element
A lack of space between package names was causing apt to fail.

[0] I2b75afd310f009ae8614f6ca75bb984b56d25c45

Change-Id: Ia7e005c2f583037ee44a3c364e3b8d79d51e03a2
2021-12-18 12:44:34 +01:00
Zuul
6ae099f464 Merge "Install only python3 pip in debian bullseye" 2021-12-16 06:36:19 +00:00
Riccardo Pittau
4f151aeeb5 Install only python3 pip in debian bullseye
Debian bullseye has removed python-pip and python-virtualenv
from its repos, let's install only pip and virtualenv python3 modules.

Also split pip installation based on python2 and python3 for
debian-based distributions.

Change-Id: I2b75afd310f009ae8614f6ca75bb984b56d25c45
2021-12-10 15:11:17 +01:00
Ian Wienand
0bf80735a7 Use OpenDev mirrors for 8-stream CI builds
Change-Id: Ief335cf80fb5d796f6c31f6956e9bc5f790eca93
2021-12-10 17:26:34 +11:00
Ian Wienand
402a7fa2f9 Test 8-stream aarch64 build
Change-Id: I1aea7791b5b9af257a3c54e377dbdcbb8bfe9028
2021-12-08 13:30:42 +11:00
Zuul
a2b8d4d846 Merge "Update keylime-agent and tpm-emulator elements" 2021-12-07 04:29:36 +00:00
Zuul
b22161c116 Merge "Disable all repositories after attaching a pool" 2021-12-06 20:19:59 +00:00
Zuul
86e3d632fa Merge "Document EFI elements requirements" 2021-12-06 19:58:16 +00:00
Piotr Parczewski
f49dba8f62 Document EFI elements requirements
Change-Id: I6b47d44c86a11dfc71b7adf0d9bb27f5177717cb
2021-11-26 08:46:42 +01:00
Ian Wienand
2d47d4157c Fix BLS based bootloader installation
This reverts I2701260d54cf6bc79f1ac765b512d99d799e8c43,
Idf2a471453c5490d927979fb97aa916418172153 and part of
Iecf7f7e4c992bb23437b6461cdd04cdca96aafa6 which added special flags to
update kernels via grubby.

These changes actually ended up reverting the behaviour on Fedora 35,
which is what led me to investigate what was going on more fully.

All distros still support setting GRUB_DEVICE in /etc/default/grub;
even the BLS based ones (i.e. everything !centos7).

The implementation *is* confusing -- in earlier distros each BLS entry
would refer to the variable $kernelopts; which grub2-mkconfig would
write into /boot/grub2/grubenv.  After commit [1] this was reverted,
and the kernel options are directly written into the BLS entry.

But the real problem is this bit from [2]

 get_sorted_bls()
 {
     if ! [ -d "${blsdir}" ] || ! [ -e /etc/machine-id ]; then
        return
     fi
     ...
     files=($(for bls in ${blsdir}/${machine_id}-*.conf; do
     ...
 }

i.e., to avoid overwriting BLS entries for other OS-boots (?),
grub2-mkconfig will only update those BLS entries that match the
current machine-id.

The problem for DIB is that we are clearing the machine-id early in
finalise.d/01-clear-machine-id, but then running the bootloader update
later in finalise.d/50-bootloader.

The result is that the bootloader entry generated when we installed
the kernel (which guessed at the root= device, etc.) is *not* updated.
Even more annoyingly, the gate doesn't pick this up -- because the
gate tests run on a DIB image that was booted with
"root=LABEL=cloudimg-rootfs" the kernel initially installed with
"install-kernel" (that we never updated) is actually correct.  But
this fails when built on a production host.

Thus we don't need any of the explicit grubby updates; these are
reverted here.  This moves the machine-id clearing to after the
bootloader setup, which allows grub2-mkconfig to setup the BLS entries
correctly.

[1] 4a742183a3
[2] https://src.fedoraproject.org/rpms/grub2/blob/rawhide/f/0062-Add-BLS-support-to-grub-mkconfig.patch

Depends-On: https://review.opendev.org/c/zuul/nodepool/+/818705
Change-Id: Ia0e49980eb50eae29a5377d24ef0b31e4d78d346
2021-11-25 14:26:23 +11:00
Zuul
11d25f76d2 Merge "Added missing grubby arg DIB_BOOTLOADER_DEFAULT_CMDLINE" 2021-11-24 22:30:43 +00:00
Zuul
583b594ad4 Merge "Trivial: fix whitespace in ubuntu element rst" 2021-11-23 18:37:15 +00:00
Zuul
b2a37f85f3 Merge "Allowing ubuntu element use local image" 2021-11-23 16:59:28 +00:00
Julia Kreger
a40261326f Trivial: fix whitespace in ubuntu element rst
Change-Id: If054f1fca0c884c2b66225126efad8f15d58cc70
2021-11-23 07:01:36 -08:00
Matthew Thode
86682071a8
update gentoo source suffix (where it finds the file to download)
gentoo releng updated how they name the files.

Change-Id: Ib2cbc007e9690fdaaf1d6cb6f5fbcb634c4a4bbe
2021-11-20 20:18:55 -06:00
Zuul
94b5b77d55 Merge "Revert "centos 9-stream: make non-voting for mirror issues"" 2021-11-18 07:11:01 +00:00
Zuul
acb35df1dc Merge "Add openEuler jobs back" 2021-11-18 07:10:59 +00:00
Marco Vaschetto
443305ab61 Allowing ubuntu element use local image
Patch allow to set path for local image source,
instead download latest or use the cached image.
This permit to build image also in environment without internet access.

re-propose of patch: https://review.opendev.org/c/openstack/diskimage-builder/+/809009

Change-Id: I54395b09af339caee040326b809e8fbf8b0e7d6a
2021-11-17 20:34:48 +01:00
Zuul
2c10f65599 Merge "Replace deprecated assertEquals" 2021-11-17 01:39:28 +00:00
Jakub Darmach
5a4e8a2c9e
Added missing grubby arg DIB_BOOTLOADER_DEFAULT_CMDLINE
DIB_BOOTLOADER_DEFAULT_CMDLINE was missing from grubby args.
Closes-Bug: 1951084

Change-Id: Idf2a471453c5490d927979fb97aa916418172153
2021-11-16 11:43:49 +01:00
Ian Wienand
ddb06b6657 source-repositories: don't use --git-dir
A recent(-ish) change in git [1] has exposed a bug in caching that
appears in one very specific circumstance -- updating the
openstack/openstack super-repo [2].

This repo gets a submodule update every time something is pushed.  By
using "--git-dir" while the cwd is one-level above the actual repo we
are confusing [1] which is not finding the submodule directories
correctly and giving us an error:

 Could not access submodule 'foo'

for every submodule that has updated between now and the last time we
updated the cache. [3]

The git manual does warn about this

 If you just want to run git as if it was started in <path> then use
 git -C <path>.

Indeed, that is what we want to do in this path.  Modify the calls to
use -C.

[1] 505a276596
[2] https://opendev.org/openstack/openstack/
[3] The result for opendev production is that image builds fail every
    time an openstack/* project is checked in; we then race to retry
    the build before another commit lands and updates the submodules
    again.

Change-Id: Iadb23454e29d8869e11407e1592007b0f0963e17
2021-11-16 19:16:03 +11:00
likui
7a57da8cee Replace deprecated assertEquals
The assertEquals method has been deprecated since it was renamed
to assertEqual in Python 3.2.

https://docs.python.org/3/library/unittest.html#deprecated-aliases

Change-Id: I559ad57c2d96a3bb51080c72816f39d3baa4c9dd
2021-11-12 09:46:14 +08:00
Ian Wienand
aaf8e3eed8 Revert "centos 9-stream: make non-voting for mirror issues"
This reverts commit a1debc726d

Change-Id: I3cd31e0de53948fd5073b493389c93debc8b5d08
2021-11-10 11:43:33 +11:00
Ian Wienand
85e20d9852 containerfile: handle errors better
Refactor things to use explicit names, and put in a trap to cleanup
after any errors.

Currently, if the build/run/export steps fail, it leaves behind images
which eventually clog things to the point podman won't run any more
(see also https://github.com/containers/podman/pull/12233 about errors
seen due to this)

Change-Id: Ib328a07ad67e3f71f379fbf34ae7ef74e212ef1c
2021-11-10 11:42:49 +11:00
Ian Wienand
3833c2e59c containerfile: fix tar extraction
Ic68e8c5b839cbc2852326747c68ef89f630f26a3 removed the sudo from the
tar extraction here, meaning that production is failing to create the
chroot.  This is hidden in testing because
DIB_CONTAINERFILE_PODMAN_ROOT is set.  Make the sudo here
unconditional.

Change-Id: I6e36e3fc65981f85fad12ea2cd10780fde9c37da
2021-11-10 11:42:49 +11:00
Ian Wienand
a1debc726d centos 9-stream: make non-voting for mirror issues
Change-Id: I9dc5015e4f3f6a710329e024913abe822cac3ee1
2021-11-10 11:42:40 +11:00
Zuul
eb7782b78f Merge "tests: remove debootstrap install" 2021-11-08 04:59:04 +00:00
Ian Wienand
f75fed076e fedora-container: update to Fedora 35
Support Fedora 35 in this element, and update the default

Depends-On: https://review.opendev.org/c/zuul/nodepool/+/815766
Change-Id: I2a9a8648158e1e4b1a071e20266fb8d125da67ac
2021-11-03 06:26:56 +11:00
Zuul
311621a094 Merge "Add support for CentOS Stream 9 in DIB" 2021-10-29 09:55:30 +00:00
Alfredo Moralejo
cdff9045c0 Add support for CentOS Stream 9 in DIB
CentOS Stream 9 is close to be released, and official mirrors are
already poplated. This patch is adding support to centos-minimal in CS9.

Also enable centos-minimal/[8,9]-stream-build-succeeds tests.

This patch is being tested together with [1] to apply following list of elements:

 vm centos-minimal simple-init growroot nodepool-base openstack-repos infra-package-needs

[1] https://review.opendev.org/c/openstack/project-config/+/811442

Change-Id: Iecf7f7e4c992bb23437b6461cdd04cdca96aafa6
2021-10-27 13:38:14 +02:00