Commit graph

2266 commits

Author SHA1 Message Date
Chloe Kaubisch
4c800f29a7 worker: add metrics
use prometheus to gather metrics
2021-07-23 21:54:28 +02:00
Brian C. Lane
b5987a5ca5 Add repository file for RHEL 8.4 2021-07-22 15:34:32 +01:00
Ondřej Budai
e1462e261d mockbuild: add rhel 9
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-22 16:46:58 +03:00
Ondřej Budai
3ec917062f ci: upload rpms built in RHEL 8 CDN buildroot into rhel-8-cdn directory
Let's explain how RPMs for RHEL are built:

We use a subscribed RHEL 8.x machine and mock build these on it. Mock
initializes its own buildroot based on the latest RHEL 8 CDN content, see[1].
This means that the minor version of the buildroot is independent of the minor
version of the host.

However, we currently upload RPMs to a directory whose name consists also of
the minor version of the host. Our hosts are currently running RHEL 8.3 so
the RPMs are uploaded into rhel-8.3 directory despite them being built in the
RHEL 8.4 buildroot (RHEL 8 CDN buildroot specifically). This means that
we cannot guarantee that they are installable on RHEL 8.3 which is weird.

This commit adds a special case for hosts that run on subscribed RHEL and
thus build RPMs in a buildroot constructed from RHEL CDN. These RPMs are
now uploaded into rhel-8-cdn directory. This change more accurately reflects
the way we build our RPMs and removes some confusion.

Also, we need to bump osbuild commit so we have a version that already has
the rhel-8-cdn change in it.

[1]: https://github.com/rpm-software-management/mock/blob/main/mock-core-configs/etc/mock/templates/rhel-8.tpl#L37

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-21 20:02:03 +02:00
Ondřej Budai
298526d2af mockbuild: register the instance at the beginning
So we can check if the machine is subscribed in the script.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-21 20:02:03 +02:00
Thomas Lavocat
cfc91a3eb6 CloudAPI: Invalid package set returns 400
Previously a bad error code was returned, fixes #1477.

Testing:

I have two test cases to test the solution. The first is a request that
makes depsolve crash by changing the dnf-json script by an almost empty
one that only throws an exception. The second one fails because it
requests a non existing package. The former ends with a 500 error and
the later with a 400.

----8<-----

HTTP/1.1 500 Internal Server Error

Failed to depsolve base packages for ami/x86_64/centos-8: ailed to
depsolve base packages for ami/x86_64/centos-8: unexpected end of JSON
input

----8<-----

HTTP/1.1 400 Bad Request

Content-Length: 226Failed to depsolve base packages for
ami/x86_64/centos-8: DNF error occured: MarkingErrors: Error occurred
when marking packages for installation: Problems in request:
missing packages: jesuisunpaquetquinexistepas_idonotexist
2021-07-21 16:21:15 +02:00
Jakub Rusz
76b2579c4b CI: update terraform sha
This change contains increased Openstack runners limit. This will
help running the CI more smoothly.
2021-07-21 13:04:51 +02:00
Achilleas Koutsou
583bfc0b4a test/cases/ostree: save build logs and manifests
Copy log and manifest for each build to the ci-artifacts/ directory to
be stored at the end of the build for troubleshooting.
2021-07-21 11:21:42 +02:00
Achilleas Koutsou
720ffbfbb7 ci: save everything under ci-artifacts
A general purpose artifact save directory where test scripts can add
files to be saved.
2021-07-21 11:21:42 +02:00
Martin Sehnoutka
b7df6ac627 devcontainer: introduce VSCode dev container
Introduce Dockerfile and devcontainer.json specifying how to build and
run a containerized development environment in VSCode.

The configuration is inspired by the osbuild repo where a similar
configuration directory already exists.
2021-07-20 23:04:41 +02:00
Yuxin Sun
471353db60 test: Add Fedora 33 ostree test back
Signed-off-by: Yuxin Sun <yuxisun@redhat.com>
2021-07-20 21:18:02 +02:00
Yuxin Sun
c09638efe5 test: Fedora error/fail logs should not be a must
Signed-off-by: Yuxin Sun <yuxisun@redhat.com>
2021-07-20 09:56:38 +03:00
Tomas Hozza
044fa0ffaf news: document changes to osbuild integration done in PR#1525
Add news entry for changes merged as part of PR#1525 [1].

[1] https://github.com/osbuild/osbuild-composer/pull/1525

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-07-19 21:37:15 +02:00
Tomas Hozza
5359ff8da7 osbuild2: use type aliases for unexported types to prevent recursion
Some osbuild stages added as part of PR#1525 declare unexported types
which are complete copies of types with custom MarshalJSON method,
 to prevent recursion when marshalling to JSON.

Modify relevant osbuild stages to use type alias instead of declaring a
complete type copy.

https://github.com/osbuild/osbuild-composer/pull/1525

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-07-19 21:37:15 +02:00
Tomas Hozza
2be664de38 osbuild2: rename profile_id to profile in authselect stage
Reflect https://github.com/osbuild/osbuild/pull/729 in osbuild-composer.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-07-19 21:37:15 +02:00
sanne
234c51e562 distribution: Spell osbuild-composer correctly 2021-07-16 12:14:46 +02:00
sanne
7555ed7556 worker: Merge configs 2021-07-16 12:14:46 +02:00
Jakub Rusz
c865f75232 ci: move centos API tests to aws
Missed it during ac7c5c89022785302d339c9cbb3c14153429feec
2021-07-16 10:59:15 +02:00
Jakub Rusz
ab3234260a tests: fix wrong default value in azure.sh test
It's not possible to create vm with the single quotes in the name.
Removing it to enable running locally.
2021-07-16 10:59:15 +02:00
Tomas Hozza
3a0540dff0 test/api.sh: randomize used GCP zone from the region
The `api.sh` test currently always defaults to "<REGION>-a" zone when
creating instance using the built image. The resources in a zone may get
exhausted and the solution is to use a different zone. Currently even a
CI job retry won't help with mitigation of such error during a CI run.

Modify `api.sh` to pick random GCP zone for a given region when creating
a compute instance. Use only GCP zones which are "UP".

The `cloud-cleaner` relied on the behavior of `api.sh` to always choose
the "<REGION>-a" zone. Guessing the chosen zone in `cloud-cleaner` is
not viable, but thankfully the instance name is by default unique for
the whole GCP project. Modify `cloud-cleaner` to iterate over all
available zones in the used region and try to delete the specific
instance in each of them.

Make `ComputeZonesInRegion` method from the `internal/cloud/gcp` package
exported and use it in `cloud-cleaner` for getting the list of available
zones in a region.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-07-16 10:14:30 +02:00
Tomas Hozza
1fd151ce28 test/api.sh: fix generation of predictable TEST_ID in GitLab CI
The `test/cases/api.sh` script relied on environment variables specific
to Jenkins for detecting it if is running in a CI environment. If this
was the case, it used other environment variables to construct a
predictable `TEST_ID` which could be used for names of resources created
in cloud-provider environment as part of the test. This is important to
ensure that `cloud-cleaner` can "guess" resource names and delete them
in case the test script fails to clean up after itself.

With the move from Jenkins to GitLab CI, this stopped to work and the
script started to generate random `TEST_ID`, which can not be guessed by
the `cloud-cleaner` tool.

Modify the `test/cases/api.sh` to detect the CI environment using the
`CI` environment variable, which is always predefined in the GitLab CI
environment [1].

[1] https://docs.gitlab.com/ee/ci/variables/predefined_variables.html

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-07-16 10:14:30 +02:00
Tomas Hozza
a9ecf5a839 image-info: cover situation when /boot is on a separate partition
Some images with ESP, e.g. the `rhel-ec2-aarch64`, have the `/boot` on
a separate partition. `image-info` currently produces traceback on such
images, e.g.:

Traceback (most recent call last):
  File "/home/thozza/devel/osbuild-composer/./tools/image-info", line 1997, in <module>
    main()
  File "/home/thozza/devel/osbuild-composer/./tools/image-info", line 1991, in main
    report = analyse_image(target)
  File "/home/thozza/devel/osbuild-composer/./tools/image-info", line 1863, in analyse_image
    append_partitions(report, device, loctl)
  File "/home/thozza/devel/osbuild-composer/./tools/image-info", line 1849, in append_partitions
    append_filesystem(report, tree)
  File "/home/thozza/devel/osbuild-composer/./tools/image-info", line 1809, in append_filesystem
    with open(f"{tree}/grub2/grubenv") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp3i__6m1w/grub2/grubenv'

The reason is that `grub2/grubenv` on the `/boot` partition is a symlink
to `../efi/EFI/redhat/grubenv`. However the `efi` directory on the
`/boot` partition is empty and the ESP must be mounted to it for the
expected path to exist.

Modify `image-info` to mount the ESP to `efi` directory if it exists on
the inspected partition.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-07-15 11:32:17 +02:00
sanne
c53283f5e9 distribution: Change clouddot template to allow for unavailable pods
Because the state directory, which is still currently used, only allows
for a single pod to mount it, allow for 0 available pods when updating
the deployment. Otherwise it will block updating until the state
directory is available for mounting, which will be never.
2021-07-14 22:19:20 +02:00
sanne
d0b5aaae95 distribution: Switch to ConfigMap for configuration
This will allow us to drop vault secrets, and make it easier to
configure composer.
2021-07-14 18:43:34 +02:00
Ondřej Budai
984717628e tests: use rpmrepo for f33 aarch64
This commit also makes aarch64 and x84_64 consistent with each other
and updates the updates repos for x86_64

Fixes #1551

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-14 17:54:24 +02:00
Alexander Todorov
648bf26fca tests: Don't overwrite CI statuses on GitHub branched for nightly pipelines
Closes #1527.
2021-07-14 12:12:48 +02:00
Ondřej Budai
5e8c022e6d docs: document the release process
This commit adds RELEASING.md guide describing the process of making a new
upstream release and pushing it into Fedora and CentOS Stream 9.

Additionally, a new helper is added to the repository - update-distgit.py.
The purpose of this helper is to simplify work with the dist-git.

Random thoughts:
I decided to left off RHEL 8 because the guide would be full of internal
URLs and tools. I will probably write a similar guide for it and put it
into internal guides.

I decided to just reference the RHEL Developer Guide for CentOS Stream 9.
It's pretty well written and I didn't feel like duplicating the effort.

We should definitely switch to PR-based approach for Fedora and implement
at least some smoke tests. I believe that the current guide is good enough
and we can iterate later.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-14 12:11:35 +02:00
Ondřej Budai
f8fd3d04b8 test/fedora33: use rpmrepo instead of kernel mirrors
mirrors.kernel.org are sometimes desynchronized, and thus causing issues with
the image tests. This commit switches the image tests for F33 to use RPMRepo.

All test cases were regenerated.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-14 12:05:45 +02:00
Jakub Rusz
0b962c9185 ci: add slack notfications
This sends a message to a slack channel if a scheduled pipeline is
ran and reports either failure or success.
2021-07-12 11:21:01 +03:00
Brian C. Lane
2b99e9e894 tests: Copy over test repos for RHEL point releases 2021-07-12 08:58:42 +02:00
Brian C. Lane
b5f0400bd4 weldr: Filter the list of supported distributions
Some distributions do not have repositories and therefore cannot be
built. This filters the list of supported distributions by checking for
repos when starting up. All other requests use the api.distros list or
api.getDistro() function.
2021-07-12 08:58:42 +02:00
Brian C. Lane
fabe0d28d2 reporegistry: Add a DistroHasRepos helper function
This returns the repos and the found flag, useful for testing if a
distro has any valid repos.
2021-07-12 08:58:42 +02:00
Brian C. Lane
963ce1d050 weldr: Use host distro name from registry list
The name of the distro you get from distros.FromHost() may not match any of
the names in the registry's list. Use the actual name of the distro
instead of the mangled name.

Also removes api.distro which is unused.
2021-07-12 08:58:42 +02:00
Brian C. Lane
1aa5d49696 docs: Add release note about building for other distros 2021-07-12 08:58:42 +02:00
Brian C. Lane
b0f9d38a95 api_test: Test new source with 2nd distro 2021-07-12 08:58:42 +02:00
Brian C. Lane
f731d7a606 api_test: Test compose with 2nd distribution 2021-07-12 08:58:42 +02:00
Brian C. Lane
788daf91a4 api_test: Test projects/depsolve with 2nd distribution 2021-07-12 08:58:42 +02:00
Brian C. Lane
e010e2c421 api_test: Test modules/info with 2nd distribution 2021-07-12 08:58:42 +02:00
Brian C. Lane
2ad4b84af6 api_test: Test projects/info with 2nd distribution 2021-07-12 08:58:42 +02:00
Brian C. Lane
c9f4b1ac8b api_test: Test modules/list with 2nd distribution 2021-07-12 08:58:42 +02:00
Brian C. Lane
05f327c796 api_test: Test projects/list with 2nd distribution 2021-07-12 08:58:42 +02:00
Brian C. Lane
43171b4169 api_test: Test compose types with 2nd distribution 2021-07-12 08:58:42 +02:00
Brian C. Lane
5021ef06f7 Add 2nd distribution to the NewTestAPI function
This will help test support for multiple distributions.
2021-07-12 08:58:42 +02:00
Brian C. Lane
c1da403dc0 weldr: Use GetAllDistroSources in allRepository* functions 2021-07-12 08:58:42 +02:00
Brian C. Lane
76e65e88c8 store: Add GetAllDistroSources function 2021-07-12 08:58:42 +02:00
Brian C. Lane
e2b170e754 weldr: Check source POST for valid distros 2021-07-12 08:58:42 +02:00
Brian C. Lane
2b56e4d8e9 store: Add Distros to Source structs 2021-07-12 08:58:42 +02:00
Brian C. Lane
f79f399808 weldr: Add optional distro selection to compose/types 2021-07-12 08:58:42 +02:00
Brian C. Lane
f233f540e5 weldr: Fix PROJECTS_ERROR response 2021-07-12 08:58:42 +02:00
Brian C. Lane
881e1c5652 weldr: Add optional distro selection to projects/depsolve route 2021-07-12 08:58:42 +02:00