Commit graph

4632 commits

Author SHA1 Message Date
Sanne Raymaekers
0fe3f1b2ae jobqueue: Query job dependents 2022-08-30 16:14:52 +02:00
Sanne Raymaekers
099b34b301 worker: Define new jobs to handle copying and resharing of images
The copy job copies from one region to another. It does not preserve the
sharing on the ami and it's snapshot, that needs to be queued
separately.
2022-08-30 16:14:52 +02:00
Jakub Rusz
5e9ecd3ae4 test/gcp: Run cleanup function at the end
All EXIT traps are cleared on line 280 so the cleanup trap is never run
and VMs are waiting for 4 hours to get cleaned by
scheduled-cloud-cleaner. Run the cleanup at the end and rely on
scheduled-cloud-cleaner only in case of failures before that.
2022-08-30 16:14:07 +02:00
dependabot[bot]
efddacc682 build(deps): bump cloud.google.com/go/storage from 1.22.1 to 1.26.0
Bumps [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) from 1.22.1 to 1.26.0.
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/pubsub/v1.22.1...spanner/v1.26.0)

---
updated-dependencies:
- dependency-name: cloud.google.com/go/storage
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-30 15:36:14 +02:00
dependabot[bot]
58c87198c6 build(deps): bump github.com/containers/common from 0.48.0 to 0.49.1
Bumps [github.com/containers/common](https://github.com/containers/common) from 0.48.0 to 0.49.1.
- [Release notes](https://github.com/containers/common/releases)
- [Commits](https://github.com/containers/common/compare/v0.48.0...v0.49.1)

---
updated-dependencies:
- dependency-name: github.com/containers/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-30 15:34:58 +02:00
dependabot[bot]
b133ff5994 build(deps): bump github.com/jackc/pgx/v4 from 4.16.0 to 4.17.1
Bumps [github.com/jackc/pgx/v4](https://github.com/jackc/pgx) from 4.16.0 to 4.17.1.
- [Release notes](https://github.com/jackc/pgx/releases)
- [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgx/compare/v4.16.0...v4.17.1)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgx/v4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-30 15:34:23 +02:00
Sanne Raymaekers
5f29dc312a distro: Only add rhsm facts stage for RHEL 2022-08-30 15:32:50 +02:00
Sanne Raymaekers
d7b8bb122c cloudapi/v2: Add rhsm facts for non-koji cloudapi composes 2022-08-30 15:32:50 +02:00
dependabot[bot]
5538a92eb3 build(deps): bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.12.1 to 1.13.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.12.1...v1.13.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-30 15:22:18 +02:00
Juan Abia
b11a493455 test: get latest version of CIV in aws.sh
instead of manually updating CIV version every once in a while. Get
always the latest version.

In CIV CI, this test runs before any change can be introduced into the
container image, so no unexpedted errors should come from the CIV side.
2022-08-30 15:02:25 +02:00
Achilleas Koutsou
7bf0277175 gen-manifests: don't fail on invalid distro-arch-image combos
When the user specifies any of the distro, arch, or image type values to
filter generation, invalid combinations would cause a panic, which made
it hard to filter requests based just on an image type.
Instead of failing, print an error message to inform the user, but
continue with the rest of the jobs.
This way, a user is informed that a certain combination is invalid if
they make a mistake, but can also filter on a single image type and only
get valid manifests out of the run.
2022-08-29 13:58:43 +02:00
Jakub Rusz
38e0894fd8 CI: update test execution on nightly pipelines
We don't support regression-bigiso and koji tests in nightly pipelines
so don't run them.
2022-08-29 12:51:59 +02:00
schutzbot
17300c8931 Post release version bump
[skip ci]
2022-08-29 09:44:19 +00:00
Ondřej Budai
29f66a251f go.mod: update github.com/containers/image/v5
Version 5.22 introduced a new option to /etc/containers/policy.json called
keyPaths, see

https://github.com/containers/image/pull/1609

EL9 immediately took advantage of this new feature and started using it, see
04645c4a84

This quickly became an issue in our code: The go library (containers/image)
parses the configuration file very strictly and refuses to create a client
when policy.json with an unknown key is present on the filesystem. As we
used 5.21.1 that doesn't know the new key, our unit tests started to
failing when containers-common was present.

Reproducer:
podman run --pull=always --rm -it centos:stream9
dnf install -y dnf-plugins-core
dnf config-manager --set-enabled crb
dnf install -y gpgme-devel libassuan-devel krb5-devel golang git-core
git clone https://github.com/osbuild/osbuild-composer
cd osbuild-composer

# install the new containers-common and run the test
dnf install -y https://kojihub.stream.centos.org/kojifiles/packages/containers-common/1/44.el9/x86_64/containers-common-1-44.el9.x86_64.rpm
go test -count 1 ./...

# this returns:
--- FAIL: TestClientResolve (0.00s)
    client_test.go:31:
        	Error Trace:	client_test.go:31
        	Error:      	Received unexpected error:
        	            	Unknown key "keyPaths"
        	            	invalid policy in "/etc/containers/policy.json"
        	            	github.com/containers/image/v5/signature.NewPolicyFromFile
        	            		/osbuild-composer/vendor/github.com/containers/image/v5/signature/policy_config.go:88
        	            	github.com/osbuild/osbuild-composer/internal/container.NewClient
        	            		/osbuild-composer/internal/container/client.go:123
        	            	github.com/osbuild/osbuild-composer/internal/container_test.TestClientResolve
        	            		/osbuild-composer/internal/container/client_test.go:29
        	            	testing.tRunner
        	            		/usr/lib/golang/src/testing/testing.go:1439
        	            	runtime.goexit
        	            		/usr/lib/golang/src/runtime/asm_amd64.s:1571
        	Test:       	TestClientResolve
    client_test.go:32:
        	Error Trace:	client_test.go:32
        	Error:      	Expected value not to be nil.
        	Test:       	TestClientResolve

 When run with an older containers-common, it succeeds:
 dnf install -y https://kojihub.stream.centos.org/kojifiles/packages/containers-common/1/40.el9/x86_64/containers-common-1-40.el9.x86_64.rpm
 go test -count 1 ./...
 PASS

To sum it up, I had to upgrade github.com/containers/image/v5 to v5.22.0.
Unfortunately, this wasn't so simple, see

go get github.com/containers/image/v5@latest
go: github.com/containers/image/v5@v5.22.0 requires
	github.com/letsencrypt/boulder@v0.0.0-20220331220046-b23ab962616e requires
	github.com/honeycombio/beeline-go@v1.1.1 requires
	github.com/gobuffalo/pop/v5@v5.3.1 requires
	github.com/mattn/go-sqlite3@v2.0.3+incompatible: reading github.com/mattn/go-sqlite3/go.mod at revision v2.0.3: unknown revision v2.0.3

It turns out that github.com/mattn/go-sqlite3@v2.0.3+incompatible has been
recently retracted https://github.com/mattn/go-sqlite3/pull/998 and this
broke a ton of packages depending on it. I was able to fix it by adding

exclude github.com/mattn/go-sqlite3 v2.0.3+incompatible

to our go.mod, see
https://github.com/mattn/go-sqlite3/issues/975#issuecomment-955661657

After adding it,
go get github.com/containers/image/v5@latest
succeeded and tools/prepare-source.sh took care of the rest.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-08-29 10:25:38 +02:00
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