Commit graph

4363 commits

Author SHA1 Message Date
Achilleas Koutsou
ca1b559e30 Move RHEL 8.4 definition to the common rhel8 package 2022-07-08 09:30:34 +01:00
Achilleas Koutsou
a8b0a5f0bd test: convert all RHEL 8.4 v1 manifests to v2
Converted by loading them through the manifest parser in osbuild and
formatting them through v2 before dumping.
These are not the "real" manifests that osbuild-composer would generate,
but they will make it a tiny bit easier to compare and detect changes in
the distro definition when it's moved to the common rhel8 package.
2022-07-08 09:30:34 +01:00
schutzbot
0060048b81 schutzfile: Update snapshots to 20220701 2022-07-07 16:06:37 +02:00
Ondřej Budai
c0df932fc6 Dockerfile: bump the shutdown period to 15 seconds
5 seconds didn't fully help with the issue, let's try 15 and see what happens.

See https://github.com/osbuild/osbuild-composer/pull/2797#issuecomment-1172862359
for more details.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-07-07 15:33:32 +02:00
fkolwa
14fd1fe279 Update RHEL90-91 repo config and and 9.1 test cases 2022-07-07 14:28:59 +02:00
fkolwa
832c555a21 internal/distro: Add GCE RHUI image type+package set 2022-07-07 14:28:59 +02:00
dependabot[bot]
0d1dbd9780 build(deps): bump gopkg.in/ini.v1 from 1.66.4 to 1.66.6
Bumps [gopkg.in/ini.v1](https://github.com/go-ini/ini) from 1.66.4 to 1.66.6.
- [Release notes](https://github.com/go-ini/ini/releases)
- [Commits](https://github.com/go-ini/ini/compare/v1.66.4...v1.66.6)

---
updated-dependencies:
- dependency-name: gopkg.in/ini.v1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 13:19:10 +02:00
Tom Gundersen
ab4a3c0885 manifest/commit_server: pull in nginx
nginx is a requirement for this pipeline to work.
2022-07-07 12:00:56 +01:00
Tom Gundersen
452cb2dae9 environment: encapsulate the environment images are deployed to
This represents how our systems should integrate into their environment, typically using
some sort of agent, or commonly cloud-init.

In the future we could imagine this representing network configuration or any other kind
of configuration necessary to reach the environment as well.

For now EC2 and Azure is supported, and stub environments are
added to show the idea, but these are not implemented/used
yet.
2022-07-07 12:00:56 +01:00
Tom Gundersen
7a534d4d1e workload: introduce abstraction to encapsulate image workloads
The workload encapsulates what the user wants to run on top of the image. Everything
else we do abstracts away the OS, the hardware, the environment, and what is left is what
matters: the workload.

For now only the `Custom` payload is implemented which requires the user to name the
packages they want installed, the repositories to pull them from and what systemd
services to enable.

A few other stub workloads are added to show the idea, but these are not used.

The ideal is for the workload to have only the minimal number of configuration options.
2022-07-07 12:00:56 +01:00
Tom Gundersen
39c3d6ec35 manifest/os: move fs tool selection into the pipeline
Always include the tools for all the filesystem types in the partition table. There may be
usecases for having additional ones, for instance if the partition table is not known, but
this gives us a minimal baseline.

This includes dosfstools in images that have a vfat partition but did not include the tools.
2022-07-07 12:00:56 +01:00
Tom Gundersen
d791138b27 manifest/os: implicitly include selinux policy package 2022-07-07 12:00:56 +01:00
Tom Gundersen
1e03627447 manifest/os: only implicitly add to base packages
Any package that is added by the pipeline definition should be in the base package set
and the user package set should only be for packages explicitly added by the user.

Any combination of implicitly added packages should depsolve, or it is a bug. However,
user provided packages can have conflicts which must be handled gracefully.

This change is not breaking, as that would be a bug (per the above) and it makes our
behaviour more predictable as any conflicts are caused by explicitly added packages.

Note that this changes the logic from the kernel package being depsolved twice to only
being depsolved in the base package set.
2022-07-07 12:00:56 +01:00
Tom Gundersen
c296b666cf distro/fedora: drop usage of MakePackageChainSet
Pass PackageSets when initialising the Manifest, and read the chains back out.

This also fixes a bug where all repos were always used, rather than filtering per
package set.

Finally, this moves the 'chrony' inclusion from distro.go to the OSPipeline where
it belongs. In doing so the logic is changed slightly, where chrony is now
installed if NTP servers are configured (regardless of source), whereas in the
past it was included if the timezone was set in the blueprint (which made no sense).
2022-07-07 12:00:56 +01:00
Tom Gundersen
e4b5048d98 manifest/os: include kernel in package set
If the kernel name is set, then the packaegSpecs must include the kernel package, ensure
this by including the kernel in the package list.

We currently include the kernel both in the userPackages and the base packages.
Including it only in the user packages does not work as the base could end up pulling it
in as well. However, it would be semantically more correct to include it only in the base
set, so if possible we should do that and drop it from the user packages (in a follow-up).
2022-07-07 12:00:56 +01:00
Tom Gundersen
1bccf72b6b manifest/os: detect if the lvm2 package should be included
If the partition table includes logical volumes, the lvm2 package should be installed on
the target system.

Drop the corresponding logic from fedora/distro.go.
2022-07-07 12:00:56 +01:00
Tom Gundersen
ec8cc01f95 platform: introduce hardware platform abstraction
These objects describes the hardware an image runs on. Including
 - architecture
 - bootloader
 - required firmware

Use the platform abstraction to move firmware packages out of the package set
definitions.
2022-07-07 12:00:56 +01:00
Gianluca Zuccarelli
682481d4d7 distro: move isMountpointAllowed
Move the `isMountpointAllowed` function to the common
distro package since this function is shared used in
multiple distro packages.
2022-07-05 23:13:43 +01:00
Tom Gundersen
4e2cea61bb manifest/os: move packages needed for early boot into the pipeline definition
This simplifies the package set definitions in the fedora distro, and unifies the handling
of IoT and non-IoT images.
2022-07-05 22:39:40 +01:00
Tom Gundersen
03fc2d5bfd distro/fedora: install kernel and bootloader in ostree commits
This is a partial revert of 006c5b26, where kernel settings and bootloaders were only
installed on bootable systems.

However, ostree-based systems need the ability to pick up kernels and bootloaders from
the commit to install on the instance, so make this conditional on being bootable or an
ostree commit. This is probably an indication that we need a different abstraction.
2022-07-05 22:39:40 +01:00
Tom Gundersen
a45caf5756 distro/fedora: image type should be more specific than arch
Currently an image type could override the boot loader in the architecture, but we should
not allow an image type to select a bootloader type the architecture does not support. So
only in case the architecture supports hybrid boot do we allow the image type to select
one of the two types.

This enables UEFI on AMIs for aarch64.
2022-07-05 22:39:40 +01:00
Juan Abia
c2c43594b1 test/cases: add new mountpoints in filesystem.sh
There are a list of mountpoints in the documentation, but only
some of this mountpoints are tested in the test filesystem.sh. Add the
ones missing.
2022-07-05 14:19:01 +02:00
Tom Gundersen
907b4a8686 distro/fedora: pipelines.go -> manifests.go
Simplify the manifest generation by doing it in terms of manifests rather than slices
of pipelines.
2022-07-05 12:15:50 +02:00
Tom Gundersen
ba31887ff2 fedora/pipelines/os: minor refactoring
Collect partition tables / boot loaders / kernels together and
make them conditional on the system being bootable.

As a side-effect, we no longer install the grub2 modules in ostree commits.
2022-07-05 12:15:50 +02:00
Tom Gundersen
de6c628069 manifest/os: drop kernelName and bootLoader from New()
The kernel name is optional and can be set later.

The bootloader we skip entirely. Instead, set the architecture, which now becomes
mandatory. Use it to deduce the bootloader, and in the future other pipelines can read
this property from the OS Pipeline, rather than having it passed in.
2022-07-05 12:15:50 +02:00
Tom Gundersen
fd5180d52d manifest/os: make grubLegacy and partitionTable optional
These should both default to being disabled, so move them away from the constructor.
Rename grubLegacy to BIOSPlatform and document that setting it enables BIOS support.
2022-07-05 12:15:50 +02:00
Tom Gundersen
64b4ad7c31 manifest/os: make ostree parameters optional
The OSTree parameters can be set after initialisation. We should only require parameters
to be set at initialisation time if we have no good defaults. In the case of OSTree the
default is to not enable OSTree support.
2022-07-05 12:15:50 +02:00
Tom Gundersen
b0b5a48c5f manifest/os: don't change the name based on ostree or not
Let the name reflect the pipeline type, and keep it the same whether or not
the contents is meant to be an OSTree commit or not.
2022-07-05 12:15:50 +02:00
Sanne Raymaekers
339d69d2da test/api: Add gcloud and generic s3 changes to split api tests
- Fixed shellcheck errors
- Moved checkEnv from common to individual tests
- Fixed package install section in spec file:
Globs which include a directory fail on el-like distros.
- Use gcloud cli to ssh
- (re)Introduce generic s3 tests
2022-07-05 12:15:31 +02:00
Ondřej Budai
cb7c0283a5 test/api: split into smaller files
Each cloud now has its own file that's sourced on-demand by the main api.sh
script. The main goal of this commit is to reduce the amount of clutter in
api.sh. I, personally, find 1300 lines of bash overwhelming and I think that
this is a reasonable beginning to start cleaning things up.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-07-05 12:15:31 +02:00
Ondřej Budai
767283b2d9 packer: use 8.6 as a base for RHEL images
Let's stay updated!

Also, let's remove 8.4 and 8.5 from Schutzfile, I strongly believe that it's
not used anywhere.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-07-05 11:54:12 +02:00
Sanne Raymaekers
e52bd38ccf distribution/Dockerfile-ubi: Graceful shutdown of 5 seconds 2022-07-05 11:04:20 +02:00
Sanne Raymaekers
e842b2853f containers/osbuild-composer: Remove dnf-json
dnf-json is no longer a service.
2022-07-05 11:04:20 +02:00
Sanne Raymaekers
595de8ed7f containers/osbuild-composer: Allow shutdown wait period
Openshift keeps sending requests to composer for a while after it has
sent SIGTERM, this results in requests being reset randomly on
shutdown. Waiting a few seconds before terminating mitigates this.
2022-07-05 11:04:20 +02:00
Tom Gundersen
ad847a6fca weldr: support more package set names
Weldr makes assumptions about the names of the package sets. This
does not work in all cases, so should be reworked, but for now just
do enough that we don't regress.
2022-07-04 23:04:29 +01:00
Tom Gundersen
ff1451d8ce osbuild-playground: introduce new tool
This is meant for rapid prototyping of single image types and for
osbuild development, as an alternative to osbuild-mpp. The same
primitives are used as in the image definitions, but without any
policy or inheritance applied.

The user is expected to only edit `playground.go` and then run
the tool to produce osbuild manifests.
2022-07-04 23:04:29 +01:00
Tom Gundersen
a199745796 manifest/BasePipeline: clarify runners
A runner is used to run stages in a build pipeline. It is not about
running them on the host, in that case the runner is autodetected.

Not a functional change.
2022-07-04 23:04:29 +01:00
Tom Gundersen
168aa40b2d manifest/build: don't expose extra build packages
The build packages should always be computed from its
dependents and there should be no need to override it. Drop the
ability, and all the unused code in fedora/*.

NOTE: due to a bug in a previous patch in this PR the extra
package set was never set on the build pipelines.
2022-07-04 23:04:29 +01:00
Tom Gundersen
83e2060976 distro/fedora: drop package set name translations
No longer name the packageSetChains after the package set, but
keep them named after the pipelines. This should be a
non-functional change as dnf-json does not care about what the
chains are called, only that the names are unique.
2022-07-04 23:04:29 +01:00
Tom Gundersen
e6bc7dea18 manifests/fedora36/qcow2: regenerate with correct config
The current ones did not have the 'core' compsgroup set. Unsure how
this could happen.
2022-07-04 23:04:29 +01:00
Tom Gundersen
fbad41ac5e manifest: boot packages - move over anaconda pkgs
The same set is used for building and booting, move over the boot
logic to the pipeline as well.
2022-07-04 23:04:29 +01:00
Tom Gundersen
41f6e428af manifest: build packages - move over anaconda pkgs
squashfs-tools is used by the mono stage, and lorax by lorax.

For now copy over the anaconda boot package set as-is, we can
refactor further from the pipelines.
2022-07-04 23:04:29 +01:00
Tom Gundersen
7c51aba903 manifest: build packages - move over installer pkgs
The `installerBuildPackageSet() are required by the ISOPipeline,
move it there.
2022-07-04 23:04:29 +01:00
Tom Gundersen
70d7a25a8e manifest: build packages - move over 'rpm-ostree'
Move `iotBuildPackages()` from the distro to the pipelines.
2022-07-04 23:04:29 +01:00
Tom Gundersen
e51e4e458f manifest: build packages - move over distro-wide package set
Move `distroBuildPackages()` from the distro to the pipelines.
2022-07-04 23:04:29 +01:00
Tom Gundersen
82356c419c distros/fedora/pipelines: pass the right packageChains
This fixes a bug introduced in a previous commit and simplifies the
passing of packageChains.
2022-07-04 23:04:29 +01:00
Tom Gundersen
4961a17ba8 manifest: implicitly track pipelines in manifest
Pipelines are now added to their manifest on creation, and we
ensure that dependants are associated with the same manifest.
2022-07-04 23:04:29 +01:00
Tom Gundersen
28b8a790b5 manifest: provide depsolved packages when serializing
Rather than providing packageSpecs when constructing the
Manifest, do so at Serialize() time.

This allows the overall flow to be:

```
m := Manifest.New()
m.AddPipeline()
...
c := m.GetPackageSetChains()
p := Depsolve(c)
m.Serialize(p)
```
2022-07-04 23:04:29 +01:00
Tom Gundersen
c042af7d9c distro/fedora/PackageSets: get from Manifest object
Before you read this patch, be warned: this is crazy. But rest
assured, this is as bad as it gets, and by the end of this PR it
will all be infinitely simpler than it ever was.

We want Manifests to be self-describing, and in particular, we want
manifest.GetPackageSetChains() to return what
ImageType.GetPackages does today. This should be achieved by
pipelines knowing their required package sets, and the caller
optionally amending additional package sets at Pipeline
initialisation time.

As a first step, while pipelines don't yet know anything about their
required package sets, simply pass in the precomputed
PackageSetChains and set them as optional on each pipeline. Then
we can read the chains back out of t he manifest.

This is not a functional change, but allows us to gradually move
package set definitions from the distros to the pipelines in follow
ups.
2022-07-04 23:04:29 +01:00
Tom Gundersen
be5ea6a9b8 distro/ImageType: let PackageSets depend on ImageOptions
The package sets for an image can depend on the blueprint, and
by the same logic there is no reason it should not be able to
depend on the image options.

This is so far a non-functional change, but makes a follow-up
commit simpler (though still without actually depending on
the image options to compute the package sets).
2022-07-04 23:04:29 +01:00