Commit graph

55 commits

Author SHA1 Message Date
Major Hayden
1492470d56 🤹🏻‍♂️ Prepare for multi-arch support
As we embark on a CI journey to other architectures, we need to be
explicit about choosing the right architecture for each CI node.

This is a portion of the work required for #834.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 09:37:23 -05:00
Major Hayden
0ce53cf479 Allow RHEL 8.3 failures to fail pipeline
Now that RHEL 8.3 pulls from the beta CDN, let's stop hiding the errors
and allow them to make the pipeline fail.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 08:53:23 -05:00
Major Hayden
dac085d035 🛃 Ensure the correct packages are installed
Some dnf bugs existed in early releases of Fedora 31 + 32 around
repository priorities being ignored (like BZ 1733582. Ensure that we are
running the latest version of dnf before we try to install from the mock
build repo (which has a much higher priority than Fedora's default
repos).

Also, check to see if EPEL is installed already before installing it
again.

Fixes #824. 🥰

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 08:53:23 -05:00
Major Hayden
e88b9c4bd7 🛑 Stop using internal repositories
Remove the F31/F32 internal repositories since they are causing dnf
download errors from time to time.

The 8.2 repository override should have never been there in the first
place since we're using the CDN.

The 8.3 repository is no longer needed since we can register the RHEL
8.3 instances against the staging CDN and get beta content from there.

Fixes #822.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 08:53:23 -05:00
Major Hayden
e8cae4ffc4 Run mock builds on AWS + PSI
Increase reliability and performance by running the mock builds at AWS
when PSI is having trouble.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-08 09:44:26 +02:00
Major Hayden
0579bc6385 Optimize mock build repos for Fedora
Now that we are using minimal images, we need to bring over the
optimized dnf repositories for Fedora.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-07 10:48:45 +02:00
Major Hayden
ff88691cc7 🔃 Retry mock build up to 3 times
Sometimes dnf has issues downloading RPMs or downloading the repo XML
and this breaks the mock build. Try to run the mock builds three times
before giving up.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-07 10:40:58 +02:00
Major Hayden
0c6848f946 Use minimal images for RHEL mockbuild
Now that we have minimal images built by osbuild-compsoer for CI, let's
use those for RHEL mock builds.

This PR depends on osbuild/osbuild-composer#808 to merge first.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-06 19:45:10 +02:00
Major Hayden
edb30c5d21 🚤 Enable fastestmirror for all distros
RHEL can benefit from `fastestmirror` when it downloads metadata and
packages from the EPEL repository.

Fixes #817.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-06 19:45:10 +02:00
Major Hayden
dd0fc32b02 Ensure cloud-init has finished running
We need to wait for cloud-init to be completely finished since it is
registering RHEL instances with RHN and preparing a swap file.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-30 18:28:20 +02:00
Major Hayden
9011a67dd0 Switch Fedora mock builds to minimal images
Use minimal images when building RPMs via mock on Fedora (PR for RHEL
will come later).

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-30 18:28:20 +02:00
Tom Gundersen
fe9f2c55b8 repositories/rhel-8: default to beta repos
The next release we are targeting is RHEL 8.3 Beta, switch the
repositories over.

In the future, we should distinguish between beta and non-beta based on
/etc/os-release so we don't have to hard-code this upstream.

The beta repositories are not actually available yet, so in our tests,
we have to override this again to point at the GA ones (currently 8.2).

Needless to say, this situation leaves much to be desired.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-29 16:04:38 +02:00
Alexander Todorov
5bf3af559f Shutzbot: install only osbuild-composer-tests
in order to catch missing dependencies
2020-06-24 15:14:47 +02:00
Alexander Todorov
e2619221cf CI: print the list of RPMs on the system
this will make it easier to figure out what was there before
installing SUT and help in debugging issues related to dependencies.
2020-06-24 15:13:51 +02:00
Major Hayden
bfad57bf7b CI: Retry osbuild-composer-tests installation
Reduce CI failures by trying to install osbuild-composer-tests five
times.

Fixes #784

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-23 16:19:20 +02:00
Major Hayden
4ca535c673 Add RHEL 8.3 repository override
Override the repository for RHEL 8.3 since they can't be registered yet.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-12 09:59:25 +02:00
Major Hayden
89117ebf3a Deploy quickly in CI without Ansible
Speed up the deployment during CI runs and avoid the need for lots of
extra packages to run Ansible. This gets us closer to running bare
images for each distro that better simulates a customer environment.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-11 15:58:30 -05:00
Major Hayden
d607365663 Fix image test VERSION_ID
On RHEL, `VERSION_ID` shows up as `8.2` or `8.3`, but we need it to be
just `8`.

Remove the period and everything after it in `$VERSION_ID`.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-11 15:27:06 -05:00
Tom Gundersen
2dfa0260a6 schutzbot: run image tests on RHEL for Edge
Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-11 20:44:17 +02:00
Major Hayden
d9c7c2dd0b Convert image tests to bash
Simplify the image tests with bash and allow the output to appear live
in the Jenkins interface.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-11 13:34:36 -05:00
Major Hayden
d953e5ea18 Convert base test runner to bash
Simplify the base test runner and make it easier to see the output live.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-11 11:31:13 +02:00
Major Hayden
0a7c97c97a Run tests on RHEL 8.3 nightly
Now that mock builds for RHEL 8.3 look good, add tests for RHEL 8.3
nightly builds. The tests are wrapped in `catchError()` which allows us
to fail the stage without failing the whole pipeline just because RHEL
8.3 is having a bad day.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-10 16:58:21 +02:00
Major Hayden
5b2c06b3da Use environment variables to control Ansible
Ansible configuration can be managed by an `ansible.cfg` ini file, but
setting up that file and ensuring it's always in the same place is
difficult.

Configure Ansible via environment variables instead.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-10 07:53:33 -05:00
Major Hayden
7b562d943c Expand native tests to include VHD/VMDK
Add VHD/VMDK support to the QEMU native compose/boot test.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-10 07:53:33 -05:00
Major Hayden
ffb846d3b5 Re-enable RHEL 8.3 mock build
Signed-off-by: Major Hayden <major@redhat.com>
2020-06-08 20:07:55 -05:00
Major Hayden
860bb219af Add native qcow2 boot test
Add an end-to-end qcow2 test that follows a customer's steps with
`composer-cli`. The image is booted with libvirt to allow the best
virtualization options to be chosen by libvirt. It also uses libvirt's
default network.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-08 19:38:54 -05:00
Major Hayden
5903cc42fe Run AWS test using osbuild worker code
The `osbuild-image-tests` code does a good job testing image builds for
AWS, but it doesn't use the same code paths that a customer would when
using `composer-cli`.

Add a test that builds a compose and uploads the image using
osbuild-composer and its worker. Also, build an instance in AWS based on
the image we imported and check to see if the smoke test file is
present.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-08 10:31:27 -05:00
Major Hayden
540ca29c0a
Add sudo to the osbuild-mock dnf check
This is a quick fix to add `sudo` and avoid RHSM errors.
2020-06-08 08:19:15 -05:00
Tom Gundersen
83a63aaf17 distro/rhel8: add tar image type for all architectures
This is a very minimal image type, which is not expected to do anything
with an empty blueprint. It is documented as a way to install RHEL for
Satellite.

This fixes #720.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-08 13:32:59 +02:00
Major Hayden
904750965a
Only run image tests in PSI
AWS has no nested virtualization.
2020-06-05 13:13:52 -05:00
Major Hayden
4364b0a181 Add CI details script
Dump the machine specs for the system running the CI job very early
during the job run.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-05 19:54:57 +02:00
Major Hayden
c8666061f0 Use S3 for CI repositories
Upload artifacts from the mock builds into S3 to allow us to burst into
AWS when needed.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-05 09:37:47 -05:00
Major Hayden
70fa9e4696 Fix the AWS_BUCKET check
Ensure that AWS tests are run if the AWS_BUCKET environment variable is
set.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-01 11:46:52 -05:00
Major Hayden
4842d144aa CI: Store RPMs by SHA
Store RPMs in object storage based on their SHA rather than the Jenkins
build ID. This allows tests to be re-run without repeating the mock
build step.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-29 22:30:22 +02:00
Major Hayden
4dc48b2897 CI: Remove journald_cursor play variable
This variable is no longer needed since the bash script handles the
cursor.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-28 07:29:35 +02:00
Major Hayden
18fe05f686 CI: Use RHEL 8 CDN subscribed instance
Replace RHEL 8.2 nightly images with a RHEL 8 CDN subscribed instance so
we can test with the exact content a customer would have.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-28 00:22:25 +02:00
Tom Gundersen
e2c14b9fe6 distro: drop legacy image types
We do not properly test, and do not have properly defined use-cases for
the ext4-filesystem, partitioned-disk, nor tar image types. Drop them to
focus on delivering the things we car properly test.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-05-27 16:20:35 +02:00
Major Hayden
eca999be4a
Add sudo to dnf list command
Bringing over the fix from ansible-osbuild
2020-05-22 14:03:46 -05:00
Major Hayden
1e29ab291e CI: Add mock builds for RHEL 8.3
Now that mock building seems to be stable, let's start building RPMs for
RHEL 8.3 so we can onboard it for base/image testing soon.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-21 08:56:53 -05:00
Major Hayden
d92a742f28 Build in a mock chroot first
Build the RPMs in a mock using a simple script so that ansible-osbuild
can focus fully on deployment rather than compiling RPMs.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-20 23:11:16 +02:00
Major Hayden
62f61d34c2 CI: Skip AWS test if bucket missing
The osbuild CI uses the osbuild-composer CI testing playbooks but
there's no need to run the EC2 import for osbuild's CI. Add a check in
the Ansible playbook to look for the AWS_BUCKET environment variable and
skip the EC2 import if the bucker variable is missing.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-20 14:01:00 -05:00
Major Hayden
63c59b2ca1 CI: Run EC2 tests for all instances
Now that EC2 image testing is working well for Fedora 32, enable it for
all of the distros. Also, make it less special and allow it to run with
the other image tests.

Remove the `ami-boot` test from the list of regular image test cases
since it will be thoroughly tested via an import into AWS.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-20 12:01:38 -05:00
Lars Karlitski
e4df938152 schutzbot: remove all timeouts except the global one
When we ran into these timeouts, they were always false negatives. It is
hard to find right values for them.

If someone does introduce a bug that hangs one of the tests, we still
have the global timeout.

Fixes #648
2020-05-20 07:21:13 -05:00
Major Hayden
d4b7c1d0c7 CI: Test EC2 import and boot
Build an AWS AMI image, upload it to S3, import it into EC2, and boot
it.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-18 10:27:24 -05:00
Major Hayden
d1a0d04b92 Add three hour timeout to test pipelines
If a pipeline runs for three hours, stop the pipeline. This can happen
if a network connection breaks down or if jenkins loses control of one
of its agents due to infrastructure issues.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-18 08:51:44 -05:00
Ondřej Budai
32c7a90464 schutzbot: add missing image tests
openstack and ami images weren't built by Schutzbot. This commit fixes it.
2020-05-15 18:47:54 +02:00
Major Hayden
efed778006 Add RHEL 8.2 testing
Run the base and image tests on RHEL 8.2. 🚂

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-15 08:57:17 -05:00
Major Hayden
e8429fc3ed CI: Gather log artifacts
Ensure that logs are artifacted after a test run. Also, ensure that
these logs are in unique directories so that they are not overwritten by
Jenkins as it builds the final artifact archive.

For example, if two jobs have a `test.log`, Jenkis will only keep one of
those logs. Each log must be named differently or placed in a unique
directory.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-14 11:54:14 -05:00
Major Hayden
f36a5bbb0b CI: Use Jenkins' merged repo for testing
When Jenkins clones a repository for testing, it does the base clone
first and then merges the code from the PR afterwards. This ensures that
the code merges properly and is tested properly, but it also makes a SHA
that only exists inside Jenkins. 😢

Tell ansible-osbuild to use the repository that Jenkins made so that the
SHA is valid.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-14 09:10:20 -05:00
Major Hayden
4aeb6f2b28 CI: Split image tests into separate tasks
Make it easier to see progress in Jenkins for image tests and keep their
logs separated for easier diagnosis of problems.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-14 00:32:34 +02:00