Add new image type definitions `ec2` and `ec2-ha` representing the
official RHEL ec2 image types.
Add a `xzArchivePipeline()`, which returns a pipeline producing a XZ
archive from a file produced by a different pipeline.
Add rpmrepo snapshots for `rhui` and `ha` repositories used to generate
image test cases. `rhui` is used by the `ec2` image and it is available
on x86_64 and aarch64 architectures. `ha` is used by the `ec2-ha` image
and it is available only for x86_64.
The new image type definitions are currently not used by any
API test case.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Previously, the support of UEFI has been captured only on the level or
architecture definition as a binary boolean value. In reality some of
the architectures are able to support legacy, UEFI or hybrid boot.
Introduce a new BootType value, defined on the architecture level, which
can be set to one of the three boot types mentioned above. The value set
on the architecture level can be overridden on the image type level in
the image type definition.
Add two unexported helper methods to the `imageType`, specifically
`getBootType()` which returns the boot type that should be used for the
image type and architecture combination. The values set explicitly in
the image type or architecture definition should not be used directly.
Second added method is `supportsUEFI()`, which returns boolean value
representing the fact if the image type supports UEFI boot.
Split and define the boot package sets separately for the legacy and
UEFI boot. The `PackageSets()` method of the imageType structure is
modified to take the boot type into consideration and append appropriate
package sets to the "os" package set.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Redefine the `ami` image type in RHEL-8.5 to be based on RHEL
ec2 images. The pipeline has different default settings, therefore the
common "os" pipeline is not used. The RHEL ec2 images have a different
default size than the original `ami` image definition. The RHEL ec2
images use a different default partitioning scheme. Their configuration
is slightly different for each architecture and the x86_64 version
of the image does not support UEFI.
Update rpmrepo snapshots used to generate RHEL-8.5 x86_64 and aarch64
image test cases.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for specifying the `leapsectz` property of
`org.osbuild.chrony` stage. Modify stage tests to test setting of the
value.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Add support for osbuild `org.osbuild.xz` stage. The stage accepts Files
inputs.
Add unit tests for the added functionality.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
osbuild stage inputs were originally implemented in composer as
stage-specific inputs, while in reality, they are defined as individual
inputs, usually accepted by multiple stages. Therefore a single stage
input can be passed to any stage, as long as the stage accepts it.
Files inputs type was previously defined, but not used by any stage.
Creation of proper inputs type structures is currently handled in
`internal/distro/rhel85/stage_inputs.go` instead.
Refactor files inputs type to be usable directly as an input type
structure for stages, which accept it. For now, implement only the
`org.osbuild.pipeline` origin and related input reference.
Add unit tests for the `FilesInputs`.
Define input origin names as string constants, so that they can be used
by inputs implementations, instead of using string literals.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Allow globing patterns in distro-specific image type deny list of Weldr
API configuration. Extend unit tests to verify simple globing patterns.
Update NEWS entry.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Refactor the `composeHandler()` method to send the actual error
returned by `getImageType()` as an API response.
Modify tests to handle the changed error message in API calls.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Rename the `checkImageTypeDenylist()` method to `isImageTypeAllowed()`
and return boolean value instead of error.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Change the Image Type denylist in Weldr API from being applied to all
distributions to being distribution-specific. A special name `*`
can be used in the configuration to match any distribution
or any image type.
Modify NEWS entry and unit tests to reflect this change.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
Extend Weldr API to accept a list of denied image types, which should
not be exposed via API for any supported distribution. This
functionality will be needed to not expose image types which can't be
successfully built outside of Red Hat VPN. Example of such images are
the official RHEL EC2 images, which include RHUI client packages not
available publicly.
Image Types are filters when listing available compose types and
creating a new compose using Weldr API.
Extend osbuild-composer configuration to allow specifying the list of
denied Image Types for Weldr API.
Add unit tests for implemented changes.
Add NEWS entry describing the newly introduced functionality.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
The previous manifests were generated inside a RHEL VM which means that
the selinux context mismatch check didn't run properly
(see https://bugzilla.redhat.com/show_bug.cgi?id=1973754).
Regenerating them on F34 shows some mismatches for certain image types.
Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
In the main OS pipeline created by osPipeline(), there is often a set of
stages that are added after the common ones. The SELinux stage must
always be last in the pipeline, so it is added externally by the calling
function.
Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
fsjobqueue_test contained tests that are generically testing the
JobQueue interface. Split those out into its own package `jobqueuetest`.
These tests will be useful when implementing a new package that conforms
to the JobQueue interface.
Cloud api now exposes user customization that let a customer able to add
a new user with a set of groups and a ssh key.
Testing:
* adds 2 users to the AWS image, accessible with a temp ssh key.
* the first one is in the group wheel, the other is not
Fixes#1574
To help along with debugging, this commit makes the worker able to print
the status of the different stages with a oneliner for each successfull
stages and a detailed message for failed ones.
Sample output:
Jul 23[..]: Build stages results:
Jul 23[..]: org.osbuild.rpm success
Jul 23[..]: org.osbuild.selinux success
Jul 23[..]: Stages results:
Jul 23[..]: org.osbuild.rpm success
Jul 23[..]: org.osbuild.fix-bls success
Jul 23[..]: org.osbuild.fstab success
Jul 23[..]: org.osbuild.grub2 success
Jul 23[..]: org.osbuild.locale success
Jul 23[..]: org.osbuild.timezone success
Jul 23[..]: org.osbuild.users failure:
Jul 23[..]: [/usr/lib/tmpfiles.d/journal-nocow.conf:26] Failed to resolve specifier: uninitialized /etc detected, skipping
Jul 23[..]: All rules containing unresolvable specifiers will be skipped.
Jul 23[..]: Failed to create file /sys/fs/selinux/checkreqprot: Read-only file system
Jul 23[..]: useradd: group 'toto' does not exist
Fixes#1584
The package set is needed by the GRUB 2 stage options function to find
the Kernel package in order to add the saved entry option. The Kernel
package is defined in the blueprints package set, not the OS package
set.
Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
The system sources allow specification of the rhsm parameter, but it
isn't available in the sources configured over the Weldr API. This patch
implements support for it.
Previously, all sorts of tests that provided no value were run for RHEL 9.0.
This commit limits its testing to the only test that makes sense: koji.sh.
See #1461 for more details.
Fixes#1461
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
The part creating Systemd unit drop-ins was extracted from
`org.osbuild.systemd` stage to `org.osbuild.systemd.unit`,
before the osbuild v30 release. Update the composer implementation
to reflect the change.
Related to https://github.com/osbuild/osbuild/pull/739.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
The `org.osbuild.systemd-logind` stage was reworked before the osbuild
v30 release. Update the composer implementation to match the expected
schema.
Related to https://github.com/osbuild/osbuild/pull/739.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
The `org.osbuild.dracut.conf` stage was reworked before the osbuild v30
release. Update the composer implementation to match the expected
schema.
Related to https://github.com/osbuild/osbuild/pull/739.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
The `org.osbuild.modprobe` stage was reworked before the osbuild v30
release. Update the composer implementation to match the expected
schema.
Related to https://github.com/osbuild/osbuild/pull/739.
Signed-off-by: Tomas Hozza <thozza@redhat.com>
The `org.osbuild.cloud-init` stage was reworked before the osbuild v30
release. Update the composer implementation to match the expected
schema.
Related to https://github.com/osbuild/osbuild/pull/739.
Signed-off-by: Tomas Hozza <thozza@redhat.com>