Commit graph

816 commits

Author SHA1 Message Date
Achilleas Koutsou
436d8f9b43 distro/rhel86: add RHEL 8.5 variant
Define the distribution strings for RHEL 8.5 in distro/rhel86 and add
constructors.  Remove the old 8.5 from the distro registry and use the
new constructors.

Composer can now build RHEL 8.5 image-installer on aarch64, which wasn't
supported before.

RHEL 8.5 manifests have changed to minimise the differences from 8.6.
Some changes are fixes made in 8.6 but never backported to 8.5 because
of our (older) policy of not changing definitions after the release of a
distro.
Other changes are non-functional (e.g., stage or package order).

See the list below for the source of each change.

Manifest changes:
- Stage order changed for org.osbuild.systemd-logind and
  org.osbuild.rhsm.
- org.osbuild.grub2 options: config.default = "saved"
  Reverted 111cd8871f
- Partition sizes: RHEL 8.5 had extra arbitrarily sized padding for the
  header.  Now all partitions are sized to fit headers exactly.
  Original change at b7abef54e8.
- SELinux set to permissive in Anaconda.  This was changed in RHEL 8.6
  and 9.0 but never backported to 8.5.
  See a7fbe916b7.
- Installer isolevel set to 3.  Like above, this was changed in
  8.6 and 9.0.
  Original change at d8d161480e.
- Specify a remote for edge deployments.
  Original change at b18b4e80a0.
2022-06-30 11:14:21 +02:00
Achilleas Koutsou
56e6208fcf distro/rhel86: imagetypes and packages per RHEL version
Added utility function for comparing RHEL version strings.

Conditions added:
- greenboot subpackages were changed between RHEL 8.5 and RHEL 8.6.
- fido client packages aren't available in RHEL prior to 8.6.
- the ec2 SAP image type is not supported in RHEL prior to 8.6.
- the edge-simplified-installer and edge-raw-image image types are not
  supported in RHEL prior to 8.6.
    - They were previously supported in 8.5 without FDO support, but now
      it's dropped from 8.5 completely.
2022-06-30 11:14:21 +02:00
Achilleas Koutsou
5ac0ef2f77 test: update RHEL 8.5 manifests
Package changes from RHUI repository updates.
2022-06-30 11:14:21 +02:00
Jakub Rusz
358e58f3d3 image-tests: skip azure-rhui test on rhel-86 2022-06-29 15:21:59 +02:00
Achilleas Koutsou
321295e34d test/diff-manifests: don't fail on diffs
The script isn't supposed to fail when the manifests differ.
Initialise err to 0 and assign it the exit code of the diff call if it
returns with an error.
2022-06-29 10:02:46 +02:00
Christian Kellner
dbd2ed6cc8 ci: add new container uploading test
Add a new integration test that will create a fedora container and
upload it to the gitlab container registry.
2022-06-29 10:02:46 +02:00
Christian Kellner
c5a5da5f56 distro/fedora: add container image type
Add a container image type that is based on the existing fedora
container image. There is a delta in terms of the configuration
because osbuild does not yet provide all the neccessary means,
but the package set is already very close.
2022-06-29 10:02:46 +02:00
Jakub Rusz
d136a075bc manifests: regenerate RHEL-8.6 qcow2 test cases 2022-06-29 10:15:50 +03:00
Juan Abia
fa38246575 remove test skip
COMPOSER-1397 temporarily skipped azure-rhui image. Now that we test on
rhel 8.7, this skip can be removed.
2022-06-28 15:23:52 +02:00
Jakub Rusz
0201b0bff9 tests: Update compose version in Upgrade test 2022-06-21 10:40:58 +02:00
Jakub Rusz
2eee0632d6 manifests: regenerate rhel-91-gce-boot
We don't want to do gpg check for the google repositories.
2022-06-21 10:40:58 +02:00
Jakub Rusz
70688173bb tests: update RHEL version in unsupported tests 2022-06-21 10:40:58 +02:00
Jakub Rusz
eb78fcd85e tests/koji: build latest RHEL when running on RHEL
Based on
aff680542d
this test is supposed to always build the latest available compose.
2022-06-21 10:40:58 +02:00
Jakub Rusz
5fcf0b1d53 tests/ostree: Update to support new RHEL nightlies 2022-06-21 10:40:58 +02:00
Alexander Todorov
0d3ef8817a Update repositories in repo-*.json files 2022-06-21 10:40:58 +02:00
Achilleas Koutsou
7076f9b8dc test: new script that detects changes in manifests in a PR
The script runs the gen-manifests command first on the PR head and then
on the merge-base with the PR's base branch (typically 'main') and
checks for any differences.  It creates a review comment on the PR on
GitHub if any changes are detected.

The message is posted as a simple COMMENT type review to inform the
author and reviewers that changes exist.

The script doesn't fail if there's a diff.  CI shouldn't fail if changes
are detected since they can be intentional.  The job fails if something
goes wrong with the script execution (manifest generation, comment
posting, etc).

The script exits immediately if not run from a PR.

The gen-manifests run is silenced with `> /dev/null`.  In the future,
this should be handled by flags to the command itself to control the
output format noisiness.

The gen-manifests command is run 50 workers.  Testing with 100 seemed to
make the execution stall, likely because of the resources on the worker.
We can experiment with this value more in the future.
2022-06-21 09:50:45 +02:00
Christian Kellner
c38fcb128c distro/rhel7: add support for azure images
Add support for building Azure images, including RHUI based ones for
the private market place.
2022-06-21 00:06:26 +02:00
Christian Kellner
06e05df620 distro: add support for building a rhel 7 (qcow2)
Based on the RHEL 8.6 pipelines, needs a special buildroot with two
extra packages: python3-iniparse and python3-PyYAML.
Only x86_64 support for now.
2022-06-21 00:06:26 +02:00
Achilleas Koutsou
aace1c9224 test: add new regression test for insecure downlods
Creates a dummy package and a web server with TLS and a self-signed
certificate and builds an image from the repository with `check_ssl`
disabled.
2022-06-15 20:13:47 +02:00
Tomas Hozza
09f57b6c2f api.sh: fix requesting of JWT token
`osbuild-mock-openid-provider`'s `/token` endpoint expects URL-encoded
values in the POST request body. Use the same values as those that would
be used by the worker when refreshing a token.
2022-06-10 14:48:18 +01:00
Major Hayden
26b93f8f25 Blacklist amdgpu module on Azure images
The `amdgpu` module causes issues on certain GPU-enabled instances
on Azure and it must not be loaded by default.
Modules are sorted alphabetically.

Signed-off-by: Major Hayden <major@redhat.com>
Co-Authored-By: Christian Kellner <christian@redhat.com>
2022-06-09 14:18:45 +01:00
Juan Abia
4827f0e83e add cloud-image-val to aws test
cloud-image-val is a tool that performs basic validation tests on cloud
images. Incorporate this tool in aws.sh test
2022-06-08 16:14:35 +02:00
Christian Kellner
a1306a122a distro/rhel90: remove skx_edac, intel_cstate from denylist again
In commit 5c1530e we disabled `skx_edac` and `intel_cstate` but 
after further consultation with Prarit Bhargava it was agreed that 
for RHEL 9 we should indeed allow them.
2022-06-06 08:07:26 +01:00
Ygal Blum
feb357e538 Support Generic S3 upload in Composer API
Use case
--------
If Endpoint is not set and Region is - upload to AWS S3
If both the Endpoint and Region are set - upload the Generic S3 via Weldr API
If neither the Endpoint and Region are set - upload the Generic S3 via Composer API (use configuration)

jobimpl-osbuild
---------------
Add configuration fields for Generic S3 upload
Support S3 upload requests coming from Weldr or Composer API to either AWS or Generic S3
Weldr API for Generic S3 requires that all connection parameters but the credentials be passed in the API call
Composer API for Generic S3 requires that all conneciton parameters are taken from the configuration
Adjust to the consolidation in Target and UploadOptions

Target and UploadOptions
------------------------
Add the fields that were specific to the Generic S3 structures to the AWS S3 one
Remove the structures for Generic S3 and always use the AWS S3 ones

Worker Main
-----------
Add Endpoint, Region, Bucket, CABundle and SkipSSLVerification to the configuration structure
Pass the values to the Server

Weldr API
---------
Keep the generic.s3 provider name to maintain the API, but unmarshel into awsS3UploadSettings

tests - api.sh
--------------
Allow the caller to specifiy either AWS or Generic S3 upload targets for specific image types
Implement the pieces required for testing upload to a Generic S3 service
In some cases generalize the AWS S3 functions for reuse

GitLab CI
---------
Add test case for api.sh tests with edge-commit and generic S3
2022-06-02 16:12:53 +03:00
Achilleas Koutsou
41ab3e0f44 test/old-worker: don't fail when stopping containers
Can produce an error or warning about active sockets and kill the
script.
2022-06-01 11:36:52 +01:00
Achilleas Koutsou
6019a5022f test: remove generation.sh
The script would test if the test case generation script when the script
would run normally if the osbuild-dnf-json.service was stopped.
This is no longer necessary.
2022-06-01 11:36:52 +01:00
Achilleas Koutsou
35e369f5c7 test: add test repository metadata
Metadata files for CS9 BaseOS x86_64.
This will be served by a temporary webserver for dnf-json unit testing.
2022-06-01 11:36:52 +01:00
Sanne Raymaekers
71c78991a6 cloudapi: Drop bucket from composer config
This value is set in the worker config. In future it might also be
passed through the api to upload into target accounts, but it should
never be set in composer.
2022-06-01 12:03:12 +02:00
Christian Kellner
c039a91b61 distro/rhel90: enable and configure NetworkManager-cloud-setup
Package was already installed, but we needed to enable the timer and
service and set the correct env variable via a drop-in to enable the
Azure cloud.
2022-05-31 10:22:22 +01:00
Christian Kellner
5c1530ee53 distro/rhel90: blacklist skx_edac,intel_cstate kernel modules on azure
Disabled by the MSFT images, we follow suit (really means we don't
exactly know why and should find out).
2022-05-31 10:22:22 +01:00
Christian Kellner
3b798edecb distro/rhel86: install and enable NetworkManager-cloud-setup
Install the package, enable timer and service and set the correct
env variable via a drop-in to enable the Azure cloud.
2022-05-31 10:22:22 +01:00
Christian Kellner
dc0ee05bc3 distro/rhel86: blacklist skx_edac,intel_cstate kernel modules on azure
Disabled by the MSFT images, we follow suit (really means we don't
exactly know why and should find out).
2022-05-31 10:22:22 +01:00
Christian Kellner
921c67cf1b distro/rhel90: compress azure-rhui images
Those images are forced to be 64GiB in size but mostly consist of zeros.
This makes them hard to handle, e.g. uploading to brew takes a forever.
The vhdPipelines is converted to a function returning the pipelinesFunc
and it has a single argument `compress` that will add the compression
pipeline bits if `true`. Will return exactly the old pipeline in case
of `false`.
2022-05-27 18:19:51 +02:00
Christian Kellner
5c90abdd0a distro/rhel86: compress azure-rhui images
Those images are forced to be 64GiB in size but mostly consist of zeros.
This makes them hard to handle, e.g. uploading to brew takes a forever.
The vhdPipelines is converted to a function returning the pipelinesFunc
and it has a single argument `compress` that will add the compression
pipeline bits if `true`. Will return exactly the old pipeline in case
of `false`.
2022-05-27 18:19:51 +02:00
Ygal Blum
8407c97d96 Upload to HTTPS S3 - Support self signed certificate
API
---
Allow the user to pass the CA public certification or skip the verification

AWSCloud
--------
Restore the old version of newAwsFromCreds for access to AWS
Create a new method newAwsFromCredsWithEndpoint for Generic S3 which sets the endpoint and optionally overrides the CA Bundle or skips the SSL certificate verification

jobimpl-osbuild
---------------
Update with the new parameters

osbuild-upload-generic-s3
-------------------------
Add ca-bunlde and skip-ssl-verification flags

tests
-----
Split the tests into http, https with certificate and https skip certificate check
Create a new base test for S3 over HTTPS for secure and insecure
Move the generic S3 test to tools to reuse for secure and insecure connections
All S3 tests now use the aws cli tool
Update the libvirt test to be able to download over HTTPS
Update the RPM spec

Kill container with sudo
2022-05-26 13:46:00 +03:00
Achilleas Koutsou
cd49c932a2 test: add prominent message in test script cleanup functions
When a test script fails in CI, it's often difficult to pinpoint the
exact line in the log where the script failed and the cleanup() function
(trapped on EXIT) begins.

Adding a prominent line (with greenprint where available) at the start
of the cleanup function will make reading logs of failed jobs a lot
easier.
2022-05-25 22:10:27 +02:00
Achilleas Koutsou
3667766661 test/old-worker: change user and package verification check
Something odd is happening with the package check and it keeps failing
mysteriously even though the package is clearly in the list.
Changing the verification method to extract `passwd` and `packages` from
the image info file into separate files and grepping those seems to
work.
2022-05-25 13:23:20 +02:00
Tomas Hozza
31ff2a2283 tests/gcp: pick machine type from those available in the zone
Do not rely on the default machine type when creating a GCE instance,
but rather list the available machine types in the zone and pick from
them. Test cases will pick the smallest machine type which name matches
the `^n\d-standard-\d$` regular expression.

This should prevent CI failures like
https://gitlab.com/redhat/services/products/image-builder/ci/osbuild-composer/-/jobs/2497043942#L2930
2022-05-25 09:51:37 +02:00
Christian Kellner
4c7bf735fe distro/rhel90: install nm-cloud-setup for azure-rhui
Install the "NetworkManager-cloud-setup" on Azure Marketplace images.
2022-05-23 11:02:18 +02:00
Achilleas Koutsou
472d550227 test: use cloud API for old-worker-new-composer
Reasons for this change:
- Mixed versions of composer and worker aren't a realistic use-case for
  the weldr API (on prem) but we do run mixed versions in hosted IB, so
  this test is closer to real world scenarios.
- The cloud API runs depsolve jobs in the worker, whereas the weldr API
  runs them in composer.  By testing the cloud API we also test the
  backwards compatibility of the depsolve job.

The change requires osbuild-worker v51 or newer to be able to handle
depsolve and manifest jobs on the worker as well as depsolve chains.
2022-05-19 20:03:24 +02:00
Achilleas Koutsou
b38e5f85c3 test/regression-old-worker-new-composer: clean whitespace
Clean trailing whitespace from test script.
2022-05-19 20:03:24 +02:00
Christian Kellner
4e9e438b75 distro/rhel90: add support for azure marketplace
Add support for building images for the Azure marketplace: add a
new image type "azure-rhui" that can be used to build images
tailored to the Azure marketplace.
This code is based on the corresponding image type in 8.6.

NB: does not have systemd-resovled (following RHEL 9 defaults)
2022-05-19 11:22:47 +02:00
Christian Kellner
6e2cb208bf test/data/manifests: regenerate rhel-91
It seems rhel-91 qcow2 customize images are out of sync because commit
2beb707 removed the core group from the `format-request-map.json` and
some these said manifests were generated between that commit and the
one that added it back 1ff36bce9.
2022-05-19 11:22:47 +02:00
Xiaofeng Wang
a6e2755fad test: Add running podman with non-root test
Bug BZ#2078937 has been fixed by osbuild PR#1013. Test should be
updated to test the fix and avoid regression
2022-05-17 21:25:49 +08:00
Tomas Hozza
18dfa9d9c9 Improve GCP test cases to pick regions with available quota
We currently use a single GCP Compute region when spinning up VMs using
the imported GCE image. As a result, we are often hitting the
'IN_USE_ADDRESSES' quota limit when there are multiple CI jobs running.
Google does not allow us to increase the quota limit any more.

Change the GCP test cases to use the CI `GCP_REGION` variable to list
all GCE regions with available quota and pick a random one from the
list. The `GCP_REGION` value is used as the region name prefix when
filtering available regions. This means that if you specify an exact GCE
region, such as `us-west1`, you'll always get the same region, but if a
GCP multi-region is used, such as `us`, then a random region prefixed
with 'us' will be used.
2022-05-17 12:18:12 +02:00
Christian Kellner
5983c295b3 distro/rhel86: ignore SRIOV interface via new udev rule on azure-rhui
Add a new udev rule that ignores the SRIOV network interface. See the
supplied comment for details why.
2022-05-16 15:46:46 +02:00
Juan Abia
99649ee142 generate-all-test-cases: generate all manifests
regenerate all manifests without image-info and add new ones
2022-05-13 21:01:37 +03:00
Jordi Gil
b6f61d26ea distro/fedora: extend kernel options for openstack, qcow2, vhd and vmdk types
* Use the same value from AMI to these image types:

"ro no_timer_check console=ttyS0,115200n8 biosdevname=0 net.ifnames=0"

* Regenerate manifests
2022-05-09 12:25:21 +02:00
Jordi Gil
69095f5034 distro/fedora: produce VMDK as stream-optimized
Added code in fedora/pipelines.go to add the subformat field in the
manifests

Added manifests for f34 and f35 for x86_64 only (image type not
available in aarch64)
2022-05-09 12:25:21 +02:00
Jordi Gil
3a079eec26 distro/fedora: Regenerated manifests
* IoT image types now correctly point to the fedora-identity-iot package
* QCOW2, VMDK and OCI types use Fedora Cloud as identity package
* Changed default target for AMI from graphical.target to multi-user.target. This matches the behaviour with the RHEL types, which all target the multi-user.
* Readded the image-info field for some manifests which was missing due to issues regenerating the manifests.
2022-05-09 12:25:21 +02:00