Commit graph

1350 commits

Author SHA1 Message Date
Gianluca Zuccarelli
e41e82935d rhel90: enable multi-level mountpoints
Previously it was only possible to configure separate partitions
for mountpoints in the allow list and their immediate subdirectories
only i.e. /var & /var/log
This fix allows for an arbitrary level of mountpoints, i.e. /var/log/audit,
/var/a/b/c/d/e and so on
2021-09-15 10:46:55 +02:00
Gianluca Zuccarelli
16e80ffa33 rhel85: enable multi-level mountpoints
Previously it was only possible to configure separate partitions
for mountpoints in the allow list and their immediate subdirectories
only i.e. /var & /var/log
This fix allows for an arbitrary level of mountpoints, i.e. /var/log/audit,
/var/a/b/c/d/e and so on
2021-09-15 10:46:55 +02:00
sanne
5a9d8c792b cloudapi: V2
V2 is compliant with api.openshift.com design guidelines.

Errors are predefined, have codes, and are queryable.

All requests have an operationId set: a unique identifier which is
sortable by time. This is added to the response in case of an error.

All returned objects have the href, id, and kind field set.
2021-09-14 15:32:21 +02:00
Tomas Hozza
19eb65e9fd RHEL-8.5/9.0: keep RHSM DNF plugins enabled on ec2, ec2-ha and ami
The RHSM DNF plugins `product-id` and `subscription-manager` are now
by default enabled on the RHEL-8.5 and RHEL-9.0 `ec2`, `ec2-ha` and
`ami` images.

The desired default state of the RHSM DNF plugins has been decided by
the RHSM team.

Related to https://bugzilla.redhat.com/show_bug.cgi?id=1996670

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-09-14 11:47:09 +02:00
Diaa Sami
20501f4e58 Fix package sets for tar installer image type 2021-09-10 15:17:54 +02:00
Chloe Kaubisch
11023cb8a8 cloudapi: change Organization customization to a string
Internally change Organization in the SubscriptionImageOptions
to a string instead of an int.
2021-09-08 17:38:05 +02:00
sanne
4a057bf3d5 auth: OpenID/OAUth2 middleware
2 configurations for the listeners are now possible:
- enableJWT=false with client ssl auth
- enableJWT=true with https

Actual verification of the tokens is handled by
https://github.com/openshift-online/ocm-sdk-go.

An authentication handler is run as the top level handler, before any
routing is done. Routes which do not require authentication should be
listed as exceptions.

Authentication can be restricted using an ACL file which allows
filtering based on JWT claims. For more information see the inline
comments in ocm-sdk/authentication.

As an added quirk the `-v` flag for the osbuild-composer executable was
changed to `-verbose` to avoid flag collision with glog which declares
the `-v` flag in the package `init()` function. The ocm-sdk depends on
glog and pulls it in.
2021-09-04 02:48:52 +02:00
sanne
5e72636331 Revert "cloudapi: Add x-rh-identity header filter"
This reverts commit 19db3ff1d4.
2021-09-04 02:48:52 +02:00
sanne
7a0ea5b244 worker: Remove identity filter
Partially reverts "0ea31c39d5"
2021-09-04 02:48:52 +02:00
Antonio Murdaca
806bb375ee internal/distro/rhel85: move systemd logs kargs to the installer image
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2021-09-03 23:29:08 +02:00
dependabot[bot]
3ccdf85295 build(deps): bump github.com/golang/protobuf from 1.4.3 to 1.5.2
Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.4.3 to 1.5.2.
- [Release notes](https://github.com/golang/protobuf/releases)
- [Commits](https://github.com/golang/protobuf/compare/v1.4.3...v1.5.2)

---
updated-dependencies:
- dependency-name: github.com/golang/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Ondřej: I also fixed a deprecated call.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-09-03 18:23:54 +02:00
Martin Sehnoutka
cd0d450c3a distro: introduce Fedora 36 alias
Fedora 35 has been branched. Introduce an alias for Fedora 36 as it is
the current rawhide. Source of the GPG key:
https://raw.githubusercontent.com/xsuchy/distribution-gpg-keys/main/keys/fedora/RPM-GPG-KEY-fedora-36-primary
2021-09-03 15:05:00 +02:00
Diaa Sami
c35097fd52 Support for temporary credentials
Handle session token so that temporary credentials are supported
2021-09-02 15:13:42 +02:00
Chloe Kaubisch
86082c884d cloudapi: fix compose return value
Correct compose successful return status from http.StatusOK to
http.StatusCreated. Mistakenly set to http.StatusOK in previous
commit.
2021-09-01 22:15:35 +02:00
Thomas Lavocat
8a6e0e2b75 cloudapi: correct format of error strings
Fixes bad formats for the error in the cloudapi.
2021-09-01 20:02:07 +02:00
Ondřej Budai
c5fb118855 distro/rhel90: remove iwl6000-firmware from package sets
This package is no longer available in RHEL 9, let's drop it from our
definition.

Fixes #1696

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-08-30 18:22:58 +02:00
Christian Kellner
3dfc997992 distro/rhel85: move payloads to iso root
Move the ostree repository and the tar image to the root of the
boot iso. This has several advantages: we do no longer have to
correctly guess the size of the anaconda image. Also we do not
need to compress the payload within the squashfs.
Update the image installer's test data. NB: the changes to the
package list were introduced earlier and should mostly affect
the build pipeline. Should have caught is in the corresponding
change, but was apparently not picked up by CI.
2021-08-30 12:50:38 +02:00
Christian Kellner
1a063680b5 distro/rhel85: add support for edge raw images
OSBuild Composer can now build the RHEL 8.5 Raw Images. This images are
compressed raw images, i.e. a file that has a partition layout with an
deployed OSTree commit in it. It can be used to flash onto a hard drive
or booted in a virtual machine. An existing OSTree commit needs to
be provided.
The following image new types are supported: edge-raw-image.
2021-08-28 09:20:19 +02:00
Christian Kellner
c6b2d3009b distro/rhel85: partition table for edge + aarch64
Define the partition layout for RHEL for Edge images on arm64.
2021-08-28 09:20:19 +02:00
Christian Kellner
1054eab392 distro/rhel85: extract edge image pipelines
Extract the pipelines that create the edge raw image so that we can
expose that as its own image type.
2021-08-28 09:20:19 +02:00
Christian Kellner
0612d14502 distro/rhel85: aarch64 support for edge installers
All RHEL for Edge installer should be supported on aarch64 now.
2021-08-28 09:20:19 +02:00
Christian Kellner
97b20ca0da distro/rhel85: aarch64 support for bootiso mono
Add aarch64 support for the bootiso.mono stage: select the proper efi
architecture and include isolinux only on x86.
2021-08-28 09:20:19 +02:00
Christian Kellner
3e90d66f5c distro/rhel85: no biosdevname on aarch64
Do not include the biosdevname dracut module on aarch64, where it
does not exist.
2021-08-28 09:20:19 +02:00
Christian Kellner
44cf29dad0 distro/rhel85: aarch64 pkgs for installers
Make the package sets for all the installer work on aarch64.
Needed to explicitly pull in fcoe-utils for anaconda on aarch64.
2021-08-28 09:20:19 +02:00
Christian Kellner
fc5c2dbe7d distro/rhel85: refactor installer pkgs set
Split out the common package set of the anaconda based installers and
the coreos installer based one.
2021-08-28 09:20:19 +02:00
Christian Kellner
714250aa9c distro/rhel85: refactor pkg set generation
Instead of using package sets at the distro, arch and image type
level and then merging them in `PackageSets`, store the function
that generates the package set in the image type and have them
return all the package set. In order to do so, they now take an
imageType parameter so that they can also return architecture
dependent packages.
2021-08-28 09:20:19 +02:00
Christian Kellner
0e9e1b32d4 distro/rhel85: move distro build pkgs to pkg set
Instead of having a common build package set defined at distro
struct level and merging them together with build packages in
the image type (and arches), we do the "inheritance" at the
package set level and append more specific packages to base
sets there. We also now ensure that each image type does have
a build package set defined.
The actual package set should not change for anything due to
this commit.
2021-08-28 09:20:19 +02:00
Christian Kellner
963df5188e distro/rhel85: split up intaller build pkgs set
Split the common installer build packages from the one specific to
anaconda and edge.
NB: The "inheritance" is now done in the package sets rather than
outside, via package set merging.
2021-08-28 09:20:19 +02:00
Christian Kellner
755bde0afb distro/rhel85: remove duplicated edge builds pkgs
The edge specific build packages, `edgeBuildPkgsKey` where defined
on the distro level but also always included in all actual edge
image types; there were thus duplicated.
2021-08-28 09:20:19 +02:00
Christian Kellner
4e80c1bc82 distro/rhel85: add simplified edge installer
This adds a new installer called the "Simplified Installer" for Edge.
In contrast to the existing insaller, which is based on Anaconda, this
new installer based on the CoreOS installer project[1], a small rust
based binary that is executed in the initramfs and will flash a raw
image to a specified installation device. For this a new blueprint
option is introduced. The raw image is created from an existing OSTree
commit and embedded into the resulting bootable iso. When booting the
iso the installation will automatically start witout any interaction
from the user.
NB: As with the existing edge installer, support is currently limited
to x86. The new installer also does not support non-uefi boot.

[1] https://github.com/coreos/coreos-installer

Co-Developed-by: Achilleas Koutsou <achilleas@koutsou.net>
Co-Developed-by: Antonio Murdaca <runcom@linux.com>
2021-08-28 09:20:19 +02:00
Christian Kellner
3877d63c82 distro/rhel85: greenboot param for grub2 stage
Add a new param to the helper function creating the grub2 stage, that
indicates whether greenboot should be enabled. So far this is false
for all uses, so nothing should change.
2021-08-28 09:20:19 +02:00
Christian Kellner
450d12fada osbuild2/grub: add greenboot option
The greenboot option, introduced in osbuild 33, enables the
feature of the same name in grub that allows rolling back
bad updates automatically.
2021-08-28 09:20:19 +02:00
Christian Kellner
6d08418107 blueprint: add CheckAllowed helper
New helper to check if a blueprint containts only a set of allowed
customization. If not an error is returned.
2021-08-28 09:20:19 +02:00
Christian Kellner
36084fba20 distro/rhel85: add efibootmgr to x64 boot pgk set
Explicitly include efibootmgr in the list of x86_64 uefi boot pkgs.
Normally this is included via comps groups[1] (or weak deps).

[1] https://pagure.io/fedora-comps/blob/main/f/comps-f36.xml.in#_64
2021-08-28 09:20:19 +02:00
Christian Kellner
6e70506903 osbuild2/copy: ctor helper with only inputs
Add a simple constructor helper function that does not have mounts
and devices but only inputs.
2021-08-28 09:20:19 +02:00
Achilleas Koutsou
8970cdfd83 distro/rhel85: fix input name for copy tree inputs
The name parameter always existed but was not actually used.
2021-08-28 09:20:19 +02:00
Christian Kellner
242e1d69ee distro/rhel85: make isolinux installation optional
isolinux might not be wanted if legacy support is not desired or if it
is not supported by the architecture, i.e. by anything else than x86.
2021-08-28 09:20:19 +02:00
Achilleas Koutsou
4126f4e17a distro/rhel85: name param for xorrisofs input
It might not always be `bootiso-tree`.
2021-08-28 09:20:19 +02:00
Christian Kellner
3781cc0f47 distro/rhel85: make anaconda optional for dracut
Add an argument to `dracutStageOptions` so that additional dracut
modules can be supplied. Remove `anaconda` from the list of mods
that are included by default, and manually include it for the
anaconda based installer.

Co-Developed-by: Achilleas Koutsou <achilleas@koutsou.net>
Co-Developed-by: Antonio Murdaca <runcom@linux.com>
2021-08-28 09:20:19 +02:00
Antonio Murdaca
10e4a853bd osbuild2: ostree options for the fstab stage
osbuild, since version 30, supports the ostree deployments for the
fstab stage.

Co-Developed-by: Achilleas Koutsou <achilleas@koutsou.net>
Co-Developed-by: Christian Kellner <christian@kellner.me>
2021-08-28 09:20:19 +02:00
Achilleas Koutsou
a98be74135 osbuild2/ostree.preptree: add missing options
Add the missing options for the `org.osbuild.ostree.preptree` stage.
2021-08-28 09:20:19 +02:00
Christian Kellner
cda1884de3 osbuild2: files input is a valid copy stage input
Mark the `FilesInput` as valid input for the copy stage input so it
can be used in the constructor helper function(s).

Co-Developed-by: Achilleas Koutsou <achilleas@koutsou.net>
Co-Developed-by: Antonio Murdaca <runcom@linux.com>
2021-08-28 09:20:19 +02:00
Christian Kellner
d27596b24a osbuild2: make inputs generic for copy stage ctor
Add a level of indirection for the copy stage constructor function
in order to be able to use it with existing input types, like the
files input.

Co-Developed-by: Achilleas Koutsou <achilleas@koutsou.net>
Co-Developed-by: Antonio Murdaca <runcom@linux.com>
2021-08-28 09:20:19 +02:00
Achilleas Koutsou
2a98885953 osbuild2: OSTreeRemote → OSTreeSourceRemote
Properly name the ostree remote source struct.
2021-08-28 09:20:19 +02:00
Christian Kellner
f08fa8c5ca distro/rhel85: add install option for grub2 stage
Add a new `install` option to the `grub2StageOptions` which directly
translates to the `uefi.install` option for the grub2 stage. This
should be false for all existing pipelines, where RPM directly is
used to fill `/boot/efi/EFI/<vendor>`.

Co-Developed-by: Achilleas Koutsou <achilleas@koutsou.net>
Co-Developed-by: Antonio Murdaca <runcom@linux.com>
2021-08-28 09:20:19 +02:00
Antonio Murdaca
4fdf4dbd01 osbuild2: add stages for raw images and grub iso
Add the new stages included in osbuild 30 that can be used to
deploy an OSTree commit as well as the grub iso stage that
is used to configure grub2 (efi) for isos.
Bump the spec file requirement accordingly.

Co-Developed-by: Achilleas Koutsou <achilleas@koutsou.net>
Co-Developed-by: Christian Kellner <christian@kellner.me>
2021-08-28 09:20:19 +02:00
Achilleas Koutsou
14b5e98be8 osbuild2/xorrisofs: make Boot section optional
Should be a pointer otherwise it creates an empty object in the manifest
which makes the stage fail.

Co-Developed-by: Christian Kellner <christian@kellner.me>
2021-08-28 09:20:19 +02:00
Achilleas Koutsou
51bb4ea3a1 distro/rhel85: grub2 prefix path based on partition
If the partition table has a /boot partition, the grub2 prefix path
should be /grub2.
2021-08-28 09:20:19 +02:00
Achilleas Koutsou
39b0cf39d6 osbuild2: add support for LVM stages
Stage options implement a validate() method for checking values against
schema constraints.
2021-08-28 09:20:19 +02:00
Christian Kellner
df30073d65 distro/rhel85: pre-load uid/gid database for edge
When building RHEL for Edge commits and a parent together with an
URL was specified, add a `org.osbuild.ostree.passwd` stage which
then will pre-load the uid/gid database with the data from the
parent commit. This ensures that uids and gids do not change for
the "child" commit.
2021-08-27 12:56:54 +02:00