Update the implementation of the distro.Distro interface to match the
one in RHEL 8, 9, and Fedora. The main change is that the runner is a
runner.Runner and not a string.
The runner name is now rhel79 (changed from rhel7). This is
functionally equivalent based on osbuild's runner version fallback
logic.
The qcow2 image type for RHEL 7 doesn't have packageset chains defined.
This means that the blueprint packages are never merged into the os
pipeline.
This is unnecessary right now because of the upcoming rewrite, but it
will minimise the differences that will show up in the manifest.
The qcow2-customize manifest has an added block of options for the
grub2.legacy stage because now the dracut-config-rescue package is being
installed in the image.
Azure RHUI and BYOS images use the respective BYOS / RHUI default image
configuration, inheriting the defaults from a common configuration. The
Azure SAP RHUI image was incorrectly using the common configuration and
was not inheriting any settings from the RHUI configuration. As a
result, the Azure SAP RHUI image was missing the following
configuration:
- Required GPG keys were not imported from the file system as part of
image build.
- No RHSM configuration was applied at all.
Add "Rhui" to the image type definition, to make it explicit that it is
RHUI-based. Make sure that the image type default configuration is based
on the common RHUI configuration. Regenerate affected image manifests.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
The default value for the `os.FileMode` is zero, but the actual default
value used by the stage if no value is specified in the options is
`0777`. By using the pointer, we'll allow one to specify `0000`
permissions as a value which won't be omitted from the stage options.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Add support for `exist_ok` stage option added as part of
PR#1224 [1], which allows to gracefully handle existence of a directory
path specified to the stage.
This will be helpful when creating custom directories in the image via
customizations, because one can't know in advance whether the directory
path won't be created by a package installed in the image.
Not bumping the requires on osbuild, because this new option is not yet
used by any image definition or customization.
[1] https://github.com/osbuild/osbuild/pull/1224
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
The stage supports a `parents` property in stage path options, which
allows one to auto-create any parent directories as needed.
Add the property to stage options implementation.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
The plain `Path` name was a bit unfortunate, since it was specific to
the `mkdir` stage, but it was used outside of the `osbuild` package as
`osbuild.Path` which was making a wrong impression of it being a generic
path structure. This is not true.
Rename the structure to contain the stage name.
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Every image type defines a list of build pipeline names and a list of
payload pipeline names. These should match the names of the pipelines
that will exist in the manifest when it's generated. They should match
exactly, otherwise issues can occur when reading the metadata from an
osbuild result. The cloud API needs to know the names of the pipelines
and specifically the name of the build pipeline and the payload pipeline
in order to differentiated between build and payload packages in the
metadata.
This new test generates every manifest, parses it into a minimal struct,
and compares the pipeline names with the ones reported statically on the
image type definition.
Image types no longer report their chains. Instead, pipelines report
their packages and chains and blueprint packages are added to the
workload.
The distro.ImageType interface retains the PackageSetsChains() methods
for RHEL 7 until that is rewritten as well.
The osbuild-dnf-json-test doesn't use the PackageSetsChains() method
anymore. Instead, since it only test the centos-8 qcow2 image, it
hardcodes the expected package set names.
The python3-toml package is called python3-pytoml in RHEL 8, so the name
must be replaced before depsolving. The package is defined in
manifest/os.go which does not have access to the distribution name or
version.
This solution is a temporary workaround. The future solution should
depend on distributions resolving package names based on required
features.
Using the same pipeline functions as Fedora and RHEL 9 and copied the
image function from RHEL 9. The most notable change is the replacment
of the deprecated bootiso.mono stage with the more granular stages, just
like with the image installer.
Using the same pipeline functions as Fedora and RHEL 9 and copied the
image function from RHEL 9. The most notable change is the replacement
of the deprecated bootiso.mono stage with the more granular stages.
Using the same pipeline code as RHEL 9 and Fedora introduces the
following changes to the image:
- ostree.config: moved and uses the stage mount instead of the old
stage-specific options.
- lock root password like we do in Fedora and RHEL 9.
- set keymap to us and locale to C.UTF-8 like in Fedora and RHEL 9.
- grub2 contains kernel options and unified set to true. This stage
also now uses the ostree mount options to set up the deployment when
running.
The gceX86 platform embeds the X86 platform and overrides the
GetPackages() method to exclude the grub2-pc package.
The gce image is built as UEFI only, does not include 'grub2-pc', but we
enable BIOS in the platform config for all the other side-effects: grub
config options and grub2.inst stage.
See the image type documentation for more information:
d12d9674d6/image-types/rhel8/google-gce.md (rhel-8-byosrhui--rhel-9-byos-image-differences-compared-to-googles-image)
Add image, environment, and compression to the imageType struct.
Define two new methods: PackageSetsNew() and ManifestNew()
These get called by the corresponding base methods PackageSets() and
Manifest() when imageType.image is defined. They will serve to
transition images to the new framework while also supporting the old
until all image types are updated.
Continuing image type splitting.
Constructor for qcow2 type requires the distribution object to determine
whether to add RHSM to the image config (RHEL only).
Start splitting image type definitions into separate files by logical
groups (mostly by footprint and cloud platform) for easier navigation,
like we did for rhel9.
Split AMI and Edge image types; the rest will follow in separate
commits.
Image specific package sets are defined in the file for the image type
grouping instead of the package_sets file.
A notable difference with the way it was done in rhel9 is that every
image type is defined in a function rather than a global where possible
and a function when distro version specific configuration is needed.
This is done for consistency and the change will likely be done in the
other distributions as well.
Also, instead of passing only required values to the image type
constructor (for example, osVersion and a RHEL boolean), we pass the
whole distribution object and each constructor can read whatever
information it needs.
Add platform attribute to imageType.
Create platform configurations for each image type, copied from RHEL 9.
Currently this has no effect on the image definition / manifest.
The host distro object was identical to the regular distro objects for a
while now. The constructors in the registry have been aliases to the
base constructors for a long time.
- Deleted all HostDistro constructors from the distributions.
- Changed the supported distro list to only contain base constructor
functions.
- The host distro in the distro registry is a copy of the base distro
that matches the host and does not call a separate constructor.
Inline the distribution structs in the common constructor.
Make the same changes that were made to RHEL 8:
- Remove major version argument: it's always 9
- Make the default constructor New() create the default minor version
and rename it to plain RHEL 9.
The distroregistry now contains both rhel-9 and rhel-90, which point to
the same configuration but with different names.
The default rhel-9 should be updated to be an alias to rhel-91, the
current GA.
Update the implementation of the distro.Distro interface to match the
one in RHEL 9 and Fedora. The main change is that the runner is a
runner.Runner and not a string.
The distroMap is replaced by a switch that initialises the distribution
struct strings based on the minor version number.
The default minor version, created with rhel8.New(), creates a copy of
RHEL 8.6 and renames it to "rhel8".
We have switched how 5xx errors are being recorded
internally and we are now recording all failures
for all endpoints. As a result, a dedicated metric
only for compose failures is no longer required.