Commit graph

205 commits

Author SHA1 Message Date
Jozef Mikovic
165ecafeb2 test: use DISTRO_CODE to select tests case
Using DISTRO_CODE simplifies test case selection and allows to test
different distro than the one test is running on.
This is used to run tests for RHEL 9.0 on F33 or RHEL 8.4
2021-03-26 14:05:20 +00: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
Ondřej Budai
9eb2268ffe test/nightly: fix the repository json
Trailing commas are a big no-no for json.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-03-23 09:25:20 +00:00
Aleksandar Todorov
c2dc9d65fb tests: Enable RT repository for nightly test jobs 2021-03-22 15:12:23 +01:00
Xiaofeng Wang
5445acb0cc test: Update ostree-ng to support container and installer tests
The ostree-ng will only be run on RHEL 8.4 because
rhel-edge-container and rhel-edge-installer image type are
supported by RHEL 8.4 only
2021-03-17 18:12:17 +00:00
Ondřej Budai
a6bc07fac0 schutzbot: run the CS8 integration test on AWS
I think there's currently no reason to run it on PSI.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-03-16 12:07:55 +01:00
Aleksandar Todorov
2bcd040b4a schutzbot: Fix wrong COMPOSE_ID URL 2021-03-16 09:10:38 +01:00
Ondřej Budai
d6afdda82f schutzbot: evaluate the when block before an agent is started
By default, a when block is evaluated after an agent is started. I discovered
this randomly: I opened a pipeline and saw that it was stuck on "Prepare EL8
internal 🤔" stage even though the pipeline should have even run it.

This commit fixes it by adding "beforeAgent true" to all when blocks. It
changes the behaviour to more sane "if when is true, allocate an agent".

See https://www.jenkins.io/doc/book/pipeline/syntax/#evaluating-when-before-entering-agent-in-a-stage

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-03-15 17:58:51 +00:00
Tomas Hozza
aa1d038b59 cloud-cleaner: clean up image and vm after GCP integration test
Extend internal GCP library to allow deleting Compute Node image and
instance. In addition provide function to load service account
credentials file content from the environment.

Change names used for GCP image and instance in `api.sh` integration
test to make them predictable. This is important, so that cloud-cleaner
can identify potentially left over resources and clean them up. Use the
same approach for generating predictable, but run-specific, test ID as
in GenerateCIArtifactName() from internal/test/helpers.go. Use SHA224
to generate a hash from the string, because it can contain characters
not allowed by GCP for resource name (specifically "_" e.g. in "x86_64").
SHA-224 was picked because it generates short enough output and it is
future proof for use in RHEL (unlike MD5 or SHA-1).

Refactor cloud-cleaner to clean up GCP resources and also to run cleanup
for each cloud in a separate goroutine.

Modify run_cloud_cleaner.sh to be able to run in environment in which
AZURE_CREDS is not defined.

Always run cloud-cleaner after integration tests for rhel8, rhel84 and
cs8, which test GCP.

Define DISTRO_CODE for each integration testing stage in Jenkinsfile.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-03-15 16:48:40 +00:00
Aleksandar Todorov
0716c32e97 tests: Refresh COMPOSE_ID file if COMPOSE_URL was defined from ENV 2021-03-15 14:20:25 +02: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
Aleksandar Todorov
6c546fa257 Schutzbot: Start building & testing on aarch64 for RHEL/CentOS
For now we're testing only on released streams in AWS because
we don't have aarch64 support in PSI.
2021-03-12 11:59:21 +00:00
Aleksandar Todorov
b5a1d89e45 tests: Save osbuild-composer.repo file under artifacts
makes it easier to grab if we need it for manual testing or
in case one needs to download the RPMs from Schutzbot
2021-03-11 11:01:20 +02:00
Ondřej Budai
ec7783324c test/azure: use eastus location
We use this location on Image Builder, let's also use it here to catch issues.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-03-08 18:22:27 +01:00
Aleksandar Todorov
b1fc31060f Don't check branch name when deciding if build was started by cron
because we already have cron jobs on multiple branches!
2021-03-08 12:22:26 +02:00
Tom Gundersen
c7adc9128a Schutzbot: don't block on container build
Move the container build to the same phase as the RPM builds. This does not make a huge difference, but should
shave off about two minutes of total CI runtime.
2021-03-07 11:09:00 +01:00
Tom Gundersen
cc80957d1e schutzbot/integration/el8: add azure creds
This was left out from the EL8 test case, include the
same creds as in the other cases.
2021-03-06 15:40:48 +00:00
Ondřej Budai
fa9fc890c9 test: add integration test for the azure upload
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-03-06 15:40:48 +00: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
Tomas Hozza
31d4d4648f test: Test GCP upload as part of cloudapi test case
Refactor test/cases/api.sh to incorporate testing of cloudapi with
multiple cloud providers as the target. Since all variables in Bash are
by default global, don't declare them as empty in advance. The only
place where underclared variables can be potentially expanded are the
cleanup functions. Ensure that there are no unbound variables expanded
inside cleanup functions. Rename all AWS-specific variables to
contain "AWS_" prefix to make their purpose explicit.

Modify provision.sh to append the GCP credentials file path to the
worker configuration.

Add GCP api.sh test case to integration tests in Jenkins and run it only
if the appropriate GCP credentials environment variable is defined. Run
the GCP test case for RHEL images.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-25 18:44:21 +00:00
Ondřej Budai
ce23f97cb9 schutzbot: move koji-osbuild revdep test to Fedora 33
Fedora 32 will be soon EOL, let's prepare for it sooner rather than later.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-23 14:51:04 +01:00
Tom Gundersen
e77483f007 test/ostree: add a second ostree test to test new features
We are gaining new ostree features that overlap to a great deal
with the current ones. We still need to keep the current features
for backwards compatibility, so add another test run that does the
same but using new API.

For now this simply uses the `url` parameter rather than `parent`
to build update commits. Further changes will be made in follow-up
commits.

Use `curl` rather than `composer-cli` as we have a chicken-and-egg
problem where we can't land this feature without tests, but
`composer-cli` can't add support for it without having it first in
`composer`.
2021-02-20 14:53:49 +01:00
Ondřej Budai
7f4aaa8db6 schutzbot: add mockbuild for Fedora 34
It's coming!

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-18 13:07:28 +01:00
Aleksandar Todorov
748519a104 Schutzbot: ping on nightly test results 2021-02-17 10:15:35 +01:00
Jozef Mikovic
5a9d2fe8b1 test: Add integration test for VMWare upload 2021-02-16 19:06:01 +00:00
Ondřej Budai
a85511c6de schutzbot: fix the pipeline
https://github.com/osbuild/osbuild-composer/pull/1228 was merged with
a failing Schutzbot's pipeline. The failure is caused because `var` apparently
isn't a right Groovy syntax. Let's use the right word `def` instead.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-16 14:19:25 +01:00
Ondřej Budai
2b823b97ad ci: run the nightly test only on the main branch
Currently, all PRs trigger the daily nightly testing. Let's limit that to just
the main branch.

I found this here:
https://stackoverflow.com/questions/39168861/build-periodically-with-a-multi-branch-pipeline-in-jenkins

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-02-16 11:00:46 +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
Aleksandar Todorov
f56a07472a schutzbot: Use 8.4 nightly b/c latest is now 8.5 2021-02-12 14:22:04 +01:00
Aleksandar Todorov
4787fce3b7 Unstash rhel8nightly repo & json files
- even if they don't exist sometimes but ignore the errors
- make the nightly repository with a higher priority
- override rhel-8*.json files so that newly built images will
  also consume the nightly content
2021-02-12 14:22:04 +01:00
Alexander Todorov
4cd6b37ea4 Schutzbot nightly: download osbuild-composer-tests from Brew
because -tests.rpm isn't shipped with the distro the prepare
script downloads it from Brew, trying to match the same version
that exists in the actual nightly compose. Then prepares a repo on
S3 for the subsequent test jobs to use!

Use AWS_CREDS for ~/.s3cmd
2021-02-12 14:22:04 +01:00
Alexander Todorov
272cc434ad Schutzbot: send Telegram messages for RHEL nightly test status 2021-02-12 14:22:04 +01:00
Alexander Todorov
d08a8fce69 Use conditional steps in EL8 nightly pipeline. Refs #912
- use detect_build_cause() funtion and set a global env.BUILD_CAUSE
  variable for use in conditionals
- add a cron job trigger - this will work together with the
  GitHub pull request trigger
- use conditional blocks for all steps we want to be executed
  outside of cron jobs
- only EL8 jobs will be executed unconditionally, both in cron
  and for PRs. The preparation stage for cron jobs makes sure to
  use the same name for osbuild-mock.repo so that the jobs can
  unstash it later!
2021-02-12 14:22:04 +01:00
Major Hayden
538f64eb67 Send webhooks without credentials
We can now send webhook data to an SQS queue at AWS without signing the
request with credentials. This allows us to trigger Schutzbot from
forks and from branches on the main repository.

Signed-off-by: Major Hayden <major@redhat.com>
2021-02-10 18:31:56 +00:00
Major Hayden
51aa1c771c Trigger schutzbot using github actions
Signed-off-by: Major Hayden <major@redhat.com>
2021-02-10 08:38:42 +01:00
Ondřej Budai
c03296b3f8 schutzbot: prolong the timeout to 12 hours
With our limited number of machines in OpenStack, we cannot run unlimited jobs
in parallel. When there's a lot of activity in the repository, there's a high
probability that a job must wait for a free VM for quite a long. In these cases,
tests commonly fail due to the timeout.

I decided to prolong the timeout to 12 hours. This should lower the amount of
these kinds of jobs.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-01-16 13:36:47 +01:00
Tom Gundersen
c3185466ae containers: simplify Dockerfile and container build
This changes the following:
 - Only produce one container. There is no particular benefit to
   supporting several different base containers, so unify on ubi
   as that is what we need ourselves.
 - Build directly from git. Now that the RPM we include in our
   container does not have any dependencies and only contains a
   couple of executables, the indirection via RPM has less value.
   Eventually the value will be reduced even further as we merge
   the entrypoint into the main binary and move dnf-json into the
   worker, leaving us with only a go binary. The only potential
   benefit might be that the build environment of RPMs is more
   clearly defined, but there is no real reason to believe that
   our mockbuild is any better than using the UBI golang build
   container.

This simplifies the container builds, and brings us more in line
with what is done in image-builder, and what is needed to deploy
to openshift.
2020-12-22 15:27:39 +01:00
Tom Gundersen
c9077c8a7f schutzbot: don't build containers for aarch64
We do not yet build all our packages for aarch64, so this would
fall back on the RPMs in the repository. In `main` that seems to
work, as osbuild-composer exists in the base repositoires. Though
we obviously want to test the most recent commit, not the released
RPM, so this is maksing the problem.

As of this PR, the build would fail though: We are now build
UBI containers, where osbuild-composer does not exist, and we have
split the RPM into the new osbuild-composer-core, which does not
yet exist in any base repository.
2020-12-18 22:53:07 +01:00
Tom Gundersen
397c374b8b schutzbot/containerbuild.sh: add ubi8
In addition to the fedora containers, also build an ubi8container,
which is needed to deploy into our OpenShift instance.
2020-12-18 22:53:07 +01:00
Ondřej Budai
d423007482 tests: move the epel dependencies to provisioning
koji and ansible are not in RHEL repositories. Depending on them breaks RHEL
gating (see OSCI-1541): It tries to build a custom image with -tests package
in it but in the build environment there's no EPEL.

This commit makes the RPM independent from EPEL. However, we still need koji
and ansible, so the provision script now enables EPEL and installs the packages
from there. This is not nice but we have to live with that until OSCI-1541 is
solved.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-18 09:04:38 +01:00
Ondřej Budai
a1b730d536 tests: pre-install EPEL for koji-osbuild rev dep test on RHEL
koji-osbuild-tests depends on koji which is not available in RHEL. As we need
to get rid of EPEL from deploy.sh (see the following commit), we need a
mechanism to preinstall EPEL before koji-osbuild-tests is installed. This
commit introduces pre_install_packages to Schutzfile - a simple way to
install packages before ${PROJECT}-tests is installed.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-18 09:04:38 +01:00
David Rheinsberg
21c7b7463c containers: add containerized osbuild-composer
Add a Dockerfile that creates a container based on Fedora with
osbuild-composer deployed. Create a suitable entrypoint that runs
osbuild-composer in the container and creates the required sockets
without systemd.

To test this, build the container via:

    docker build ./containers/osbuild-composer

Then create your certificates in /etc/osbuild-composer/. Then run
composer with something like:

    docker run --rm -v /etc/osbuild-composer:/etc/osbuild-composer <id>

(Where <id> is the container ID returned by `docker build`.)
2020-12-17 12:46:59 +01:00
Ondřej Budai
cbc9082fac tests: move the libvirt test logic out of Jenkinsfile
All tests in /usr/libexec/tests/osbuild-composer should be able to run without
any arguments. This was not a case of libvirt.sh - it required two arguments
set by some Jenkinsfile logic.

This commit moves test/cases/libvirt.sh to tools/libvirt_test.sh and extracts
the logic controlling the test case from Jenkinsfile to test/cases/libvirt.sh.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-02 08:44:33 +01:00
Ondřej Budai
8963613e91 tests: rename qemu test to libvirt test
This test case doesn't use qemu directly, libvirt is more appropriate name.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-02 08:44:33 +01:00
Ondřej Budai
2fa76da211 schutzbot: use the new obudai's ssh key
RSA is from 70s, let's use some curves instead.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-01 08:27:44 +01:00
Ondřej Budai
648fcb395b schutzbot: enable mockbuild & subset of tests on F33 aarch64
This commit enables:

- mockbuild for F33 aarch64
- base tests for F33 aarch64
- ami image test for F33 aarch64

This is mostly a MVP - enabling more tests would require more work than I have
a capacity for right now. Still, it gives us at least some coverage for
alt-arches. Most importantly, base tests build qcow2 and image tests build ami
so we have at least some trust that image building for aarch64 works.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-01 08:27:44 +01:00
Ondřej Budai
953dd0f344 schutzbot: add cloud cleaner to F33 image tests
It was missed by a rebase probably.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-12-01 08:27:44 +01:00
Lars Karlitski
dcbf490189 schutzbot: add required env variable to 8.4 integration test
22c9f6a introduced a new environment variable to api.sh,
AWS_API_TEST_SHARE_ACCOUNT, but only set it in the RHEL 8 tests.

Seems like the corresponding branch was not rebased to a version which
already had those 8.4 tests:

    https://github.com/osbuild/osbuild-composer/pull/1098
2020-11-26 23:51:28 +01:00
Sanne Raymaekers
22c9f6af61 cloudapi: Share an ec2 snapshot/ami with an account 2020-11-26 13:08:18 +00:00