Commit Graph

817 Commits

Author SHA1 Message Date
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
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
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
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
Ian Wienand
57b7d2bceb dracut-regenerate: drop Python 2 packages
We don't support any Python 2 guest systems, drop the Python 2 bits
from package-installs.

Change-Id: Ica5c71c2926968d438ac1d0b0f16981cadf0bab1
2021-10-27 11:11:50 +11:00
Dr. Jens Harbott
4bd8258fbf Fix bootloader installation for gentoo
The if/elif block added in [0] doesn't work for gentoo, let's hope
that we can get along with an easy fix.

[0] https://review.opendev.org/c/openstack/diskimage-builder/+/804000
Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I543e04d2d7efea3e718bae31aa1cc4767bd359f8
2021-10-21 10:20:58 +02:00
Sagi Shnaidman
d5a01519c6 Update centos element for 9-stream
This adds 9-stream support to the centos element.

See https://review.opendev.org/q/topic:cs9 for related patches.

Change-Id: Ib80fbd21edb77c25764eff2c0d66e55bde7a90af
2021-10-20 09:39:27 +11:00
Ian Wienand
1a5c563920 Run functional tests on Debian Bullseye
We need to update the base reference platform we perform the
functional tests on.  Debian bullseye seems like the best choice -- it
is recent enough to last for a while, and will match the
nodepool-builder container environment.

Depends-On: https://review.opendev.org/c/zuul/zuul-jobs/+/814088
Change-Id: Ic68e8c5b839cbc2852326747c68ef89f630f26a3
2021-10-20 09:39:27 +11:00
Ian Wienand
f3a3153390 ubuntu: add Focal test
Switch this to testing bionic and focal, dropping xenial

Change-Id: Ifba6800ad84e504d248de8389e49a31f22c4554c
2021-10-20 09:39:27 +11:00
Ian Wienand
2f1e9320bd ubuntu-systemd-container: deprecate and remove jobs
I'm not aware this element is used/was ever used.  It hasn't ever been
updated to Focal.  To reduce our testing footprint remove this test,
and note in the element its probably broken.

Change-Id: I17cd3b13948287fe78990cfbe16a22919a329ba9
2021-10-20 09:39:27 +11:00
Ian Wienand
d5fa64325f Revert "Allowing ubuntu element use local image"
This reverts commit 1f4fb1d7a5.

This unfortunately wasn't actually tested.  Because the image-based
tests run sequentially, a prior failure in the centos-8 job meant the
ubuntu job never ran.

This is failing with

 10-cache-ubuntu-tarball: line 28: DIB_LOCAL_IMAGE: unbound variable

There is also a seemingly unused variable DIB_IMAGE_LOCAL_FILE; I'm
not sure what this is doing.

For now revert, and it can be re-proposed with appropriate testing.

Change-Id: I0f3897c90dc863ee04c3295b9cb094f02d8658e3
2021-10-20 09:39:27 +11:00
Ian Wienand
2d5981d673 epel: match replacement better
It looks like upstream have changed this line to "download.example",
breaking our subsitution.  Let's do a generic match.

Change-Id: I8e443022a5f239b98ccefe73a9abf8cf259dc8e9
2021-10-20 09:39:27 +11:00
Danni Shi
18df5a59b5 Update keylime-agent and tpm-emulator elements
Story: #2002713
Task: #41304

Change-Id: I735db46a62edecc85457d4163963f558c9fe461d
2021-10-06 15:05:28 -04:00
Zuul
6e83df4d40 Merge "Fix cron not installed in debian" 2021-10-06 13:23:00 +00:00
Zuul
82aa8c516d Merge "Add DIB_YUM_REPO_PACKAGE as an alternative to DIB_YUM_REPO_CONF" 2021-10-04 06:51:31 +00:00
Zuul
70378de688 Merge "Add policycoreutils package mappings for RHEL/Centos 9" 2021-10-04 06:51:29 +00:00
Zuul
0e93b853bf Merge "RHEL/Centos 9 does not have package grub2-efi-x64-modules" 2021-10-04 06:51:27 +00:00
Zuul
0a9c0b6ab8 Merge "Support grubby and the Bootloader Spec" 2021-10-04 06:46:29 +00:00
Zuul
a4615a2977 Merge "Move grubenv to EFI dir" 2021-10-04 06:46:28 +00:00
Zuul
175c5c4da6 Merge "Allowing ubuntu element use local image" 2021-10-01 15:31:07 +00:00
Marco Vaschetto
1f4fb1d7a5 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.

Change-Id: I9422e21c5d0445e31d5a7258aa7310b20e39b929
2021-09-27 20:56:06 +02:00
Zuul
0aa6e24286 Merge "Fix debian-minimal security repos" 2021-09-14 23:16:28 +00:00
Steve Baker
296c81b9ca Add DIB_YUM_REPO_PACKAGE as an alternative to DIB_YUM_REPO_CONF
A custom yum repository can now be configured by defining
`DIB_YUM_REPO_PACKAGE` as a yum available package or a URL to an rpm file.
This package can install repo files with any associated keys and
certificates.

A good example of such a package upstream is rdo-release[1] which
includes multiple repo files, the repo keys, and a root certificate.
This makes these repos impractical to install via DIB_YUM_REPO_CONF.

Downstream, repo packages like this a frequently used to bootstrap
development builds of RHEL with development repos.

[1] https://www.rdoproject.org/repos/rdo-release.rpm

Change-Id: I2832e723998c9bd7635cdf7541a4c20eff6294d2
2021-09-13 09:32:53 +12:00
Steve Baker
017ba12eb0 Add policycoreutils package mappings for RHEL/Centos 9
Change-Id: I69f0bc39b3ff4759bb66cea76112901ea8afff68
2021-09-13 09:32:53 +12:00
Steve Baker
fd63fe6999 RHEL/Centos 9 does not have package grub2-efi-x64-modules
Change-Id: Ida37eb500b7f331fd35f1b76365940c3b95ec83e
2021-09-13 09:32:53 +12:00
Steve Baker
97f940ace5 Support grubby and the Bootloader Spec
Fedora 30 and RHEL-8.2 onwards support the Bootloader Spec and use grubby
to manage kernel menu entries and kernel arguments.
https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault

This change detects if this is a BLS enabled environment, and uses
grubby to set kernel arguments on all kernel entries if it is.

Change-Id: I2701260d54cf6bc79f1ac765b512d99d799e8c43
2021-09-13 09:32:53 +12:00
Steve Baker
b01aac9715 Move grubenv to EFI dir
If the grubenv is regenerated, its changes won't be available to UEFI
boot systems unless the changed grubenv is copied to the EFI
directory.

This change copies the grubenv to the EFI directory when the grub.cfg
is copied.

Change-Id: I512502117a6bf1e6122fdfd8965ca488b4a5bae4
2021-09-13 09:32:29 +12:00
Zuul
3c3ef6e32b Merge "Check and remove existing image interface configurations" 2021-09-10 15:01:28 +00:00
Zuul
48ef1c4d96 Merge "simple-init: allow disabling DHCP fallback" 2021-09-10 14:54:03 +00:00
Zuul
3eae88795d Merge "simple-init: support installing Glean from packages" 2021-09-10 14:54:00 +00:00
Riccardo Pittau
6ed7f3b139 Fix debian-minimal security repos
Debian stable security repos is now stable-security, as well as other
versions.

Move the Debian bullseye job from experimental to non-voting check.

Change-Id: I451cacda6573727de9448b5857bed5181850b4ad
2021-09-10 11:40:48 +02:00
Zuul
f03c50b4a1 Merge "Fix doc typo" 2021-09-09 00:24:00 +00:00