Commit graph

5336 commits

Author SHA1 Message Date
Achilleas Koutsou
f35d37188b distro/rhel8: clarify partition table error message
The previous error didn't make it clear where the issue was coming from.
Now it explains that the problem is that a partition table for a given
architecture isn't specified on the image type.
2023-01-30 17:40:18 +01:00
Achilleas Koutsou
e56445593c distro/rhel8: remove arch-dependent packages from Azure common 2023-01-30 17:40:18 +01:00
dependabot[bot]
70c61d4c24 build(deps): bump ludeeus/action-shellcheck
Bumps [ludeeus/action-shellcheck](https://github.com/ludeeus/action-shellcheck) from 6d3f514f44620b9d4488e380339edc0d9bbe2fba to 00cae500b08a931fb5698e11e79bfbd38e612a38.
- [Release notes](https://github.com/ludeeus/action-shellcheck/releases)
- [Commits](6d3f514f44...00cae500b0)

---
updated-dependencies:
- dependency-name: ludeeus/action-shellcheck
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 12:26:29 +01:00
Tomáš Hozza
1667e6e859 osbuild: rework RPM stage inputs
Rework the stage to not reimplement `FilesInput` as
`RPMStageInput`, but instead use the one common
`FilesInput` implementation and its supported
references.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-01-30 11:24:08 +01:00
Tomáš Hozza
b25e4bfa8b osbuild: rework Ignition stage inputs
Rework the stage to not reimplement `FilesInput` as
`IgnitionStageInput`, but instead use the one common
`FilesInput` implementation and its supported
references.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-01-30 11:24:08 +01:00
Tomáš Hozza
645956d203 osbuild: rework QEMU stage inputs
Rework the stage to not reimplement `FilesInput` as `QEMUStageInput`,
but instead use the one common `FilesInput` implementation and its
supported references.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-01-30 11:24:08 +01:00
Tomáš Hozza
3f90a32661 osbuild: rework FDO stage inputs
Rework the stage to not reimplement `FilesInput` as
`FDOStageInput`, but instead use the one common
`FilesInput` implementation and its supported
references.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-01-30 11:24:08 +01:00
Tomáš Hozza
dd59ce6a16 osbuild: rework XZ stage inputs
The `FilesInputs` was since the beginning an XZ-specific implementation
of the input, but it was implemented in the `files_input.go` in a false
hope that it could be used as a generic stage inputs by any stages. It
turned out that various stages require different implementation of
its input. Specifically there is usually a stage-specific key, which has
assigned a common input type. For XZ stage, the key is `file`.

Remove `FilesInputs` and instead implement `XzStageInputs` which is now
accepted by the XZ stage.

Fix all affected pipeline implementations that use XZ stage.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-01-30 11:24:08 +01:00
Tomáš Hozza
413538a18e osbuild: rework files input
Rework files input implementation to support all reference types
supported by the input schema. Also implement helper functions to
generate supported reference types. In some cases, the reference
supports e.g. referencing multiple pipelines in the stage inputs, but
this is currently not implemented, since no pipeline in composer uses
it.

Rework the files input unit tests to cover the new functionality.

Adjust all code affected by the changes made to files input.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-01-30 11:24:08 +01:00
Diaa Sami
081cc37973 osbuild-worker: Add log statements for Splunk dashboard 2023-01-27 12:02:12 +01:00
Simon de Vlieger
a8b6fd45ec iot-installer: enable anaconda modules
As noted in #3141 I've enabled the extra modules for Anaconda for the
iot-installer image type.
2023-01-27 10:46:27 +01:00
Achilleas Koutsou
6c503e4edc test: update rhel-91 manifests
Updated manifests for RHEL 9.1.

The changes added here would have been part of commit
73882b7289 but the lack of repositories
defined for the distro prevented test case generation.
2023-01-26 20:32:38 +01:00
Achilleas Koutsou
db97690b84 tools: add RHEL 9.1 repos for test case generators
In commit 7c8b9f4da8 I intended to make a
copy of the RHEL 9.1 repos under the key "rhel-9" so that the
RHEL 9 distribution, which is currently an alias to RHEL 9.1 (the
current GA) would have valid test repositories available for the test
case generator.  Instead, I accidentally replaced the "rhel-91"
repositories with the ones for "rhel-9".
This commit fixes that mistake.
2023-01-26 20:32:38 +01:00
Diaa Sami
7a67e7b7e8 osbuild-worker: annotate log statements used by splunk
So that they are not changed by mistake
2023-01-26 11:34:20 +01:00
Achilleas Koutsou
fe7860778c test: update RHEL 7 manifests
Changes:
- Removed unnecessary packages from build roots.  Build packages are
  added on-demand.
- Some stages changed order in the OS pipeline for azure-rhui.  This
  will have no functional effect.
- RHSM Facts stage added to all RHEL 7 manifests.  This wont be used
  since RHEL 7 is not built in the cloud service.  The RHSM fact is
  added by the test case generator to all image types to test that the
  option is working properly.
- Azure archive pipeline renamed to xz like in all the other rewritten
  image types that use the xz pipeline.
- Azure image filename before archiving has changed from 'disk.vhd' to
  'image.vhd'.  Again, this will have no functional effect because the
  name of the final artifact is unchanged (disk.vhd.xz).
2023-01-25 20:37:12 +01:00
Achilleas Koutsou
450c44aaff manifest: include yumconfig options in OS customizations
YUMConfig is supported in ImageConfig for RHEL 7.  We now copy the
options over to OSCustomizations and create the stage when necessary.
2023-01-25 20:37:12 +01:00
Achilleas Koutsou
d2114d0f9e manifest: support force-relabel for SELinux in image config
The RHEL 7 images need to enable the force_autorelabel option for the
SELinux stage in osbuild.  This option should almost never be used but
it was added specifically for RHEL 7.  With the rewrite to the new
definitions and the sharing of pipeline code between all distros, we
need to add support to all stages of the pipeline generation to be able
to enable it.
2023-01-25 20:37:12 +01:00
Achilleas Koutsou
822571e28e manifest: support specifying force_size for VPC
The RHEL 7 vpc subformat in qemu does not support force_size so we need
to be able to disable it.  The parameter in all parts is defined as a
pointer because the default value is 'true'.  Not specifying it will
keep the option in the osbuild stage as 'nil', falling back to 'true' in
osbuild.
2023-01-25 20:37:12 +01:00
Achilleas Koutsou
b39d802155 manifest: add support for selecting grub2.legacy
Older OS versions (RHEL 7) with older versions of grub2 don't support
BLS entries.  Setting NoBLS to true configures the bootloader with
traditional menu entries through the grub2.legacy osbuild stage.  This
requires specifying extra information for the OS to the pipeline:
version, product, and nick.
2023-01-25 20:37:12 +01:00
Achilleas Koutsou
83fc8218d6 manifest: make the partition tool for raw images configurable
Add the partition tool as an option on the Raw pipeline.  Set it to the
old value (sfdisk) by default.

Expose the option up through the liveImage image kind so that the
distribution can set it if needed.
For RHEL 7, set it to sgdisk.
2023-01-25 20:37:12 +01:00
Achilleas Koutsou
1cc53f00f4 distro/rhel7: delete unused functions, types, and constants 2023-01-25 20:37:12 +01:00
Achilleas Koutsou
05094ea5c8 distro/rhel7: update image types to new definitions
- Replace Manifest() and PackageSets() imageType methods with (adapted)
  copies from RHEL 8.
- Replace pipeline functions with liveImage image function.
- Specify xz compression for Azure RHUI.
- Add similar package name overrides as we did in RHEL 8.  For RHEL 7,
  we need to modify the capitalisation of python3-pyyaml.
2023-01-25 20:37:12 +01:00
Achilleas Koutsou
79a0d36bf4 distro/rhel7: move qcow2 image type definition to top of file
Moved the qcow2 image type definition to the top of the file for
consistency with the other image type files.
Separated the default image config struct from the base image type
definition to make it easier to read.
2023-01-25 20:37:12 +01:00
Achilleas Koutsou
34a38008d9 distro/rhel7: move azure image type definition to top of file
Moved the Azure image type definition to the top of the file for
consistency with the other image type files.
Separated the default image config struct from the base image type
definition to make it easier to read.
2023-01-25 20:37:12 +01:00
Achilleas Koutsou
318fdf5ffd distro/rhel7: add osCustomizations() and liveImage()
Copied osCustomizations() and liveImage() functions from RHEL 8 and remove
unneeded customizations and options.
2023-01-25 20:37:12 +01:00
Achilleas Koutsou
b5795d18b2 distro/rhel7: update imageType implementation
Add environment, compression, and image fields and define the imageFunc
function type.
2023-01-25 20:37:12 +01:00
Achilleas Koutsou
cef5f3d3bd runner: add platform-python only for RHEL 8+
No platform-python for RHEL 7.
2023-01-25 20:37:12 +01:00
Achilleas Koutsou
c12f2c61e2 distro/rhel7: and add platforms to image types 2023-01-25 20:37:12 +01:00
Achilleas Koutsou
6fdf917271 distro/rhel7: update distribution implementation
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.
2023-01-25 20:37:12 +01:00
Achilleas Koutsou
a93ae83c5c distro/rhel7: add packageset chains to qcow2
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.
2023-01-25 20:37:12 +01:00
Sarita Mahajan
0d16e2310e image: add new image type "minimal-raw" for fedora
Signed-off-by: Sarita Mahajan <sarmahaj@redhat.com>
2023-01-25 19:19:45 +01:00
Sanne Raymaekers
2e3dd16220 osbuild-service-maintenance: clean up all regions
Since we started cloning images to different regions, the maintenance
script should clean up all of these regions.
2023-01-25 14:20:51 +01:00
dependabot[bot]
dc1a770c0f build(deps): bump github.com/coreos/go-semver from 0.3.0 to 0.3.1
Bumps [github.com/coreos/go-semver](https://github.com/coreos/go-semver) from 0.3.0 to 0.3.1.
- [Release notes](https://github.com/coreos/go-semver/releases)
- [Commits](https://github.com/coreos/go-semver/compare/v0.3.0...v0.3.1)

---
updated-dependencies:
- dependency-name: github.com/coreos/go-semver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-25 13:46:16 +01:00
schutzbot
77bd1cba08 Post release version bump
[skip ci]
2023-01-25 08:26:45 +00:00
Tomáš Hozza
8624ff65f8 distro/rhel8: ensure the Azure SAP RHUI image uses appropriate config
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>
2023-01-24 19:57:14 +01:00
Sanne Raymaekers
4833f99070 tools/appsre-ansible: workaround missing authselect-compat
See PR#3237.
2023-01-24 16:04:40 +01:00
Tomáš Hozza
0a4a75e19e Packer: workaround missing authselect-compat-1.2.5-2.el9_1 in RHUI repos
`authselect-compat-1.2.5-2.el9_1` package is currently missing in AWS
RHUI el9 AppStream repositories, which makes `dnf upgrade` fail on
RHEL-9.1. This is a RHUI-specific issue, since the package is available
in CDN repos.

In order to workaround the issue for now, `authselect-compat` needs to
be removed as part of the upgrade in order for it to succeed. Use
`--allowerasing` instead of just removing the issue, because this will
ensure that `authselect-compat` will be upgraded just fine, once the
issue is resolved.

Fix the issue in the CI script that builds the image using Packer, as
well as the Ansible playbook used by Packer to build the image.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-01-24 15:40:02 +01:00
Achilleas Koutsou
73882b7289 test: update customized test manifests to include bluez
Our 'customize' test manifests include an option to disable the
bluetooth.service.  Originally this option was added for image types
that included bluez in their default package set (Fedora IoT commit) but
it was later copied to the qcow2 image type as a way of testing
customizations.

Until recently, building these caused no issues.  On distros with more
recent versions of systemd, disabling a non-existent service causes an
error and these manifests fail to build.

Added the 'bluez' package to all manifests that include the 'disable
bluetooth.service' customization and updated the manifests.  These
should all be buildable now.
2023-01-23 19:54:39 +01:00
Xiaofeng Wang
60e6107b42 Fix workflow shellcheck action deprecated set-output error
Use action-shellcheck@6d3f514f44620b9d4488e380339edc0d9bbe2fba to
have fix included
2023-01-20 15:02:33 +01:00
dependabot[bot]
8fe489ef7c build(deps): bump github.com/Azure/azure-sdk-for-go
Bumps [github.com/Azure/azure-sdk-for-go](https://github.com/Azure/azure-sdk-for-go) from 66.0.0+incompatible to 68.0.0+incompatible.
- [Release notes](https://github.com/Azure/azure-sdk-for-go/releases)
- [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md)
- [Commits](https://github.com/Azure/azure-sdk-for-go/compare/v66.0.0...v68.0.0)

---
updated-dependencies:
- dependency-name: github.com/Azure/azure-sdk-for-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-20 14:56:50 +01:00
Tomáš Hozza
8d0f2d7e79 osbuild/mkdir: make Mode a pointer
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>
2023-01-19 11:15:33 +01:00
Tomáš Hozza
c1c26b2817 osbuild/mkdir: support exist_ok stage option
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>
2023-01-19 11:15:33 +01:00
Tomáš Hozza
7021c305e2 osbuild/mkdir: support parents stage option
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>
2023-01-19 11:15:33 +01:00
Tomáš Hozza
5ff2f997f6 osbuild/mkdir: fix copy&paste error in function comment
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-01-19 11:15:33 +01:00
Tomáš Hozza
30c3ea791e osbuild/mkdir: rename Path struct to MkdirStagePath
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>
2023-01-19 11:15:33 +01:00
Sanne Raymaekers
64dc942001 Schutzfile: bump osbuild commit for GA RHEL
Since composer is not updated into these distributions, it's safe to use
a newer version of osbuild on them without the risk of releasing a
composer version which would require an unreleased osbuild version.
2023-01-18 22:19:13 +01:00
Tomáš Hozza
7a5c2641ac schutzbot: delete ckellner's SSH key
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-01-18 12:53:30 +01:00
Achilleas Koutsou
e9d1e8a222 distro: fix pipeline names in Fedora and RHEL 9 image types
Some pipeline lists weren't updated when the image types were rewritten.
Discovered now from the new test and fixed.
2023-01-18 11:50:35 +01:00
Achilleas Koutsou
f102ae6b04 distro: add new test for pipeline names on image types
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.
2023-01-18 11:50:35 +01:00
Achilleas Koutsou
7f1a0a76b1 test: update manifests for "rhel-8"
The format-request-map is updated to remove the override for the
customized qcow for rhel-8.
The rhel-8 manifests are now identical to the rhel-87 counterparts.
2023-01-18 11:50:35 +01:00