Commit graph

75 commits

Author SHA1 Message Date
Tom Koscielniak
804932f2ad tests/CI: Fix RHEL 10 mock config creation and repo URLs
Fix RHEL 10 mock confings not being created if the machine was subscribed and fix RHEL 9 being used in the RHEL 10 mock confings for a repo path.
These issues caused the rpm jobs for RHEL 10 GA to fail.
2025-07-21 13:04:03 +02:00
Tomáš Hozza
61036b87bb mockbuild.sh: temporarily base missing el10 mock template on el9
There is no RHEL-10 mock template yet. Let's base it on RHEL-9 template
with a few tweaks.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-23 12:14:13 +02:00
Tomáš Hozza
9c9a3b7937 mockbuild.sh: add workarounds for c10s and el10
Add workarounds needed for mockbuild.sh to work on c10s / el10, due to
non-existent EPEL-10 and issues on c10s.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-07-23 12:14:13 +02:00
Achilleas Koutsou
5a337cd274 mockbuild: add a swapfile to el8 aarch64 builds
The pulp client is very large and defines a lot of symbols in on
package, which causes very large memory usage on el8 aarch64 (presumably
because of 64k page sizes).
Adding a 1 GiB swapfile fixes the issue in our CI runners.
2023-10-18 21:14:46 +02:00
Ondřej Budai
e40fe408d9 mockbuild: always install podman
Mock now uses podman for a bootstrap

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-08-22 10:12:13 +02:00
jabia99
76b9906332 Add rpm build logs as artifacts 2023-06-06 13:51:00 +02:00
Tomáš Hozza
808118431f mockbuild.sh: use dnf to install local package, not rpm
DNF has more elaborate locking system and can wait for other instances of
itself when installing packages. Using rpm directly to install local
package is causing failures in CI due to it not being able to acquire
lock on `/var/lib/rpm/.rpm.lock`.

Using DNF should improve the situation, although there is no good
documentation to link and support this claim for sure.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-04-24 20:40:58 +02:00
Sanne Raymaekers
545ce3412e schutzbot/mockbuild: stop running mock as root
Running mock as root is broken, this commit can be reverted once this is
fixed.

rhbz#2135203
2022-10-17 18:08:31 +02:00
Ygal Blum
534625fa38 Fedora - Use vendor instead of rpm dependencies
RPM Spec
--------
Remove all Go dependecies
Add Start and End marker comments for bundling information
Add '-k' to goprep to preserve the vendor directory

tools
-----
Add script to update the RPM spec file to generate the indication lines
based on vendor/modules.txt

Packit
------
Run the new script as a post-upstream-clone hook

Makefile
--------
Run the new script on the generated spec file before generating the RPM

mockbuild.sh
------------
Run the new script before creating the RPM
2022-06-23 18:02:09 +02:00
Jakub Rusz
d87c60857c mockbuild: update mockbuild script after RHEL-9 GA
Removing rhel-9 templates as they are shipped upstream already and
making necessary modifications to mockbuild.sh
2022-06-21 10:40:58 +02:00
Jakub Rusz
0aad2fa43f mockbuild: use rpmrepo in mock templates
We're using rpmrepo snapshots as system repositories on the runners, so
let's use them also for mockbuild.
2022-04-12 13:13:50 +02:00
Jakub Rusz
67c5f91ea4 mockbuild: use public EPEL-9 2022-03-09 22:03:39 +01:00
Ondřej Budai
16f6864d58 mockbuild: fix CS9 mockbuild
- name mangling from centos to centos-stream was enabled also for
  centos 9
- CS9 mock configs from mock-core-configs-36.3-1.fc35.noarch were added

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-02-18 10:39:08 +00:00
Alexander Todorov
b31f61649a ci: Overwrite REPO_PATH based on the value of $NIGHTLY
Override only for osbuild-composer, not other projects

will produce different repositories/rpms for the same commit when
executed from a PR and from the scheduled pipelines. We need the
distinction b/c osbuild-composer-tests RPMs end up slightly different in
these two cases. For more info see:
https://github.com/osbuild/osbuild-composer/pull/2093#pullrequestreview-854328838
https://github.com/osbuild/osbuild-composer/pull/2093#issuecomment-1014469915
2022-02-04 23:43:43 +01:00
Alexander Todorov
570e5f595f Relax the requirements between osbuild-composer-tests and osbuild-composer
this is only useful for our RHEL nightly pipeline testing b/c we intend
to be building the -tests RPM from the main branch.
2022-02-04 23:43:43 +01:00
Achilleas Koutsou
aea77ed3de test: timestamp messages in test scripts
The commonly used 'greenprint' function now adds a date + timestamp to
each message for debugging and tracking the duration of segments of each
scripts.
2021-10-24 16:13:53 +01:00
Ondřej Budai
65e429fc4a mockbuild: explicitly configure s3cmd
We are no longer using the variable names that s3cmd uses by default
so we need to configure it explicitly.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-10-21 07:28:46 +02:00
Ondřej Budai
99a8d67812 mockbuild: remove subscriptions
Everything is pre-subscribed.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-10-21 07:28:46 +02:00
Ondřej Budai
fbb091c8c8 mockbuild: use REPO_BUCKET when defining the base URL
Just deduplication of code.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-09-24 17:03:53 +02:00
Ondřej Budai
4c5d1ae45a test: move env variables into set-env-variables helper
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-09-24 17:03:53 +02:00
Ondřej Budai
0737136bc8 mockbuild: reuse nightly repos from redhat.repo
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-09-24 17:03:53 +02:00
Ondřej Budai
c25e58bc9d ci: assume subscribed machines
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-09-24 17:03:53 +02:00
Juan Abia
ee0af8b901 retry subscribing to RHN 2021-08-25 13:12:08 +02:00
Juan Abia
1e52484688 remove all rhn subscriptions before registering a new one 2021-08-24 11:53:08 +02:00
Alexander Todorov
42480f7b26 tests: Cleanup leftover 8.4 references 2021-08-19 12:21:52 +02: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
Achilleas Koutsou
54a811c3f1 schutzbot/mockbuild.sh: RHEL 8.5 support
Add RHEL 8.5 support to the mockbuild script.
2021-06-29 17:26:43 +01:00
Xiaofeng Wang
9a7016f451 Remove the subscription check on mock config for RHEL 8.5 2021-06-29 16:14:45 +02:00
Ondřej Budai
419ac4c769 ci: remove EXTRA_REPO_PATH_SEGMENT
EXTRA_REPO_PATH_SEGMENT was needed when both Jenkins and Gitlab CI
were running in parallel (so they don't override their artifacts).

Jenkins is now decommissioned so we can drop the variable.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-29 13:58:58 +02:00
Ondřej Budai
42e4a5f6ac ci: remove fedora 34 hack from mockbuild
This is apparently not needed anymore, I checked with 20 jobs here:
https://gitlab.com/osbuild/ci/osbuild-composer/-/pipelines/328779200

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-29 11:53:56 +02:00
Ondřej Budai
cf73edd2d2 mockbuild: use s3cmd put instead of sync to speed up the RPM upload
s3cmd sync actually downloads metadata for all objects in a s3 bucket.
We have built a lot of RPMs, thus this takes 5 minutes on AWS and 25 minutes
on my laptop (!!!).

Let's use recursive put instead. This doesn't delete any files on the remote
side. As we upload RPMs only once, this also shouldn't fail on "the
object already exists". Using this method, we should be able to upload the
RPMs in seconds.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-04-15 14:39:09 +02:00
Ondřej Budai
d28c41b844 test: subscribe only RHEL instances
GitLab CI passes secrets to all jobs. Thus, we need to make sure that
only RHEL is being subscribed.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-04-14 09:18:06 +02:00
Ondřej Budai
5fd2ad2337 mockbuild: allow inserting an extra path segment
GitLab CI builds its own rpms and thus it must be use a different path.
This commit modifies mockbuild.sh and deploy.sh to be able to add an
extra path segment into the path so GitLab can use a different path.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-04-14 09:18:06 +02:00
Jozef Mikovic
a9e8ea2a21 distro/rhel90: add RHEL9 support
osbuild-composer can now build rhel 9.0 images.
Added support is limited to qcow2 image type.
2021-03-26 14:05:20 +00:00
Aleksandar Todorov
661b2a0be0 Schutzbot: Allow overriding internal RHEL URL
by defining the COMPOSE_URL environment variable! This will allow
testing more flavors of internal releases.

The rest is renaming files and variables to reflect the fact that
we're running tests against internal trees, not only nightlies.
2021-03-12 20:38:06 +02:00
Tomas Hozza
6b67ca34ca schutzbot: Work around mock RHBZ#1931452 on F34
Mockbuild using systemd-nspawn currently fails on Fedora 34. The
workaround is to use "simple" isolation method - the traditional
chroot() call.

Reported as: https://bugzilla.redhat.com/show_bug.cgi?id=1931452

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-03-02 07:16:50 +01:00
sanne
15fa09bad2 schutzbot: Rename centos stream mock config 2021-03-01 14:48:56 +02:00
Ondřej Budai
5eb402415d distro/rhel84: add centos 8 stream support
The image definition is shared with the latest RHEL 8.y one (8.4 currently).
I expect that we the introduction of 8.5 support, we point the centos 8
distro at it.

The test repositories and manifests use the official CentOS composes. From
what I can tell, they are persistent. This is not guaranteed though, so we
might need to switch to RPMRepo at some point.

The "classic" CentOS 8 should also be buildable but due to the chicken and egg
issue (this commit will get into Centos "8.4" but Centos "8.4" isn't a thing
yet), we cannot test it and therefore it might be broken.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-14 16:08:08 +00:00
Jacob Kozol
7b40a3b38e schutzbot: add rhel 8.4 tests to jenkins pipeline
rhel 8.4 tests are added. The configs are based off of those used for
rhel 8.3. The Schutzbot Mockbuild, Base, Image, Integration, and OSTree
tests are added for 8.4. Repo overrides are added for the rhel 8.4 tests
so that the tests use rpmrepo snapshots.

The mockbuild uses the jenkins rhel84-nightly-repo credential to
override the rhel mock template's repos with rhel 8.4 nightly repos.
These repos are stored in a credential because they are internal links.

The image tests and koji tests need a special distro selector since the
rhel-8 test cases are only for rhel 8 versions less than 8.4. The rhel
8.4 tests are named with the rhel-84 pattern whereas the other rhel 8
versions have the rhel-8 pattern.

Also, instead of having only rhel-8 and rhel-8-beta repo configs for the
tests, we now have a specific repo config for each rhel release we test.
The repo is also now pulled from an rpmrepo snapshot. For whichever
distro is being tested, the approriate repo config will be copied to
/etc/osbuild-composer/repositories as rhel-8 and rhel-8-beta since this
is the naming osbuild-composer looks for. For testing purposes, the
rhel-8 and rhel-8-beta repo should be the same since eventually all rhel
releases will go from beta to not beta. The fedora repo overrides are
already done in tools/provision.sh so the rhel override is set there as
well. Currently, only rhel 8.4 requires an override.
2020-11-19 10:36:49 +01:00
Lars Karlitski
48ee71b9af mockbuild: use mock to build source rpm
Running `make srpm` on the host can have different results from building
the SRPM in mock.

Stop using the Makefile altogether for this, which is meant for
developer convenience only. The interface is clear: a tarball generated
from `git archive` and defining the `commit` variable. Less stuff to
install on the host, too.
2020-11-17 08:56:17 +00:00
Tom Gundersen
64432c706a schutzbot/mockbuild: test against osbuild in target release by default
To make sure we test against what we will release with, use osbuild from
the target distro rather than rebuilding it.

The only exception is in RHEL8.3, where we are not rebasing any longer,
but expect users who use new osbulid-composer from upstream to use it
with new osbuild from upstream too. In this case, use the RPM from
osbuild upstream, for now pinned to the same version as was in the
submodule.

This introduces a new configuration file: Schutzfile, which is meant
to contain the full test-matrix. For now it only points to the upstream
osbuild commit to add to the distro we are testing against (only relevant
for 8.3).

The submodule is now unused and is therefore removed. The produced repos
now only contain osbuild-composer, osbuild is never built as part of
osbuild-composer CI.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-11-15 14:25:50 +01:00
Lars Karlitski
ae17b5aa3c mockbuild: move installing dependencies down
These don't need to run when we're not building anything.
2020-11-12 09:41:36 +01:00
Lars Karlitski
ca3360c6d1 mockbuild: don't build repository when it already exists
This avoids doing unnecessary work and speeds up restarting tests.
2020-11-12 09:41:36 +01:00
Lars Karlitski
4bd891be9e schutzbot: don't copy dnf repo file between stages
Now that the repository URLs are predictable, don't use Jenkins' stash
feature to pass the repo file between stages.

Instead, simply create the repo file where it is needed, in deploy.sh.
2020-11-12 09:41:36 +01:00
Lars Karlitski
888e7ea910 mockbuild: don't use short commit ids
The length of these is not predictable. It depends on the shortest
unique prefix in the repository and git configuration.

Just use the full one, which also makes it easier to copy the id from
`git log` or GitHub.
2020-11-11 15:35:56 +01:00
Lars Karlitski
420ba53797 mockbuild: change repository path
Change the repository path on S3 to a more predictable one. We really
only need the name of the project (static osbuild-composer for this
repository), the name of the distro (use the same as osbuild-composer's
API for consistency) and the commit SHA.

In particular, drop the PR number / branch name. Also don't remove the
dots from version numbers. All places we're using them in (paths and
URLs) support dots.

For example, osbuild composer commit xxxxxxx for fedora-33 on x86_64
will result in this URL:

    osbuild-composer/fedora-33/x86_64/xxxxxxx
2020-11-11 15:35:56 +01:00
Lars Karlitski
acae39c905 mockbuild: move path logic into separate variable 2020-11-11 15:35:56 +01:00
Lars Karlitski
d57238869a mockbuild: remove unused variable 2020-11-11 15:35:56 +01:00