Commit graph

2745 commits

Author SHA1 Message Date
Ondřej Budai
943ead790e upload/azure: skip uploading empty pages
The size of the page blob is defined on creation and the blob is
zero-initialized. Therefore, we can just skip all the pages that contain
only zeros. This should save a lot of bandwidth if used on sparse files as
e.g. operating system images. (:
2023-04-04 09:09:43 +02:00
Ondřej Budai
abe6ccfb50 upload/azure: migrate from azure-storage-blob-go to azure-sdk-for-go
https://github.com/Azure/azure-storage-blob-go/ is deprecated, the main SDK
should be now used instead. Let's migrate the code. There should be no
functional changes.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-04-04 09:09:43 +02:00
Ondřej Budai
9beddf626f upload/azure: remove the MD5 sum check
It doesn't actually make any sense. For Page Blobs, Azure doesn't compute any
hashes. The MD5 sum is basically just a property, which we set by one call and
get by the other call.

See
https://stackoverflow.com/questions/42229153/how-to-check-azure-storage-blob-file-uploaded-correctly/69319211#69319211

for more info.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-04-04 09:09:43 +02:00
Irene Diez
20a5b25320 distro/fedora: handle generated warnings during Manifest initialization
Signed-off-by: Irene Diez <idiez@redhat.com>
2023-03-31 14:14:57 +02:00
Irene Diez
2771af2530 distro/rhel7: handle generated warnings during Manifest initialization
Signed-off-by: Irene Diez <idiez@redhat.com>
2023-03-31 14:14:57 +02:00
Irene Diez
64a5946dc3 distro/rhel8: handle generated warnings during Manifest initialization
Signed-off-by: Irene Diez <idiez@redhat.com>
2023-03-31 14:14:57 +02:00
Irene Diez
d6b9b3a5bf distro/rhel9: handle generated warnings during Manifest initialization
Signed-off-by: Irene Diez <idiez@redhat.com>
2023-03-31 14:14:57 +02:00
Irene Diez
5fb989110a weldr: allow to send warnings on ComposeReply
This adds a new field `Warnings` to the `ComposeReply`
struct, allowing to send back any warnings (e.g. deprecation
notices) generated during the `checkOptions` step of the
manifest initialization.

See also https://github.com/osbuild/weldr-client/pull/99 which
handles the weldr-client side of things.

Signed-off-by: Irene Diez <idiez@redhat.com>
2023-03-31 14:14:57 +02:00
Irene Diez
8022c227ba distro: allow to return warnings in the Manifest function
This changes the `Manifest` function of the `ImageType`
interface so that any warnings detected during the
`checkOptions` step of the manifest initialization can
be propagated back to the Weldr-API (see next commit).

Signed-off-by: Irene Diez <idiez@redhat.com>
2023-03-31 14:14:57 +02:00
Sanne Raymaekers
d952e41161 internal/boot: boot VMWare VMs with EFI and SCSI
Since we use streamOptimized images everywhere, we no longer need to use
IDE and boot with bios. Let's test a more realistic scenario.
2023-03-31 09:24:42 +02:00
Achilleas Koutsou
2a87a8b7f3 cloudapi: enable azure-eap7-rhui image type 2023-03-30 18:40:12 +02:00
Achilleas Koutsou
90cc2b18a8 distro/rhel8: assert error instead of skipping
We sometimes skip testing customizations for image types that don't
support them, other times, we check for a specific error.  If we don't
care about the specific error message that's received, running the test
and checking for error is better than skipping, because it ensures that
we're skipping the test for the right reasons and not accidentally
skipping a test for an image type that should support the
customizations.
2023-03-30 18:40:12 +02:00
Achilleas Koutsou
203dd5275e distro/rhel8: exclude azure-eap7-rhui from customization tests
Skip customizations tests for the EAP image.

Create a map of unsupported image types for each test to make adding new
ones easier.
Use a `nil` struct pointer for the pipeline names test instead of an
empty struct.  Non-nil customizations can't be compared.
2023-03-30 18:40:12 +02:00
Achilleas Koutsou
21d13a2ae3 distro/rhel8: specify ports for azure EAP
See COMPOSER-1859
2023-03-30 18:40:12 +02:00
Achilleas Koutsou
fb5accc227 distro/rhel8: add env vars to azure EAP
Add the required environment variables to Azure EAP.
See COMPOSER-1860
2023-03-30 18:40:12 +02:00
Achilleas Koutsou
3f299c7d43 distro: add ShellVars field to ImageConfig 2023-03-30 18:40:12 +02:00
Achilleas Koutsou
816d23988c manifest: add support for shell vars in OSCustomizations
ShellVars are added as a nested map of the form
filename->key->value.  A stage is generated and added if any are
defined.
2023-03-30 18:40:12 +02:00
Achilleas Koutsou
92bbf5fb8b osbuild: add generator function for shell.init stage
Generates a stage from a basic nested map.
2023-03-30 18:40:12 +02:00
Achilleas Koutsou
a024b923a3 shell: new package for representing shell init configs internally
New types for the internal representation of the shell init configs,
which currently consists of files and key-value pairs for environment
global variables.
2023-03-30 18:40:12 +02:00
Achilleas Koutsou
2fcf3582b5 osbuild: add shell.init stage
Add support for the org.osbuild.shell.init stage and test validator.
2023-03-30 18:40:12 +02:00
Achilleas Koutsou
636f3ff237 distro/rhel8: add azure EAP 7 image type
Initialise the image type as an Azure RHUI type with the name
"azure-eap7-rhui" and a workload attached that provides the extra
packages required by the EAP workload.
2023-03-30 18:40:12 +02:00
Achilleas Koutsou
5b4e77797c distro/rhel8: remove outdated comment 2023-03-30 18:40:12 +02:00
Achilleas Koutsou
18ef5ae32d distro/rhel8: distro workload implementation and EAP
Add a local, private implementation of the Workload interface for RHEL
8.  The type should be used for concrete workloads that provide package
package lists for specific image types.

The eapWorkload() function creates a workload that provides the packages
required for EAP image type variants.
2023-03-30 18:40:12 +02:00
Achilleas Koutsou
77b8328999 distro: add workload to image type
Support specifying workload on an image type.
This isn't used yet, but when set, the workload will define packages and
services and not allow any blueprint customizations.

In the future, there will be multiple workloads with each image type
specifying one (but multiple image types can have the same default
workload).  The custom workload will allow all customizations that are
currently supported.
2023-03-30 18:40:12 +02:00
Tomáš Hozza
58e3716b89 distro: add support for RHEL-8.9 and RHEL-9.3
Add a basic support for building RHEL-8.9 and RHEL-9.3 images with
composer.

Add 8.9 and 9.3 repositories to the multitude of places where we have
them.

Generate image test manifests for 8.9 and 9.3. No functional testing is
added for 8.9 or 9.3 at this moment.

This change unblocks the RHEL Gating (since unit tests are currently
failing on 8.9 and 9.3 as on unknown distribution).

Related to https://issues.redhat.com/browse/COMPOSER-1924

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-03-27 11:39:24 +02:00
Tomáš Hozza
dc637d9a57 Manifest: always set kernel options in grub2 stage
It turned out that when we stopped setting the kernel options in grubenv
file, we also stopped setting them in /etc/default/grub under
`GRUB_CMDLINE_LINUX`. This file is used by grub2-mkconfig when
generating grub configuration.

10_linux script executed by grub2-mkconfig recently started to overwrite
the /etc/kernel/cmdline, if its timestamp is older than the timestamp of
/etc/default/grub [1]. As a result, all kernel options were wiped out from
/etc/kernel/cmdline.

Make sure that we always set the `KernelOptions` in the grub2 stage
options, even if the `WriteCmdLine` is set to `false`.

In addition, unify the way we concatenate kernel options set in the
grub2 stage options. Some pipeline implementations were previously using
space, other were using comma. Space is now used everywhere.

Regenerate all affected image manifests.

[1] https://src.fedoraproject.org/rpms/grub2/c/fc76aed5333f56dd05400521a35b944a5df52ebc

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-03-23 16:32:34 +01:00
Sanne Raymaekers
03973acc1f distro/rhel: add payload repos to os package set
Before instantiating the manifest, any repositories that contain a
package set key contained in `PayloadPackageSets()` should be added to
the os package set in order to correctly generate the `org.osbuild.rpm`
stage for the os pipeline.

Otherwise options like GPG keys are not set correctly.

Fixes #3326
2023-03-23 13:39:04 +01:00
Brian C. Lane
f731ab53d0 dnfjson: Cleanup old distro cache dirs
This adds a function, CleanupOldCacheDirs, that checks the dirs under
/var/cache/osbuild-composer/rpmmd/ and removes files and directories
that don't match the current list of supported distros.

This will clean up the cache from old releases as the are retired, and
will also cleanup the old top level cache directory structure after an
upgrade.

NOTE: This function does not return errors, any real problems it
encounters will also be caught by the cache initialization code and
handled there.
2023-03-23 11:26:40 +01:00
Brian C. Lane
8f20b550ea dnfjson: Adjust cache size info for new layout
The repo id hash directories are now down one level, below a directory
named for the distribution.
2023-03-23 11:26:40 +01:00
Brian C. Lane
3481e1d3ba Change the rpmmd cache directory structure to include the distro name
This causes dnf-json to use separate caches, allowing them to run in
parallel, with one lock per distribution. Multiple depsolves with the
same distribution in the blueprint will continue to be serial.
2023-03-23 11:26:40 +01:00
Brian C. Lane
2ab0430d5d weldr: Log when starting and finishing metadata preload
It is difficult to tell if these are really running in parallel or not,
even with loggin, but it helps. They will all always start at the same
time (because they are run concurrently with goroutines) and if things
work right should be finished at about the same time.
2023-03-23 11:26:40 +01:00
Brian C. Lane
c6a8d89da6 remotefile: Use io.ReadAll not ioutil.ReadAll 2023-03-22 08:14:01 -07:00
Simon de Vlieger
ca836a87f4 internal/disk: Remove RequiredSizes property.
The property was only used in a single method where it is passed as an
argument. There is no need to expose it.
2023-03-20 11:04:14 +01:00
Simon de Vlieger
6704dfd609 distro/fedora: clarify requiredPartitionSizes 2023-03-20 11:04:14 +01:00
Simon de Vlieger
7e93df725c distro: move RequiredPartitionSizes into ImageType
It used to be defined on ImageOptions, but ImageType is a better fit for
this.
2023-03-20 11:04:14 +01:00
Simon de Vlieger
34f7f6c7e2 disk: make testcase less confusing
This testcase tested for a / size of 1 GiB but better is to test for a
minimal size of 4 GiB which is the actual lower limit when the required
sizes are added together.
2023-03-20 11:04:14 +01:00
Simon de Vlieger
92cdb0f082 iot-raw-image: change partition table to DOS
For parity with ImageFactory built images there should be only a DOS
partition table in the raw images, with a non-standard ID set for the
boot partition for Raspberry Pi compatibility.

This only applies to the aarch64 images.

As noted in #3220.
2023-03-20 11:04:14 +01:00
Simon de Vlieger
39879a9f60 disk: add RequiredSizes to ImageOptions
These RequiredSizes are a map that is passed on to the partition table
logic which had hardcoded defaults. This makes it possible to define
either no RequiredSizes (`nil`) or empty RequiredSizes which means no
further constraint checks or partition resizes will be done.
2023-03-20 11:04:14 +01:00
Simon de Vlieger
d7f5fac183 disk: clarify comment 2023-03-20 11:04:14 +01:00
Simon de Vlieger
053bbfcb98 iot-raw-image: set size to 4 GiB
The current Fedora IoT raw images are 4 GiB but we were using 10 GiB raw
images. Make this consistent to current.
2023-03-20 11:04:14 +01:00
Gianluca Zuccarelli
b7e7bafb2e internal/remotefile: create a remote file resolver
Create a resolver to fetch the contents of a
remote file which can be used at build time.
The initial usecase for this resolver is to
resolve remote gpgkeys but the resolver has
been made more generic for general files.
2023-03-16 09:55:39 +00:00
Gianluca Zuccarelli
c056db4811 worker/server: add file resolver job
Add a file resolver job to the worker server in
order for us to resolve the contents of a remote
file.
2023-03-16 09:55:39 +00:00
Gianluca Zuccarelli
98d611d34f worker/server: fix container resolver job error
The container job resolve job error message was printing
the wrong error type to the error string.
2023-03-16 09:55:39 +00:00
Gianluca Zuccarelli
b493da1878 internal/clienterrors: add file resolution error
Add a client error type for an error in the remote
file resolution job.
2023-03-16 09:55:39 +00:00
Antonio Murdaca
414424cd30 simplified-installer: enable isolinux
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2023-03-15 12:35:50 +01:00
Simon de Vlieger
23627e9ce0 distro/fedora: add support for Fedora 39 2023-03-15 09:31:23 +01:00
Sanne Raymaekers
a25e0f4adb prometheus:: add arch label to dequeue metrics
Only add the arch label for osbuild job types, as the finish metrics
behave similarly. Having arch labels on dequeue metrics for any other
job type (but not on the finish metrics) would produce weird results.
2023-03-09 18:47:57 +01:00
Simon de Vlieger
a28d535577 image-installer: switch payload to minimal-rpm
With the addition of the minimal rpm package set and image type in #3181
the previously added bare metal package set is a duplicate. It's not
used elsewhere within fedora and the minimal rpm package set is
officially defined.
2023-03-08 12:15:23 +01:00
Simon de Vlieger
5f0d273248 distro: remove duplicate version checks for fonts
The new names of the packages are being added twice in two different
checks, remove the redundant code.
2023-03-08 12:12:18 +01:00
Brian C. Lane
b1c2dbdfc6 Remove old build tag comments
Go is transitioning from the old '// +build' form to '//go:build', this
removes all uses of the old form, adding the new one where needed.

See https://go.googlesource.com/proposal/+/master/design/draft-gobuild.md
2023-03-07 09:22:23 -08:00