Commit graph

5075 commits

Author SHA1 Message Date
Ondřej Budai
fd72a6d16e run-koji-container.sh: drop the duplicate vhd.xz format
When the test upload a vhd.xz image to koji, it returns `koji.GenericError:
multiple matches for file extension: vhd.xz`. It seems like the default
schema is not valid for vhd.xz images because it contains two archive types
for them which koji cannot handle. I reported this issue as

https://pagure.io/koji/issue/3605

This commit works around that by removing one of the archive types, so koji
isn't confused by two same records.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-12-01 20:59:30 +01:00
Ondřej Budai
972da81a91 worker: fix reporting the import error to composer
The result variable wasn't used at all, kojiFinalizeJobResult is what actually
reports the error.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-12-01 20:59:30 +01:00
Xiaofeng Wang
afd0f7ebc7 test: Use new CS9 repo built by PR#3136
Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com>
2022-12-01 11:51:58 +01:00
Antonio Murdaca
64f1ff498b re-enable cs9 runner for simplified installer
Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com>
2022-12-01 11:51:58 +01:00
Gianluca Zuccarelli
113cda7d39 internal/worker: register status middleware
Register the custom middleware function to the worker
server. This function is responsible for recording all
the status codes of all the server's endpoints.

Due to a bug with echo/v4, a request to an endpoint using
the incorrect method should return a `405` error but returns
a `404` error instead when a middleware function is registered.
The worker `server_test` has been updated to reflect this.
2022-11-30 11:14:29 +01:00
Gianluca Zuccarelli
8b5458ae83 internal/cloudapi: register status code middleware
Register the custom middleware function to the cloudapi
server. This function is responsible for recording all
the status codes of all the server's endpoints.
2022-11-30 11:14:29 +01:00
Gianluca Zuccarelli
8756ea717d prometheus: middleware to record 5xx errors
Create a custom middleware function
to measure 5xx requests for all composer
& worker routes and not just the `/composer`
endpoint. The result is a prometheus metric
that contains info on the request status code,
path & method.

A helper function has been added to clean the
dynamic parameters in the path routes to reduce
metric cardinality
2022-11-30 11:14:29 +01:00
Gianluca Zuccarelli
33e53398a6 prometheus: add status metrics
Add a helper function to register the same metrics
for both the worker and composer - the only difference
being the subsystem name. The function checks if the
metric has already been registered and, if so, returns
the already registered metric.
2022-11-30 11:14:29 +01:00
Gianluca Zuccarelli
8e82b223af prometheus: move constants to a single file
Move the constants to a single file and export them.
These can then later be used externally for future use
with the ocm metrics.
2022-11-30 11:14:29 +01:00
Colin Walters
a3a733a638 gcp: Cross-reference to coreos-assembler code
At the moment we have duplicate logic here; ideally of course
we consolidate (since both codebases are Go, perhaps we could
create a tiny little Go library for "RHEL GCP stuff"?) but
for now let's just cross-link for awareness.
2022-11-30 11:13:31 +01:00
Tomáš Hozza
d0a3ad470d internal/rpmmd: replace RepositoryError with plain error
The `RepositoryError` structure was weirdly used instead of a plan
`error` type and added no value. Delete it and replace its only use with
plain `error`.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2022-11-30 11:04:24 +01:00
Tomáš Hozza
2c794c9e94 internal/rpmmd: delete unused interfaces and structures
Clean up the `rpmmd` package from unused interfaces and data structures.
These are leftovers after the last dnfjson rework.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2022-11-30 11:04:24 +01:00
Achilleas Koutsou
75758aee52 distro/test: set RHSM Fact API Type when testing manifests 2022-11-30 10:04:16 +01:00
Achilleas Koutsou
a9efe3ebb9 test: regenerate RHEL 9.x manifests
All RHEL 9.x manifests have been affected except edge-installer,
edge-raw-image, and edge-simplified-installer.  These are image types
that carry a pre-built payload so don't have an OS pipeline and don't
include RHSM facts.
2022-11-30 10:04:16 +01:00
Achilleas Koutsou
5cf0c336d3 distro/rhel9: add RHSM fact to RHEL 9 images
Set the API type RHSM fact in OS customizations for RHEL 9 images.
2022-11-30 10:04:16 +01:00
Achilleas Koutsou
3cff4d0c1d manifest: support RHSM facts in OSCustomizations
Add the RHSM fact to the OSCustomizations and add the stage to the OS
pipeline if the value is set.
2022-11-30 10:04:16 +01:00
Achilleas Koutsou
4bd2c0cb1d test: regenerate manifests
Regenerate manifests with the added RHSM fact.
RHEL 9 manifests haven't changed because the stage is missing in the OS
pipeline (bug).
2022-11-30 10:04:16 +01:00
Achilleas Koutsou
e3e71f01bf cmd/gen-manifests: add package-sets to repo config
Was missing the package sets key from the repo config struct, which
means that the option was being ignored and wasn't being serialised into
the test manifest either.
2022-11-30 10:04:16 +01:00
Achilleas Koutsou
de7bae02f3 cmd/gen-manifests: add RHSM fact to options
Add RHSM fact to image options when generating test manifests.
We add the value "test-manifest" to the API type to indicate it's a test
manifest.  This should never be registered and therefore shouldn't show
up in our data, but it's useful to detect changes and regressions in the
fact creation in the pipelines.
2022-11-30 10:04:16 +01:00
schutzbot
f7334287af Post release version bump
[skip ci]
2022-11-30 08:28:40 +00:00
Tomáš Hozza
c6570f6c94 CloudAPI: add description for Repository definition
Specifically describe that at least one of `baseurl`, `mirrorlist` or
`metalink` properties must be specified. Although this is not enforced
by the schema, it is the reality. Modifying the schema to enforce this
results in the generated data structure for `Repository` to be simply
an `interface{}`, which would just make the code more ugly, Therefore
this is covered by the API implementation logic.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2022-11-28 17:30:56 +01:00
Achilleas Koutsou
b3f4d75699 image: panic if unknown compression option is specified
Currently we only support "xz", but keeping it as a `switch` to easily
support more types in the future.
The empty string is also supported as a no-op.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
6374ec022d distro/rhel9: define qcow2 image type in function
The global qcow2ImgType was unconfigured and meant to be used by calling
the mkQcow2ImgType() function.  In the distro initialisation code, the
new variable created from the mkQcow2ImgType() function with the
configuration was shadowing the global variable.  This can lead to
errors in the future where it's not clear which variable is used where.

Putting the definition in a function makes it impossible to use without
configuring.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
7da0cde855 test: regenerate image-installer and edge-installer manifests 2022-11-28 17:20:49 +01:00
Achilleas Koutsou
9ae3d03f88 tools: add package to image-installer manifest request
Add podman to the image installer's packages when generating test
manifests.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
fa948b9e0b distro: set the workload for the image installer pipelines 2022-11-28 17:20:49 +01:00
Achilleas Koutsou
c6bfb22f54 manifest: support specifying kickstart file location
Add support for specifying where the kickstart file will be created:
either in the default location in the anaconda tree or at the root of
the ISO like we did so far in RHEL.

From the distro level, this is controlled by a boolean that when set to
true puts the kickstart file in the root of the ISO tree at /osbuild.ks
(the old behaviour) and if unset falls back to the default location
/usr/share/anaconda/interactive-defaults.ks.

Changed the name of the kickstart file for ostree back to osbuild.ks
Was ostree.ks for a while since a1bfcfe91c.

For Fedora we use the default and for RHEL we maintain the old behaviour
for now.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
d4a8775751 test: update installer manifests
- Added users module.
- Set squashfs compression to xz for RHEL 9.x and CentOS Stream 9.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
5d55ccf109 manifest: support specifying squashfs compression for ISOs
Add support for specifying the squashfs compression method for ISOTree
pipelines from the caller.
Build Fedora ISOs with lz4 compression and RHEL with xz.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
cb0280c8c9 image: always enable users module in anaconda
Unconditionally enable the users module in Anaconda.
The module serves two purposes:
- It will create a user that's defined in the blueprint by adding the
  user creation stage in the kickstart file.
- It allows users to create user accounts interactively during
  installation.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
11b08da7a5 distro/rhel9: cleanup: delete unused functions 2022-11-28 17:20:49 +01:00
Achilleas Koutsou
42274fd6a7 distro_test_common: refactor the kernel count test
- Add a list of image type names to skip with explanations.
- Run the test in two configurations: empty blueprint and blueprint with
  named kernel (kernel, kernel-debug).
- Count only unique kernel names.  Specifying the same kernel twice
  isn't an issue.  We might change this in the future, but for now the
  kernel selection logic is a bit messy.
- Temporarily skip the image-installer until we settle on a common rule
  for both Fedora and RHEL.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
ff494d66f6 test: update RHEL 9.x and CS9 tar manifests 2022-11-28 17:20:49 +01:00
Achilleas Koutsou
d66bc11bc7 distro/rhel9: update tar image type to new definition
Add the image function and remove the pipeline function.
Remove the build package set.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
e100c57e58 image: new ImageKind: archive 2022-11-28 17:20:49 +01:00
Achilleas Koutsou
c4af0a1886 test: update RHEL 9.x and CS9 image-installer manifests 2022-11-28 17:20:49 +01:00
Achilleas Koutsou
108ac3931b distro/rhel9: update image-installer to new definition
Add the image function and remove the pipeline function.
Remove the build package set.

The image function (imageInstallerImage) was adapted from the same one
in Fedora.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
e031b45377 distro: set ostree ref during package collection
Similar to 194351e681 and
9ae47b6843cace3c9bef55d40a33fa11d8de391a.

Manifest initialisation during package collection uses options and
customizations to determine build root packages.  Just like adding a
fake ostree checksum and an unresolved container list, we also need to
add the ostree ref, which is used to determine if a pipeline is being
generated for an ostree-based image type.

This fixes manifest generation when an ostree commit or container is
being built with an embedded container through the cloud API.  Without
this change, the python toml module is not installed in the build root
and the container storage stage fails.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
60d2a88d4f distro/test: add containers to manifest test
Read the containers from the test manifests when regenerating for the
test.
Also move the ostree option handling higher and make it cleaner.  Only
apply the values if they're specified and needed.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
8612131351 store: add containers to test 2022-11-28 17:20:49 +01:00
Achilleas Koutsou
3400c27153 test: update manifests with containers
Update test manifests that have embedded containers with the new info.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
1fc1178dea gen-manifests: save resolved containers
Store resolved container info in the test manifests so that they can be
read in the manifest unit test.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
bb75cc0947 gen-manifests: change default output directory
Change the default output directory to the one in the repo.
Originally it was set to a different directory to avoid overwriting the
manifests that had image-info, but those are long gone.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
5c8b5995bf test: update manifests with embedded containers
Updated manifests (and generated new ones) that embed a container:
- edge-commit on RHEL 9.x and CS9
- qcow2 on RHEL 9.1
- iot-commit on all Fedora versions (new)
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
c5f6aca53b format-request-map: iot-commit with container
Add manifests for container embedding in iot-commits for Fedora.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
e192cc4a18 gen-manifests: set default ref before resolving packages
Package collection reads options and customizations to determine which
build packages to pull, so we must set the default ref early if it's
needed.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
09903bd0db manifest: support for container embedding
Adding support for container embedding.
The containers need to be specified in the image function (imageFunc)
arguments and when specified, propagate down to the OS pipeline
generator to add the necessary stages.

Support is added for RHEL 9.x and Fedora.

Requires a temporary container spec array with the info from the
blueprint for the first initialization of the manifest that's needed
when collecting required packages.
This should be simplified in the future.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
c4b5c229fb distro/rhel9: delete unused pipeline functions 2022-11-28 17:20:49 +01:00
Achilleas Koutsou
5086f1e413 test: update RHEL 9.x and CS9 gce manifests
Regenerate manifests for the gce and gce-rhui image types with the
rewritten definitions:
- remove unnecessary RPMs in the build root
  artifact
- some stages changed order, but the pipelines be functionally
  equivalent
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
2369869db7 distro/rhel9: update gce images to new definitions
add the image function and remove the pipeline function.
Remove the build package set.

Parameterise image config creation functions so that RHSM is added
conditionally based on distro name, like we did for AMI/EC2.

image: set the raw filename for the GCE image type

GCP requires that the raw image file inside the archive be named
'disk.raw'.  We set it on the imagePipeline while instantiating the
manifest as a workaround for now.

This should be changed to be configurable on the image type when
necessary, the same way the final filename is defined.
2022-11-28 17:20:49 +01:00