Commit graph

4618 commits

Author SHA1 Message Date
Ondřej Budai
fa514c5326 blueprint: remove omitempty from Customizations
See https://github.com/BurntSushi/toml/issues/360

A recent change in BurntSushi/toml made encoding fail (later changed to
error) if a struct is marked as omitempty and is comparable. Go docs about
equality: https://go.dev/doc/go1#equality. Basically: A struct is comparable
if all of its fields are comparable. Slices are not comparable.

Customizations are marked as omitempty but they contain a lot of slices,
thus they are not comparable. The new version of BurntSushi/toml therefore
panics when we encode them.

The solution is to remove the omitempty tag from Customizations.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-08-29 10:25:38 +02:00
Sanne Raymaekers
774cc9e638 cloudapi/v2: Don't add rhsm facts
There are workers everywhere which can't deal with this change just
yet. Let's wait until workers can deal with this before adding facts via
the api.
2022-08-26 18:29:26 +01:00
schutzbot
1f9ea7714d Post release version bump
[skip ci]
2022-08-26 17:12:29 +00:00
Simon de Vlieger
c5f335bceb Add the rhsm.facts stage.
We initially provide a Facts file that stores the `ApiType`. This is the
API that was used to request the compose.
2022-08-25 18:56:35 +02:00
Xiaofeng Wang
dba76a1204 test: Add edge-install BISO installation test back for BZ#2110864 2022-08-25 14:54:56 +01:00
Achilleas Koutsou
a26b8a4d7f test: update test manifests (Fedora 35 and 36) 2022-08-25 14:54:56 +01:00
Achilleas Koutsou
18abe661a7 distro/fedora: enable hybrid boot for iot-installer 2022-08-25 14:54:56 +01:00
Achilleas Koutsou
6d0a22dc17 test: update test manifests (RHEL 8.x and CS8) 2022-08-25 14:54:56 +01:00
Achilleas Koutsou
b9c636763e distro/rhel8: enable hybrid boot for edge-installer
Regression introduced when unifying distro versions.
2022-08-25 14:54:56 +01:00
Achilleas Koutsou
0923f00819 test: update test manifests (RHEL 9.x and CS9) 2022-08-25 14:54:56 +01:00
Achilleas Koutsou
37e70329a7 distro/rhel9: enable hybrid boot for edge-installer
Regression introduced when unifying distro versions.
2022-08-25 14:54:56 +01:00
Tomas Hozza
af65baa6fe worker/osbuild: use os-release to determine host OS
When running an osbuild job, we read `/etc/redhat-release` to get the
host OS name to attach as metadata to the job result.

Only Fedora and RHEL ship this file, which makes the osbuild job always
fail on other distributions.

The main reason to report host OS back to the worker server is due to
Koji composes and the koji-finalize job, which pushes it to Koji. The
motivation is to have enough information to potentially re-instantiate
/ identify the original builder host OS. There are no specific
requirements on the string.

Modify the code to use `/etc/os-release` to determine the host OS. Fall
back to using `linux` as the host OS, in case reading `os-release`
fails, log the error and continue with the job. The `linux` fallback is
suggested by the `os-release` spec [1]

[1] https://www.freedesktop.org/software/systemd/man/os-release.html#ID=

Co-authored-by: Achilleas Koutsou <achilleas@koutsou.net>
2022-08-25 08:25:35 +01:00
Tomas Hozza
f378209bf3 Simplify trimming of quotes in readOSRelease()
Use standard library function to trim surrounding quotes from read
values. This makes the code shorter and easier to read.
2022-08-25 08:25:35 +01:00
Tomas Hozza
2fba4c2c1f Drop special handling for RHEL < 8.4 in GetHostDistroName()
RHEL-8.3 is EOL and we do not explicitly support it. There is no need to
mangle the host distro name for RHEL-8 releases older than 8.4.
2022-08-25 08:25:35 +01:00
Juan Abia
1873c561cf test: disable non supported tests
some scripts skip the test if it's not supported for that
distro-version. Disable them in gitlab-ci.yml so we don't waste CI
resources.

To disable them, we are using the `rules` on each job with a regex
pattern. Using `=~` (pattern matches) as a  WHITELIST and `!~` (pattern
does not match) as a BLACKLIST.
2022-08-24 19:37:43 +02:00
schutzbot
8982ab2018 Post release version bump
[skip ci]
2022-08-24 08:26:57 +00:00
Brian C. Lane
8a67406873 api_test: Use badpackage1 request for FetchError request
This returns the FetchError response setup in mocks/dnfjson for the
search command.
2022-08-23 22:47:46 +01:00
Brian C. Lane
3c0fa94c69 mock-dnf-json: Add support for search command
The search response from mocks/dnfjson is a map of responses indexed by the
comma-separated list of packages and globs being requested. Add support
for this.
2022-08-23 22:47:46 +01:00
Brian C. Lane
760be50069 mocks/dnfjson: Add mock support for the search command
The search command is more complicated than depsolve and dump. It needs
to return results based on the requested package names and globs.

Add a number of mock responses for the new search command, including
search results, all packages, and error responses that are triggered by
using special package names: nonexistingpkg, badpackage1, baddepsolve.
2022-08-23 22:47:46 +01:00
Brian C. Lane
60986380c4 weldr: Use the SearchMetadata function for globs
Instead of fetching all available packages from dnf-json and then
searching the results this uses SearchMetadata when a package name or
glob is passed to the API. It only uses FetchMetadata when fetching
the full list of packages.

This also fixes a bug where the error response to a projects/info
request used the id of 'ModulesError'. It now uses 'ProjectsError'.
2022-08-23 22:47:46 +01:00
Brian C. Lane
a751dfe71c dnfjson: Add the search support to the Solver
Pass the list of package names or globs to dnf-json and return the
results.
2022-08-23 22:47:46 +01:00
Brian C. Lane
2c3cb56cb3 dnf-json: Add search command
Use the DNF query API
(https://dnf.readthedocs.io/en/latest/api_queries.html) to quickly
return results matching a glob pattern. Multiple package glob results
are combined into a single response.

This adds a search dict to the arguments. 'packages' is a list of package
names or globs to search for.
An optional 'latest' boolean will return only the latest NEVRA instead
of all matching builds in the metadata.

eg.

    "search": {
        "latest": false,
        "packages": ["tmux", "vim*", "*ssh*"]
    },
2022-08-23 22:47:46 +01:00
Gianluca Zuccarelli
c264ce53cd distro: add oscap packages to image
Since the oscap remediation stage in osbuild runs
the oscap package in `chroot`, it is necessary to
install the `openscap-scanner` package to the image
itself rather than the build root.
2022-08-23 18:06:15 +02:00
Jakub Rusz
de6b8e8f5b Update terraform SHA with more aarch64 runner options
This commit adds the option to also provision c6g.large machines in
addition to c7g.large machines in AWS.
2022-08-23 15:31:47 +03:00
Jakub Rusz
e9a1e66cbe distro/rhel-9: remove nvmf dracut module from image-installer
The module is not present in official RHEL-9.1 ISO image and it is
causing boot issues when used with newer content. HTTP boot is
not affected by this change and works as expected.
2022-08-22 10:11:48 +02:00
Alexander Todorov
65ef1b2e78 Don't special case nightly repository names for Satellite regression tests
this is no longer needed b/c the nightly CI jobs are now using the same
json definitions as the regular CI jobs, just changing baseurl. See
previous commit.
2022-08-18 14:00:16 +03:00
Alexander Todorov
f451e0291a Modify repositories/rhel-xy.json file before testing nightly compose
Fixes #1318

- uses a wildcard match for sed in order to replace only lines which
  match and keep the rest intact
2022-08-18 14:00:16 +03:00
Alexander Todorov
e902e1f410 Revert "provision.sh: don't do any verification"
This reverts commit faf911cd21.
2022-08-18 14:00:16 +03:00
Tomas Hozza
0875c3491f distro/rhel9: disable GPG check for Google repos in gce* images
Having the GPG check enabled for Google repos in `gce*` images will make
DNF try to import the relevant keys when upgrading, downgrading or
installing any packages from the repo. However due to Google still using
SHA-1 for GPG keys used to sign their RPMs, importing it will make any
transaction that includes such RPM to fail.

Disabling the GPG check will ensure that DNF won't attempt to import
Google GPG keys.

Related to https://issuetracker.google.com/issues/223626963
2022-08-17 11:59:39 +02:00
Tomas Hozza
55e78e195f distro/rhel9: do not define Google Cloud SDK repo in gce* images
The repo is not needed any more, because the Google Cloud SDK is not
installed in the images by default. If anyone wants to install the SDK,
they can add the appropriate repo definition.
2022-08-17 11:59:39 +02:00
Tomas Hozza
debd6d4342 distro/rhel8: do not define Google Cloud SDK repo in gce* images
The repo is not needed any more, because the Google Cloud SDK is not
installed in the images by default. If anyone wants to install the SDK,
they can add the appropriate repo definition.
2022-08-17 11:59:39 +02:00
Tomas Hozza
5f48aaa212 distro/rhel9: don't install google-cloud-sdk in any gce* images
The Google SDK ships pre-compiled binaries. It is undesirable to install
it by default in `gce` and `gce-rhui` in its current shape. Also not
installing it does not anyhow affect the RHEL integration as the guest
OS in GCP.
2022-08-17 11:59:39 +02:00
Tomas Hozza
cf92c1f23a distro/rhel8: don't install google-cloud-sdk in any gce* images
The Google SDK ships pre-compiled binaries. It is undesirable to install
it by default in `gce` and `gce-rhui` in its current shape. Also not
installing it does not anyhow affect the RHEL integration as the guest
OS in GCP.
2022-08-17 11:59:39 +02:00
Tomas Hozza
735c6ec9c3 generate-all-test-cases: make output default to test/data/manifests 2022-08-17 11:59:39 +02:00
Tomas Hozza
a2c46bdf3a distro: rename rhel90 -> rhel9
Make the package and directory naming consistent with RHEL-7 and RHEL-8.
2022-08-17 11:59:39 +02:00
Alexander Todorov
239e8ccbc0 ci: Update runner to RHEL 9.1 to enable test in nightly pipeline 2022-08-16 18:26:28 +03:00
Xiaofeng Wang
53d4d7f284 test: Improvements for container embedding Edge test 2022-08-12 10:18:29 +03:00
Juan Abia
6e771c97fc test/cases: update cloud-image-val in aws.sh
update CIV to latests realease: v0.2.2
2022-08-11 18:17:28 +02:00
Alexander Todorov
8ae8ba9fae tests: Add comment to make it more obvious what's happening 2022-08-11 13:12:55 +02:00
Alexander Todorov
d3dde77a6f tests: Make Satellite regression tests to use the SUT 2022-08-10 16:33:34 +03:00
Alexander Todorov
860b122f2c tests: Remove useless JSON file overrides
See comment
https://github.com/osbuild/osbuild-composer/pull/2881/files#r940065803

for explanation why
2022-08-10 16:33:34 +03:00
schutzbot
df22e8b686 Post release version bump
[skip ci]
2022-08-10 08:26:51 +00:00
Christian Kellner
dd0be9e439 disk/partition_table: extract customization application into method
Extract the application into a utility method on `PartitionTable`.
In order for it to be usable for the first and second pass it does
take a `create` argument that controlls whether new partitons will
be created or return.
2022-08-08 18:05:05 +02:00
Christian Kellner
b562d144ca distro/*: allow /boot to be customized
Since the LVM support was added to all distros, our disk
related code is adaptive, i.e. we will set the correct BLS
and grub2 prefix if there a `boot` partiton is present in
the layout after all customizations happen, which includes
LVMification.
One thing that was not yet fully working was layouts that
do not yet have a `/boot` partition but allow LVMification.
In that case `NewPartitionTable` and if `/boot` was the
first (or only) customization, would LVMify the partition
which in turn would create the `/boot` partition; but after
`newPT.ensureLVM()` the call to `newPT.createFilesystem`
with `/boot` would try to create another `/boot` mountpoint.
In order to deal with this situation correctly we are now
using a two phase approach: 1) enlarge existing mountpoints
and collect new ones. 2) if there are new ones and LMVify
was allowed, switch to LVM layout. Do a second pass and now
create or enlarge existing partitions, handling `/boot` in
the process.
2022-08-08 18:05:05 +02:00
Christian Kellner
3c3f1b4969 disk: rename MountpointAllowList -> MountpointPolicies
Now that the mountpoint allow is is actually a trie of path
policies we should rename it to better refelct its contents.
2022-08-08 18:05:05 +02:00
Christian Kellner
de52e024a0 disk: use path policy for mount point checking
Replace the simple allow list of paths with the more sophisticated
path policies. It enables us to e.g. allow one path but not any
sub-path. This will be useful for `/boot` where we want to allow
its customization but not any sub-path because that might actually
break booting.
2022-08-08 18:05:05 +02:00
Christian Kellner
9523694879 disk: new path policies struct and methods
Build a new path policy struct, ased on the new path trie struct.
It is designed to be able to store policies for paths. A Check
method can then be used to look up the policy for a given path
based on the defined policies.
2022-08-08 18:05:05 +02:00
Christian Kellner
00555722b2 disk: add generic path trie implementation
Add a simple implementation of a path trie structure that can be
used to look up assoicated data for any given path. The constructor
will build the trie from a dict of paths to associated data. Later
modification is currently not support. Add tests for it creation
and lookup.
2022-08-08 18:05:05 +02:00
Christian Kellner
1ca2efe6cf distro/*: move mount point allow list to disk
All distributions have exactly the same list of allowed mountpoint
customization points. Therefore move it to `disk` and share it
between all distros.
2022-08-08 18:05:05 +02:00
Christian Kellner
2b03a839f0 disk: move mount point checking to central location
Instead of all distribution implementing their own mount point
checking code, we de-duplicate it and move it to `disk`.
2022-08-08 18:05:05 +02:00