Commit graph

1387 commits

Author SHA1 Message Date
Major Hayden
d8d1db50cd 🔨 Add aarch64 mock builds
Build osbuild/osbuild-composer packages on AWS using aarch64 instances.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 12:02:43 -05:00
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
ef0826599d Fix valk > talk typo 2020-07-09 08:53:23 -05:00
Major Hayden
3113ba02d8 Install awscli version 2 for AWS tests
Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 08:53:23 -05:00
Major Hayden
030adbd18c Use staging CDN for RHEL 8.3 beta content
The RHEL 8.3 beta content is not on the main cdn.redhat.com yet.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 08:53: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
f9d70456ff 🥊 Bump osbuild submodule to v18
This fixes the missing python issues in RHEL 8.x that were fixed in v18
of osbuild.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-09 08:53:23 -05:00
Ondřej Budai
843f7701cf test/azure: don't tag the resources
The tag is not used anymore, see the previous commits.
2020-07-09 12:50:06 +02:00
Ondřej Budai
3475c54505 test/azure: fix the disk cleanup
Previously, all resouces were created with a certain tag. When the cleanup
phase came, the Resources - List route[1] was used to get all resources with
the tag. Then, they were deleted in the right order.

Sadly, the Resources - List API has issues with listing disks. Sometimes,
it returns the virtual disks 15 minutes after they were created. As the
result, the disks have been left behind quite often and our bill was higher
than necessary.

This commit uses a different method - the Go code now knows all resource names
(see the previous commit), so it can delete all resources without listing them
using the "broken" API route.

[1]: https://docs.microsoft.com/en-us/rest/api/resources/resources/list
2020-07-09 12:50:06 +02:00
Ondřej Budai
57b1788c9d test/azure: specify resource names as parameters
Prior this commit the resource names were generated in the deployment
template, so the Go code actually didn't know them. This commit generates
all names in the Go code, so they can be used in the future commits.
2020-07-09 12:50:06 +02:00
Ondřej Budai
add2ad98e0 17
Release osbuild-composer version 17
2020-07-08 17:35:27 +02:00
Tom Gundersen
5ff7fcfc3a spec: bump obsoletes version
Currently, RHEL 8.3 ships lorax-composer 28.14.49, which we want to
replace. 28 <= 28.14.49, so this did not work, bump it to 29, so we do
not get tripped up by bugfix releases of lorax-composer.

In the event that this obsoletes should one day be reverted, we do not
bump it to "infinity", so a sufficiently new version of lorax, would still
be able to obolte osbuild-composer again.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-07-08 14:23:19 +02: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
0f32f35756 📦 Use raw image format for AWS
Although the vhdx format is smaller than raw, AWS often has some issues
booting instances from an imported vhdx snapshot. The raw format seems
to boot consistently at AWS.

Fixes #754.

Signed-off-by: Major Hayden <major@redhat.com>
2020-07-02 13:11:11 -05: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
Ondřej Budai
534c508c41 16
Release osbuild-composer version 16
2020-06-29 19:48:46 +02:00
Ondřej Budai
ee782c6860 spec: sync
f7c4dca5 and 6d7181e8 changed the new spec file but omitted the changes from
the old one. This commit syncs them for consistency sake.
2020-06-29 19:48:46 +02:00
Tom Gundersen
f87154af75 spec: obsolete lorax-composer
osbuild-composer is a drop-in replacement of lorax-composer, and
side-by-side installation is not supported. It is still possible to
explicitly install lorax-composer and exclude osbuild-composer, but the
default is to replace lorax with osbuild on upgrades.

This change is for now only for RHEL8.3, but we should consider doing
the same for F33.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1836844

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-29 16:04:38 +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
Tom Gundersen
b32f0feeae test/cases: add test-cases to verify customizations
Add one test-case per distro that tries to cover all the customizations
we support.

For now omit firewall customizations, as there are open questions about
how to support that on all image types.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-29 16:04:38 +02:00
Tom Gundersen
8c7d8a442b osbuild: pass UID/GID as int
These were passed as strings, which is not what osbuild expects.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-29 16:04:38 +02:00
Tom Gundersen
50d469fe45 distro: replace BasePackages() with Packages()
Rather than getting a set of base packages from the ImageType, and then
appending the requested packages from the blueprint, pass the blueprint
into the new Packages() function, and return the full set of packages to
be depsolved.

This allows us to also append packages based on other customizations
too, and use that to append chrony when the timezone is set. This
matches the behavior anaconda had, and there was a TODO item to do this,
which had been overlooked.

Fixes #787.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-29 16:04:38 +02:00
Tom Gundersen
d31e3ebb65 distro: add groups before users
If a user is added to a group, then the group must be added first.
2020-06-29 16:04:38 +02:00
Ondřej Budai
0b74ebd2ff test: bump 8.3 repo
The previously used snapshot was deleted. This commit changes the override to
use Internal Snapshot 2.0, which should not be deleted in the near future.
2020-06-29 12:29:20 +02:00
Ondřej Budai
fc2788340f worker: set the osbuild success to false even on non-osbuild errors
composer uses the success field to decide whether a build succeeded or failed.
This is bad.

Unfortunately, fixing this requires kinda big code changes. This commit
changes the worker's behaviour to set the osbuild success flag to false
even on errors which weren't caused by osbuild (e.g. an upload error).
This is certainly hacky but I think it's still essential to tell the user
that an error occurred.

Fixes #789
2020-06-29 10:21:24 +02:00
Ondřej Budai
297dbe2fc7 worker: move nil result check to more appropriate place
Result can be nil only when there's an error. Move the code to a place where
it makes more sense.
2020-06-29 10:21:24 +02:00
Alexander Todorov
66b80e0dac tests: Add reproducer for #524
see this comment:
https://github.com/osbuild/osbuild-composer/issues/524#issuecomment-632017769

depending on the answer we should probably add more tests for
dnf-json too.
2020-06-26 22:02:46 +02:00
Martin Sehnoutka
607b4ed935 dnf-json: change confusing error message associated with dnf errors
The issue was introduced in 0d3c8329c0.
The patch correctly changed the base exception class, but it didn't
change the unfortunate use of hardcoded type name. This patch uses
Python's internal `__name__` attribute to get the type (exception) name.
2020-06-26 20:36:35 +02:00
Major Hayden
067726e91d Print success log line after job is done
We print messages to the log when the build fails, but we don't print
one when the build is successful.

I really want to celebrate our successes more often, so let's print a
success message when osbuild completes successfully. Since success
doesn't feel like success without an emoji, let's add one of those, too. 🎉

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-26 20:30:01 +02:00
Christian Kellner
c3c78c2d0c image-info: use /var/tmp for bigger files/dirs
When extracting the commit tarball as well as doing the ostree
commit checkout, use `/var/tmp` instead of `/tmp`, because the
latter might be backed by a tmpfs and thus by RAM; this should
only be used for small files.
2020-06-26 20:25:21 +02:00
Alexander Todorov
6d7181e832 osbuild-composer-tests now Requires osbuild-composer-rcm 2020-06-24 15:14:47 +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
Alexander Todorov
f7c4dca5d5 tests: upload & boot image in OpenStack. Closes #339 2020-06-23 16:17:30 +02:00
Tom Gundersen
18b17c87fa test/cases/rhel/edge: update with dropped fstab
The previous commit removes fstab, update the test-cases accordingly:

`sudo ./tools/test-case-generators/generate-test-cases --distro rhel-8
--arch x86_64 --image-types rhel-edge-commit --output test/cases/
--store /mnt/osbuild`

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-21 16:16:14 +02:00
Christian Kellner
408a704669 distro/{rhel8, fedora32}: no fstab for OSTree
How exactly the final file system layout looks like is determined
by the installer (anaconda) and thus can not be known at commit
creation time. Thus creating an /etc/fstab file is unnecessary and
the information in it probably wrong. The file wont be used though
because it will be overwritten during the installation process.
2020-06-21 16:16:14 +02:00
Martin Sehnoutka
7be8cefab9 tools: merge generate-test-case{,s} scripts
The fact that we have two scripts and one captures output of the other
makes it hard to use in scenarios where the test case generation often
fails. This output capturing results in subtle bugs like described in
issue: https://github.com/osbuild/osbuild-composer/issues/769

This patch merge these two scripts and use class to organize it
instead of files.
2020-06-19 16:36:16 +02:00
Major Hayden
4da9c3389b Pretty print osbuild JSON on failure
When osbuild fails, osbuild-composer's image tests print the output as
ugly JSON and that makes it difficult to determine why osbuild failed.

Instead, print the json in pretty format. 🦋

Fixes #782.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-18 08:46:19 -05:00
Martin Sehnoutka
282763a977 image-types: link the Azure requirements
This patch makes it easier to find the right document describing image
requirements for Linux VM images. It does not link the RHEL page
specifically because it is mainly for RHEL 6 and 7 whereas we build RHEL
8. It instead links documentation for generic Linux distribution.
2020-06-17 20:42:17 +02:00
Major Hayden
cf2392681a Remove 8.2 test case symlinks
These symlinks are no longer needed now that the testing scripts have
been adjusted.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-17 11:47:50 +03:00
Major Hayden
5107115e8b Set consistent ssh-keyscan timeout
Fedora's timeout for ssh-keyscan is short by default, but RHEL's is much
longer. Set the timeout to 5 seconds for consistency.

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-16 11:48:45 +03:00
Major Hayden
989e15e2fb CI: Fix copy/paste errors in log gathering
Perhaps my ability to copy and paste code should be taken away. 🤦🏻‍♂️

Signed-off-by: Major Hayden <major@redhat.com>
2020-06-15 15:50:40 -05:00