Commit graph

882 commits

Author SHA1 Message Date
Sayan Paul
6f56bee611 build:add journald stage to thel 8/9 pipeline
Adds the new journald stage to rhel 8/9
rpmostree commit pipeline.This will add
the dropin file `10-persitent.conf` with
the storage option set as persistent.

Co-authored-by: Sayan Paul <paul.sayan@gmail.com>
Co-authored-by: Irene Diez <idiez@redhat.com>
Signed-off-by: Sayan Paul <saypaul@redhat.com>
2022-12-06 12:15:09 +01:00
Achilleas Koutsou
75758aee52 distro/test: set RHSM Fact API Type when testing manifests 2022-11-30 10:04:16 +01:00
Achilleas Koutsou
5cf0c336d3 distro/rhel9: add RHSM fact to RHEL 9 images
Set the API type RHSM fact in OS customizations for RHEL 9 images.
2022-11-30 10:04:16 +01:00
Achilleas Koutsou
6374ec022d distro/rhel9: define qcow2 image type in function
The global qcow2ImgType was unconfigured and meant to be used by calling
the mkQcow2ImgType() function.  In the distro initialisation code, the
new variable created from the mkQcow2ImgType() function with the
configuration was shadowing the global variable.  This can lead to
errors in the future where it's not clear which variable is used where.

Putting the definition in a function makes it impossible to use without
configuring.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
fa948b9e0b distro: set the workload for the image installer pipelines 2022-11-28 17:20:49 +01:00
Achilleas Koutsou
c6bfb22f54 manifest: support specifying kickstart file location
Add support for specifying where the kickstart file will be created:
either in the default location in the anaconda tree or at the root of
the ISO like we did so far in RHEL.

From the distro level, this is controlled by a boolean that when set to
true puts the kickstart file in the root of the ISO tree at /osbuild.ks
(the old behaviour) and if unset falls back to the default location
/usr/share/anaconda/interactive-defaults.ks.

Changed the name of the kickstart file for ostree back to osbuild.ks
Was ostree.ks for a while since a1bfcfe91c.

For Fedora we use the default and for RHEL we maintain the old behaviour
for now.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
5d55ccf109 manifest: support specifying squashfs compression for ISOs
Add support for specifying the squashfs compression method for ISOTree
pipelines from the caller.
Build Fedora ISOs with lz4 compression and RHEL with xz.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
11b08da7a5 distro/rhel9: cleanup: delete unused functions 2022-11-28 17:20:49 +01:00
Achilleas Koutsou
42274fd6a7 distro_test_common: refactor the kernel count test
- Add a list of image type names to skip with explanations.
- Run the test in two configurations: empty blueprint and blueprint with
  named kernel (kernel, kernel-debug).
- Count only unique kernel names.  Specifying the same kernel twice
  isn't an issue.  We might change this in the future, but for now the
  kernel selection logic is a bit messy.
- Temporarily skip the image-installer until we settle on a common rule
  for both Fedora and RHEL.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
d66bc11bc7 distro/rhel9: update tar image type to new definition
Add the image function and remove the pipeline function.
Remove the build package set.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
108ac3931b distro/rhel9: update image-installer to new definition
Add the image function and remove the pipeline function.
Remove the build package set.

The image function (imageInstallerImage) was adapted from the same one
in Fedora.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
e031b45377 distro: set ostree ref during package collection
Similar to 194351e681 and
9ae47b6843cace3c9bef55d40a33fa11d8de391a.

Manifest initialisation during package collection uses options and
customizations to determine build root packages.  Just like adding a
fake ostree checksum and an unresolved container list, we also need to
add the ostree ref, which is used to determine if a pipeline is being
generated for an ostree-based image type.

This fixes manifest generation when an ostree commit or container is
being built with an embedded container through the cloud API.  Without
this change, the python toml module is not installed in the build root
and the container storage stage fails.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
60d2a88d4f distro/test: add containers to manifest test
Read the containers from the test manifests when regenerating for the
test.
Also move the ostree option handling higher and make it cleaner.  Only
apply the values if they're specified and needed.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
09903bd0db manifest: support for container embedding
Adding support for container embedding.
The containers need to be specified in the image function (imageFunc)
arguments and when specified, propagate down to the OS pipeline
generator to add the necessary stages.

Support is added for RHEL 9.x and Fedora.

Requires a temporary container spec array with the info from the
blueprint for the first initialization of the manifest that's needed
when collecting required packages.
This should be simplified in the future.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
c4b5c229fb distro/rhel9: delete unused pipeline functions 2022-11-28 17:20:49 +01:00
Achilleas Koutsou
2369869db7 distro/rhel9: update gce images to new definitions
add the image function and remove the pipeline function.
Remove the build package set.

Parameterise image config creation functions so that RHSM is added
conditionally based on distro name, like we did for AMI/EC2.

image: set the raw filename for the GCE image type

GCP requires that the raw image file inside the archive be named
'disk.raw'.  We set it on the imagePipeline while instantiating the
manifest as a workaround for now.

This should be changed to be configurable on the image type when
necessary, the same way the final filename is defined.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
a1332c5b82 manifest: add more customizations to live image
Extend the OSCustomizations to include options for dnf-automatic,
yum.repos, and gcp.guest-agent.
Propagate these options from the image configs in rhel9 down to the
OSCustomizations and add the stages to the os pipeline when they're
specified.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
581dde4215 manifest: use osbuild firewall options on os customization
OSCustomizations defined firewall options as blueprint firewall
customizations.  Changed it to instead be osbuild firewall stage
options.
This is swapping out one messy thing for another, but at least now we're
consistent in our mess.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
8c361e510d platform: add special GCE platform format
GCE requires an archive with specific (tar) options, so we should have a
platform format defined separately for it.
Add the GCE image types to the x86_64 arch using the new platform
format.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
1d1523828a distro/rhel9: update azure images to new definitions
Add the new image function and remove the pipeline function.
Remove the build package set.
Rename the last pipeline to xz for the RHUI image type.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
4f60aa3c1d distro/rhel9: move azure image definitions to the top of the file 2022-11-28 17:20:49 +01:00
Achilleas Koutsou
db88c734c1 manifest: add support for waagent and udevrules to liveImage
Extend the OSCustomizations to include the WAAgentConfig and UdevRules
options.
Propagate those options from the image's config down to the
OSCustomizations and add the stages to the os pipeline when they're
specified.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
c35c4784a4 distro/rhel9: update ec2 and ec2-ha to new definitions
Add the image function and remove the pipeline function.
Remove the build package set.
Add "xz" compression and rename the last pipeline.
Propagate the compression option down to the liveImage() image creation
function.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
bc219c825e distro/rhel9: add compression option to imageType
The compression field defines the compression type for the final image,
if any.
This is a temporary change.  We should design a better way to specify
"transport compression" for images, compression that is not required by
the image type or platform, but simply done for transport convenience or
storage.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
bd4359ffd9 distro/rhel9: update ami to new definitions
Add the image function and remove the pipeline function.
Remove the build package set: build packages are added to the pipeline
on-demand.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
e2f7e1aed4 manifest: support X11KeymapLayouts in OS pipeline
In the OSCustomizations, we only apply the X11KeymapLayouts from the
image config if the keyboard customization is not specified.
Although we don't support specifying X11KeymapLayouts in the
customizations, it's related to the base Keymap and we should override
both settings in the image config if the base Keymap is specified.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
2541a2219f distro/rhel9: parameterise ec2/ami image config creation functions
Parameterise image config creation functions so that RHSM is added
conditionally based on distro name and version, instead of adding
conditions to the pipelines.
The pipeline generation function function should simply apply the
configurations without needing to know about the image type, distro
name, or version.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
5d760c48ad osbuild: remove Timeservers slice from chrony stage
The org.osbuild.chrony stage was extended to allow additional directives
alongside time servers [1].  The old Timeservers string slice was kept
for backwards compatibility.  Removing support for it in
osbuild-composer makes working with the stage's options simpler.  Using
the new struct slice Servers field and only specifying a Hostname for
each element is equivalent to the old behaviour, so no functionality is
lost.

This simplifies the chrony stage since no validation is required
anymore.
It also simplifies the propagation of configuration options through the
pipeline generation code which doesn't need to check for both types of
stage options.

[1] https://github.com/osbuild/osbuild/pull/692
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
a027b373a5 distro/rhel9: update vmdk image type to new definitions 2022-11-28 17:20:49 +01:00
Achilleas Koutsou
ce037e24be distro/rhel9: add image-installer to same platform as edge 2022-11-28 17:20:49 +01:00
Achilleas Koutsou
10544e8016 distro/rhel9: update edge types to new definitions
Updated all edge image types except the simplified installer to the new
image definitions.
Added the image functions, based on the Fedora counterparts, and removed
the pipeline functions.
Removed the build package from the image definition.
Removed firmware packages from platform: not available in repos.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
12cbce58cb distro/rhel9: conditionally add RHSM to config
Only add the RHSM options to RHEL and not CS9.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
0c6bbc6dff distro/rhel9: update qcow2 and openstack to new definitions
Add the image function and remove the pipeline function.
Remove the build package set: build packages are added to the pipeline
on-demand based on platform, environment, etc.
Copied the liveImage ImageKind generator from Fedora.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
51ac3e973e distro/rhel9: add support for imageFunc on image types
Add image and environment to the imageType struct.
Also 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.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
adc7a1cafa distro/rhel9: separate image type definitions
Split image type definitions into separate files by logical groups
(mostly by footprint and cloud platform) for easier navigation.
The image types are now all defined as package globals, like in Fedora.
Image specific package sets are defined in the file for the image type
grouping instead of the package_sets file.

A notable change is in the AWS/AMI types, which have different configs
based on OS version.  To get around this, we create each image type with
a function parameterised by the OS version string.  This is a bit messy
and inconsistent with other image types, but it's a temporary workaround
which will be cleaned up as the definitions get closer to the new
framework used in the fedora package.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
94eb5ca96d distro/rhel9: configure platforms for each image type
Create platform configurations for each image type based on the ones in
Fedora.
Currently this has no effect on the image definition / manifest.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
a0e05ea192 distro/rhel9: add platform to image type
Add platform attribute to imageType like we do in Fedora.
Currently this has no effect.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
fe5835fece distro/rhel9: move imageType implementation to separate file
Move the imageType type and its methods to a separate file to make
them easier to manage.
This might get rewritten to have a default implementation for a lot of
the common functions that have simple, straightforward functionality
(e.g., return the value of an internal field).
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
4ec14ca5da distro/rhel9: move architecture implementation to separate file
Move the architecture type and its methods to a separate file to make
them easier to manage.
This might get merged with the other implementations to make a default
one because they're all (basically) the same.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
7bcbab0ba5 distro/rhel9: update distribution implementation
Update the implementation of the distro.Distro interface to match the
one in Fedora.  The main change is that the runner is a runner.Runner
and not a string.

The distroMap is replaced by two functions that initialise a
distribution struct from a template (one for CentOS and one for RHEL).
2022-11-28 17:20:49 +01:00
fkolwa
401a59b6e4 distro/rhel7: Add insights-client to Azure package set
Add insights-client package to azureRhuiCommonPackageSet conditionally
Regenerate test cases for RHEL 7 azure-rhui
2022-11-25 13:15:49 +01:00
Sarita Mahajan
dc3c0d9725 simplified-installer: do not mandate FDO section in simplified provisioning
- build simplified installer iso without mentioning FDO section.
  - change done for rhel8 and rhel9
  - add test case for this use case in test/case/ostree-simplified-installer.shovisioning
  - fixed review comments

Signed-off-by: Sarita Mahajan <sarmahaj@redhat.com>
2022-11-22 11:36:54 +01:00
Simon de Vlieger
0e2f8bb115 image-installer: move conditionals into distro
Try and keep `image/image_installer.go` as clean as possible and instead
pass any customizations one layer up.
2022-11-21 09:45:26 +01:00
Simon de Vlieger
d4d100383e image: create installer image types for fedora
This adds the `fedora-image-installer` and
`fedora-image-installer-preview` images.

The image installer type installs anaconda-webui on Fedora >= 38 to use
the new UI. It also writes its setting to
`/usr/share/anaconda/interactive-defaults.ks` as the current
anaconda-webui has not yet been tested in kickstart mode.

To do so manifest.Anaconda was expanded to take a (subset) of options
for a KickstartStage which is will write into interactive-defaults.ks.
And to take a list of additional modules to enable, so we can set up
Anaconda with all default modules.
2022-11-21 09:45:26 +01:00
Brian C. Lane
f9b3f95615 distro: Install ansible for sap on 8.5 as well 2022-11-18 16:53:22 +01:00
Brian C. Lane
e4f7e94dd0 distro: Use GibiByte constant for Azure 64GiB Images
instead of using 68719476736, use 64 * common.GibiByte
2022-11-18 16:53:22 +01:00
Brian C. Lane
8c07d65fe0 distro: Add azure-sap-rhui image type to RHEL8 2022-11-18 16:53:22 +01:00
Brian C. Lane
a47c239d11 distro: Move alsa-lib out of azureCommonPackageSet Exclude 2022-11-18 16:53:22 +01:00
Brian C. Lane
010d92eed1 distro: Separate out RHEL8 SAP package set into its own function
This also moves cloud specific client packages into that cloud's
PackageSet so that the SAP packages are common to all users.
2022-11-18 16:53:22 +01:00
Brian C. Lane
ed7aaec12d distro: Move RHEL 8 SAP config data into sap.go
This can be shared between cloud providers so move it out of the EC2 SAP
config into its own file and drop the X86_64 from the name (there is
nothing arch specific in it, even if it is only ever used on X86).
2022-11-18 16:53:22 +01:00