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
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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
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.
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>
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.
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.
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.
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>
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.
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>
The subpackages are not really meant to be used with a different version of
the osbuild-composer package. This commit enforces.the usage of a matching
version in the spec file.
When osbuild crashes (e.g. when cp fails because of the machine running
out of disk space), it doesn't produce a machine-readable result. Due to
our suboptimal handling of the result struct (this is my fault), this can
lead to result == nil. However, composer expects that result != nil in all
cases because it uses the Success flag to assess the compose state. If
result == nil, it just crashes terribly.
Exit the whole worker process when a job was canceled, because osbuild
does not clean up all child processes when receiving SIGKILL.
Change the service to restart osbuild-worker also on success, and
decrease the restart timeout.