Commit graph

3598 commits

Author SHA1 Message Date
Jakub Rusz
ae07093404 tests/image-tests: filter out cases with ostree URL
These tests depend on external dependencies which are difficult to setup
during image-test like http ostree repository. See
https://github.com/osbuild/osbuild-composer/pull/2389#issuecomment-1060338127
for more details.
2022-03-08 09:23:05 +01:00
Xiaofeng Wang
e147e41879 test: Fix COMPOSE_URL issue and add set-env-variables.sh 2022-03-08 09:23:05 +01:00
Jakub Rusz
485fc68a98 tests/upgrade: add user choice for vdo devices check
This is a user choice that has to be picked before the upgrade or it
acts as an inhibitor.
2022-03-08 09:23:05 +01:00
Jakub Rusz
ec93130a30 schutzbot/prepare-rhel-internal: update repository gpgkey
SHA-1 key is no longer supported, update it with a new one from
redhat-release. Related rhbz#2058497
2022-03-08 09:23:05 +01:00
Sanne Raymaekers
55b78bbd36 templates/packer: Remove -u flag from creds mapping script
We test if specific variables are set, and -u interferes with that.
2022-03-07 17:11:54 +01:00
Diaa Sami
e15998ced7 koji: add HTTP retries for uploads & init/finalize
and log number of retries for trackability
Fixes #2335
2022-03-06 11:04:37 +01:00
Christian Kellner
8c8f6f2cd5 spec: bump osbuild requirement to version 52
Needed due to the new `gpgkeys.fromtree` option in `org.osbuild.rpm`.
Pin osbuild version 52 in Schutzfile as well.
2022-03-05 21:04:24 +01:00
Christian Kellner
923a627de4 distro/rhel86: set GPGKeyFiles for azure-rhui
Import the appropriate GPG keys for Red Hat contained in the package
`redhat-release` and Microsoft contained in `rhui-azure-rhel8`.
2022-03-05 21:04:24 +01:00
Christian Kellner
5b802f699a distro/rhel86: sync packages for azure-rhui
Sync the list of packages with the existing market place images.
2022-03-05 21:04:24 +01:00
Christian Kellner
320dcb0f9d distro/rhel86: update sysconfig options
Set `kernel-core` to be the defaul kernel instead of `kernel`.
2022-03-05 21:04:24 +01:00
Christian Kellner
e60517f0af distro/rhel86: remove authconfig call from azure-rhui
authconfig is actually a RHEL 7 thing and we should not call it for
RHEL 8.
2022-03-05 21:04:24 +01:00
Christian Kellner
dbd6f1f48c distro: add GPGKeyFiles option to ImageConfig
Add a new option `GPGKeyFiles` to ImageConfig that indicates which files
containing GPG keys should be imported into rpm. For now it will be used
by the osPipeline in rhel{86,90} to set the corresponding option in the
`org.osbuild.rpm` stage.
2022-03-05 21:04:24 +01:00
Christian Kellner
92d32e697d osbuild2: expose new gpgkeys.fromtree osbuild option
The `org.osbuild.rpm` stage gained a new option `gpgkeys.fromtree`
which is a list of paths with files containing gpgkeys that will
be imported after the package installation phase is done.
2022-03-05 21:04:24 +01:00
Christian Kellner
4b53312b7c test/data/repositories: bump snapshots to 20220301
Use the latest snapshot for the not yet released versions of RHEL and
their CentOS counterparts.
2022-03-05 11:37:12 +01:00
schutzbot
54eb8e41ff schutzfile: Update snapshots to 20220301 2022-03-05 11:37:12 +01:00
Jakub Rusz
5f28e0b7f6 schutzbot: update terraform SHA
CentOS-stream-9 image update in AWS. Resolves current koji.sh failures.
2022-03-04 09:34:46 +01:00
Antonio Murdaca
c79f51942b test/cases/simpl installer: bump to use fdo 0.4.0
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2022-03-03 16:27:57 +01:00
Jakub Rusz
a351a17f5e schutzbot: fix jrusz ssh key 2022-03-03 15:02:13 +01:00
Jakub Rusz
71f9355c87 schutzbot: add jrusz ssh-key 2022-03-03 13:29:55 +01:00
Ondřej Budai
5e291bd98f cloudapi/test: remove dependency on rpmmd_mock
rpmmd_mock fixture are complex and unneeded in the context of cloudapi, let's
just copy 3 lines from them and drop the dependency.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-03-02 16:20:11 +01:00
Ondřej Budai
c29a1fa9da cloudapi: drop unused rpmmdMetadata parameter & struct member
cloudapi no longer calls dnf-json directly so we can clean some code, yay!

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-03-02 16:20:11 +01:00
Sanne Raymaekers
0f26672e45 cmd/osbuild-service-maintenance: Log aws error 2022-03-02 12:36:09 +01:00
Sanne Raymaekers
413a013b91 templates/composer: Parametrize bucket name 2022-03-02 09:56:32 +01:00
ondrejbudai
309aca51f1 Post release version bump
[skip ci]
2022-02-28 23:35:13 +00:00
yih
f0522e758b test: fix ansible mount point check issue when encrypted
The device file is not `/dev/vda` anymore since we are no using a LUKS2
container, so we now have to look for `/dev/mapper/luks-`.
2022-02-28 23:05:45 +00:00
Antonio Murdaca
c1a896dd1d rhel{86,90}: define simplified installer build packages set
The edge installer and edge simplified installer build roots have
diverged, i.e. the latter need clevis/luks, so define a new pkg
set for the simplified installer extending the edge installer one.

Co-Authored-By: Christian Kellner <christian@kellner.me>
2022-02-28 23:05:45 +00:00
Antonio Murdaca
39db7653b5 test/data/respositories: bump snapshots to 0227
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2022-02-28 23:05:45 +00:00
Antonio Murdaca
3b45a13ba2 Schutzfile: pin osbuild 50
CentOS Stream 8 is lagging behind, so let's pin osbuild v50,
under the assumption that things land in CS8 in the same order
they landed in RHEL8, so we don't run the risk of an old osbuild
with a new composer.

Fedora 35 is also stuck on an old osbuild, we will have to take
care to release osbuild 50 into F35 before the next composer.

Usually we would not want to pin like this, but we would
otherwise block the next composer release in RHEL.
2022-02-28 23:05:45 +00:00
Tom Gundersen
973b5141b3 ditro/rhel86: set volid like in rhel9.0
This is only required in RHEL9.0, but best practice is to always pin these things
down. Also increases uniformity between distros.

Simplify a bit the volid generator by making it require `rand.Rand` rather than
`io.Reader`, and hence eliminating the need for error handling.
2022-02-28 23:05:45 +00:00
Achilleas Koutsou
154e966cda test: update manifests and image info
Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
2022-02-28 23:05:45 +00:00
Antonio Murdaca
1a11176a22 spec: require osbuild >= 49 for luks/clevis stages
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2022-02-28 23:05:45 +00:00
Antonio Murdaca
3be67ad965 Simplified installer: add support for encrypted raw images
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2022-02-28 23:05:45 +00:00
Achilleas Koutsou
437dd397cd disk: test for duplicate Entities when cloning PartitionTables
Collect all entities and compare pointers.
2022-02-28 23:05:45 +00:00
Achilleas Koutsou
10095e382a disk: fix Payload cloning bugs
In LUKSContainer and LVMLogicalVolume we neglected to clone the Payload
which means we would modify the base PartitionTable when manipulating
the clone.
2022-02-28 23:05:45 +00:00
Christian Kellner
e921b7aadd rhel86: specify a minimum root file system size
Specify a size for the root filesystem in the partition table,
which basically equates to a minimum size. In reality all image
types specify a larger image size and thus we enlarge the root
file system to more than the specified size for plain layouts.
But if we auto-convert an partition layout to LVM we need a size
for the root partition.
Does not change any existing manifests.
This does not apply for ostree based systems like the simplified
installer.
2022-02-28 21:36:25 +01:00
Christian Kellner
ddc0126a36 test: check we always have a boot on lvmification
Check that the `ensureLVM` code creates a boot partition, if it does
not yet exist.
2022-02-28 21:36:25 +01:00
Christian Kellner
63aa1556fc rhel86: automatically convert to LVM on fs customizations
Whenever we create a new mountpoint due to a user customization,
ensure the layout uses LVM, i.e. convert plain layouts to it, if
needed. It uses the existing lvm-ification code but enhances it
so that we also create a `/boot` partition in case it does not
yet exist.
Adjust the existing tests that assumed we can not create more
than 4 partitions on mbr layouts, since that is now not true
anymore.
2022-02-28 21:36:25 +01:00
Christian Kellner
98aba06ca5 tools/image-info: support inspecting LVM2 layouts
When encountering an LVM2 layout, activate all its logical volumes
so that they can be mounted.
NB: we need to pass "norecovery" to the mount options because LVM
does not setup the device mapper tables read-only even though the
underlying loopback device is and then xfs will try to write to
its journal and the kernel will panic. Attempts to reload the DM
tables as readonly didn't work.
NB: this will not work if we are trying to inspect an image that
has a volume group name that is also present on the host. We
could open the image file read-write and modify its vg name, but
that would mean modifying the image file and thus we would need
to copy it first.
Pass `-c /dev/null` to `blkid` to force it not to use its cache.
2022-02-28 17:09:30 +01:00
Christian Kellner
932a8a0333 tools/image-info: try simplifying device handling
When iterating over partitions, only record the ones that have a file-
system and save them in a filesystem to device map. Then use that for
mounting. This also prepares the way for LVM and LUKS where there is
not a 1:1 mapping between partition and filesystem.
2022-02-28 17:09:30 +01:00
Christian Kellner
9e5b265a58 osbuild2: lock loopback devices during sfdisk, mkfs
Since udev will probe block devices it is advisable to hold a lock
on the device when modifying its partition table or the superblock
of the filesystem (see [1]). osbuild loopback devices do support
this via the `lock` option. Set this option for all operation that
involve changing block device "metadata" that could potentionally
race with udev, such as sfdisk, mkfs, creating a luks2 container
and creating LVM2 volume groups and logical volumes.
NB: osbuild also has its own device inhibition logic to prevent
udev/lvm2 from auto activating devices and in general to limit the
interaction between the host and devices used by osbuild. See [2]
for more information.
NB: this also locks the loopback device in situation where we the
it is strickly not the right thing to do, e.g. when creating a fs
on a logical voume that is located on a loopback device, since in
this case the device we would need to lock is the logical volume.
Sadly, LVM/DM devices are exempt from block device locking. But,
due to a bug in osbuild < 50, the udev inhibitor does *not* work
for loopback devices and therefore we have to use the actual lock
to preven LVM device auto-activation via `69-dm-lvm-metad.rules`.
The change was implemented by adding a new boolean to `getDevices`
indicating if the loopback device should be locked or not. Once
we depend on osbuild 50 we can change the logic in `getDevices`
to only lock the loopback device if the number of devices is one,
i.e. we are working directly on the loopback device.

[1] https://systemd.io/BLOCK_DEVICE_LOCKING/
[2] /usr/lib/udev/rules.d/10-osbuild-inhibitor.rules
2022-02-28 17:09:30 +01:00
Christian Kellner
19e7890f63 rhel90: automatically convert to LVM on fs customizations
Whenever we create a new mountpoint due to a user customization,
ensure the layout uses LVM, i.e. convert plain layouts to it, if
needed. This does not apply to rpm-ostree based systems, e.g. the
simplified installer since they will be using LUKS in 9.0.
Add "lvm2" to the build pipeline and thus generate new manifests
and image infos.

Co-Authored-By: Achilleas Koutsou <achilleas@koutsou.net>
2022-02-28 17:09:30 +01:00
Christian Kellner
375c3c5cff rhel90: specify a minimum root size in the partition table
Specify a size for the root filesystem in the partition table,
which basically equates to a minimum size. In reality all image
types specify a lager image size and thus we enlarge the root
file system to more than the specified size for plain layouts.
But if we auto-convert an partiton layout to LVM we need a size
for the root partition.
Does not change any existing manifests.
This does not apply for ostree based systems like the simplified
installer.
2022-02-28 17:09:30 +01:00
Christian Kellner
ed4e0a94a4 disk: honour the fact that some containers have metadata
Re-introduce the VolumeContainer interface but with a different
meaning: it is supposed to be implemented by all container that
contain volumes and as a result have themselves a size, like eg
LVM2, LUKS2 and PartitionTable (the latter is not yet included).
The sole method on the interface for now is MetadataSize, which
should return the metadata for the container itself.
Use that new `VolumeContainer.MetadataSize` method when we up-
date the sizes of elements in `resizeEntitybranch`.
2022-02-28 17:09:30 +01:00
Christian Kellner
17fa96b84a disk: rename VolumeContainer → MountpointCreator
Rename the interface after the one method it has and the attribute
it describes for the implementing entities: being able to create
mountpoints.
2022-02-28 17:09:30 +01:00
Christian Kellner
7bfd0bb49f disk: rename Create{Volume → Mountpoint}
The function is indeed creating a mounpoint not a Volume; the
latter is not even well defined in our "ontology".
2022-02-28 17:09:30 +01:00
Christian Kellner
45f898c05c disk: remove unused CreateFilesystem method
The `CreateFilesystem` method on `PartitionTable` is not used
anymore since it got replaced by `CreateVolume`.
2022-02-28 17:09:30 +01:00
Christian Kellner
e57cccc3fe disk: NewPartitionTable can wrap plain partitions in LVM
Add a new parameter `lvmify` to `NewPartitionTable` that, if set to
`true`, will cause the root partition to be wrapped in LVM in case
it is not in a LVM volume group. Set this to `false` for now so no
actual change should happen anywhere. Layouts where the root is
directly on a LUKS container are not yet supported.
Add tests for this.
2022-02-28 17:09:30 +01:00
schutzbot
bd2849340c schutzfile: Update snapshots to 20220227 2022-02-27 22:26:57 +00:00
Christian Kellner
3805975986 spec: bump osbuild requirement to 47
This contains important build fixes for PPC64LE. See the corresponding
osbuild release notes for details.
2022-02-27 22:03:36 +01:00
Christian Kellner
1a6f5ff167 tools/image-info: don't crash on lvm layouts
Image info currently cannot handle LVM and will abort with something
like:
  mount: /tmp/tmpzwlch91r: unknown filesystem type 'LVM2_member'.
Detect LVM setup and just exit for now.
2022-02-27 22:03:36 +01:00