Commit graph

5761 commits

Author SHA1 Message Date
Alexander Todorov
c0c4ecd937 Add my ssh key to the list of known keys 2023-06-15 08:54:57 +02:00
Alexander Todorov
2251e037c1 Use osbuild v86 for testing on 8.9 & 9.3 runners
fixes an issue with vmware_ova job
2023-06-15 08:54:57 +02:00
Alexander Todorov
1f28e50d21 Adjust tests for new distros
References:
- https://redhat-internal.slack.com/archives/C0235DZB0DT/p1685528139831589
- 1fbd9d975f
2023-06-15 08:54:57 +02:00
Alexander Todorov
4aff9076ea Update rpmrepos & manifest files via command
go run ./cmd/gen-manifests/ -workers 50
2023-06-15 08:54:57 +02:00
Alexander Todorov
fa5be10342 Update test runners: 8.8 -> 8.9; 9.2 -> 9.3 2023-06-15 08:54:57 +02:00
Alexander Todorov
22437f7784 Add RPM repository definitions for 8.9 and 9.3 2023-06-15 08:54:57 +02:00
Achilleas Koutsou
40719798d0 test: update manifests
Edge and IoT manifests are modified from the new option handling.  The
"parent" commit ID isn't specified in the options anymore, but it is
(fake) resolved by the manifest generator.

Of particular note is the iot-raw-image manifest that now properly uses
the commit ID in the copy stage for the firmware.

The resolved ostree commits are now stored in the content part of the
manifest metadata alongside package specs and containers.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
403fe74ce4 format-request-map: clean up ostree params
Don't specify ref ID for parent, instead only specify a ref and URL and
let the manifest generator resolve the ID using the sha256 hash.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
9ed61d021b distro/test: update test distro with new behaviour
Add a checksum as a hash of URL + Ref.
Use the parent ref instead of the image ref when it's set.  This makes
the test distro always behave like ostree commit and container types
(image types that can use an ostree parent) and not raw image or
installers (that use ostree commits as a payload).

Modify the weldr API test with the expected error message.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
96b7f05f6f osbuild-pipeline: resolve ostree commits
Properly resolve any ostree commit checksums.  Don't make the user
specify the checksum through the parent.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
0eb999d510 cloudapi: remove ostree from imageRequest
Use ostree.ImageOptions for the request parameters instead of a
SourceSpec on the imageRequest.

When preparing the image request, add the ostree values from the API's
compose request to the ostree options on the image options of the image
request.

It's not necessary to create a source spec and it's also not necessary
to add the default ref when it's not specified in the request for an
ostree-based image type.  Both of these will be handled by the Manifest
generation based on the ostree options (imageOptions.OSTree).  The image
functions will take care of setting any missing parameters or returning
errors if any required parameters are missing.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
8e5ac9790e worker: update ostree job structs
Change the OSTreeResolveSpec to match the ostree SourceSpec by removing
the Parent field.

Change OSTreeResolveResultSpec to match the CommitSpec by adding the
Secrets field.  The RHSM field is kept for backwards compatibility with
older workers.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
7e2855bbb3 ostree: rewrite Resolve() to take SourceSpec and return CommitSpec
The Resolve() function is now only responsible for resolving a
SourceSpec to a CommitSpec.  It only resolves a checksum if a URL is set
and sets the option for the RHSM secrets.

The Parent has been removed from the SourceSpec.  The SourceSpec is a
simple reference to a single ostree ref and has no connection with the
ostree options.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
3a42770548 distro/test: test ostree options
Test all combinations of ostree options and verify the ostree commit
source spec returned by the manifest.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
d34ad18aaf distro/test: remove test skip line
Oops!
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
7a23a81228 ostree: use image options for request data
The ostree options for a compose request should be specified using the
ImageOptions struct, not the source spec.  The source spec should be
specifying the source parameters for a single ostree commit internally.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
56ea5db9a8 ostree: variable rename: parent -> checksum
There's nothing parent-y about what we're resolving.  It's the checksum
of a ref in a given repository.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
7553d1bee1 manifest: add a Distro enum to the Manifest
Add a Distro enum to the Manifest struct for selecting package
selection.

Packages are sometimes renamed between distribution versions and since
we do the package selection in the Manifest, we need a way to select
distro-version-specific package names inside the manifest initialiser.

This may change in the future.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
5dba246813 manifest: remove Content field from manifest
Do not expose the content of the manifest statically and instead rely on
the public methods to retrieve source specifications dynamically.

Since the methods require iterating through the pipelines to collect
source specifications, we should avoid calling the function multiple
times when we can reuse the returned values.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
cecbc97e06 cloudapi/v2/test: codestyle cleanup
- Remove redundant types in struct literals (linter warning)
- Fixed indentation in json string literals
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
68ccc58706 Adapt tests to new test_distro
The new test_distro's manifest produces a slightly different empty
manifest when serialized even without content.  Cloud API and Koji tests
have been adapted to match.

Weldr tests have been updated in several ways:
- The test_distro content resolver is used to resolve manifest content
  before serializing.
- The test scenarios in TestCompose have been named for easier
  troubleshooting (easier to identify a failing test by name).
- Manifests that work with the secondary ostree repo (the "other") use
  the appropriate URL and ref and create a secondary "other" serialized
  manifest.

The weldr API's test flag for resolving ostree commits does not produce
the same, fixed hash every time but instead computes a sha256 from the
URL + ref, like we do in the test manifests.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
aa4fa91214 distro/test: use the new ContentTest pipeline
Use the new ContentTest pipeline to define a manifest instead of
assigning content to the manifest directly.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
8638fe19d8 manifest: empty content-only pipeline for testing
Define a public pipeline implementation that allows initialising with
content, serialising with resolved content, but produces no stages.
This is useful for testing.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
4a37a0517f cloudapi: generate manifest once
Initialise the manifest only once in the enqueue functions
(ImageType.Manifest()) and pass it to the manifest generation function
with the workers and the dependency IDs.  The function is renamed from
generateManifest() to serializeManifest() to reflect its new
functionality more accurately.  The arguments to the function have also
been trimmed since we no longer need the image type, blueprint, and
image options.

The new functionality of the function is to collect all the resolved
content from the workers and serialize the manifest object.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
6e4efabf24 cloudapi: use manifest content to resolve containers
Use the container sources provided by the content on the initialised
manifest instead of the blueprint to resolve containers.  The container
sources on the manifest are a map keyed by the name of the pipeline that
will use the resolved containers, but the worker's container resolve job
works on a slice, so we reread the content map to get the pipeline name
(instead of taking the first payload pipeline from the image type).
This requires that there be only one pipeline that embeds containers,
which currently true of all our image types.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
962399d18a cloudapi: use manifest content to resolve ostree commit
Use the commit sources provided by the content on the initialised
manifest instead of the image options to resolve commits.  The ostree
sources on the manifest are a map keyed by the name of the pipeline that
will use the resolved commit spec, but unlike with the package sets, the
worker's commit resolve job works on a slice, so we reread the content
map to get the pipeline name.  This requires that there be only one
pipeline that requires a resolved ostree commit, which is currently true
of all our image types.

Setting the default ostree ref on the image options before calling
Manifest() isn't needed anymore.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
d833a0c3c3 weldr: resolve ostree commits after manifest initialisation
OSTree commits are now resolved after manifest initialisation just like
packages and containers.  The test commit hash handling is moved to the
resolver function.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
33dff78846 distro/test: add ostree sources to test distro
For ostree image types in the test distro, create an ostree source spec
and return it with the rest of the content.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
5c648c78f9 distro/test: adapt manifest test to new data
Read the ostree options in the compose request into a copy of the struct
that's used to write them.
Read the ostree commits from the content part of the manifest files and
use them in the serialisation function.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
a9350d1098 gen-manifests: use sha256 to fake ostree ref resolution
When a test manifest requires a commit to be resolved for content, fake
the commit ID resolution deterministically by hashing the URL + ref.
Store the resolved commit spec with the manifest metadata alongside the
other content (packages and containers).

Also add the secrets field if RHSM is true, which is now supposed to be
done by the resolver.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
7d1ee88700 Only set URL for ostree image options in tests
In tests (and dev tools) that apply to all image types, set just the
ostree URL instead of all the options.

The default ref is handled by the image functions when needed, so it
doesn't need to be set from the caller.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
966aec464a image: add ostree commit source when initialising manifest
When initialising a manifest, use the ostree commit source spec only.
Then, when serialising, use the resolved ostree commit.
This is the same process we use for the other content types, packages
and containers.

Two new functions are defined in the distros to handle resolving the
ostree options: one for creating the parent commit source spec and image
ref for image types that have an optional parent commit (ostree commits
and containers) and one for creating the payload commit source spec for
image types that require an ostree payload (ostree raw images and
installers).
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
8a0f3ce4a3 distro: use the ostree URL when checking options
The checksum won't be resolved before initialising the manifest (where
checkOptions() is called), so we can't rely on it for validating
options.  Instead, we can just make sure that the URL was provided, when
required by the image type.

Also, if a parent ref is specified in the options, a URL *must* be
specified regardless of image type, so verify this combination here
 and return the same error message that is returned from
 ostree.Resolve().

The parameter combination check will soon be removed from the
ostree.Resolve() function.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
5c921f0b27 manifest: add ostree commit source to pipelines
Add an ostree commit source (instead of a resolved commit spec) to
pipelines that support ostree commits.  Source specs are used when
initialising a manifest for package selection.  The resolved commit spec
is added after manifest initialisation through the serialization
function for stage creation.

Pipelines that require or support an ostree commit (either as payload or
a parent) must return the source specs using getOSTreeCommitSources()
after initialisation and the commit specs using getOSTreeCommits()
during serialization.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
d7a5bb99c1 ostree: replace FetchChecksum with ParentRef on ostree.ImageOptions
The FetchChecksum on ostree.ImageOptions was the resolved commit ID of
the parent ref to be pulled (for ostree commits and containers) or the
commit ID of the content ref (for ostree installers and raw images).
With the new process of manifest creation and serialisation, using the
image options to transport resolved content references is bad and
confusing.  Image options should only reflect user and image type
options before any references are resolved.  With this change, the
ostree.ImageOptions should only reflect the ostree-related options
specified by the user.  Commit IDs will only be available after the
manifest is initialised when the commit sources are resolved (before
serialisation).
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
a5e8dfec43 image: document the two ostree options on OSTreeArchive 2023-06-14 11:19:29 +02:00
Achilleas Koutsou
48ee694ff3 manifest: implement serializeStart() for ostree pipelines
Pipelines that don't require packages didn't need to implement the
serializeStart() method, but now we need to set the resolved ostree
commit spec when a pipelines requires it.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
89a398371d manifest: add resolved commit specs to Serialize()
Same as with package specs and container specs, the commit specs are
added to the manifest serialization after being resolved.
2023-06-14 11:19:29 +02:00
Achilleas Koutsou
e05d4b4a03 distro: remove unused MakePackageSetChains() function
The function hasn't been in use since we updated the image types to the
new definitions.
2023-06-14 11:19:29 +02:00
schutzbot
c47f54b8fd Post release version bump
[skip ci]
2023-06-14 08:21:53 +00:00
dependabot[bot]
055a63d71f build(deps): bump google.golang.org/api from 0.123.0 to 0.126.0
Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.123.0 to 0.126.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.123.0...v0.126.0)

---
updated-dependencies:
- dependency-name: google.golang.org/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-12 13:34:00 +02:00
Xiaofeng Wang
49bad21c45 CI: Move RHEL for Edge CI into osbuild/rhel-edge-ci repo
1. Run RHEL for Edge CI on osbuild/rhel-edge-ci repo
2. Use released RHEL 8.8 and 9.2 boot ISO
3. Extend VM memory to 3072 on ostree.sh to fix error
"Overriding memory to 3072 MiB needed for centos-stream9 network install."
4. Install and start firewalld, configure VM network as trusted zone
2023-06-12 10:00:23 +02:00
Brian C. Lane
b57a0d322f osbuild: Add validation error logging
osbuild can return a json object with details about manifest validation
errors. This adds support for saving those, and printing them when the
Write function is called. eg. when using composer-cli compose log UUID

Includes tests for new behavior.
2023-06-09 11:38:29 +02:00
Diaa Sami
8398f27742 internal/cloudapi: additional prometheus listener
Listening on another port, while keeping the existing endpoint until
transition is complete
2023-06-07 17:05:32 +02:00
Irene Diez
a8f7ff487d distro/rhel9: add the edge-ami image type based on edgeRawImage
Creates the 'edge-ami' image type based on edgeRawImage, which generates
a raw image (x86_64, aarch64) ready to upload to AWS EC2.

This 'edge-ami' image type has Ignition support.

Signed-off-by: Irene Diez <idiez@redhat.com>
2023-06-07 13:18:01 +02:00
jabia99
76b9906332 Add rpm build logs as artifacts 2023-06-06 13:51:00 +02:00
Ondřej Budai
a2342ecc5d test/aws.sh: remove enabling cloud-init and bash from the blueprint
cloud-init and bash should be everywhere. Thus, there's no point in specifying
them as a customization. Actually, it might mask error if we ever stop
installing bash/enabling cloud-init.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-06-06 13:04:10 +02:00
Ondřej Budai
790393c54e test/data: regenerate manifests
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-06-06 13:04:10 +02:00
Ondřej Budai
73c8a482f7 repositories: update fedora 37-39 snapshots
Fedora 37 and 38 still pointed at branched/rawhide, oops. Let's just update
them all.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-06-06 13:04:10 +02:00
Ondřej Budai
0edd0cb8ad repositories/fedora-39: make a forgotten s/f38/f39
One repository still pointed at fedora-38, let's fix it.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-06-06 13:04:10 +02:00