Skip to content

Commit

Permalink
osbuild: conditionally use the built payload as the buildroot
Browse files Browse the repository at this point in the history
With this we now use a buildroot that is derived from the OCI
container that was built by the pipeline. This allows us to use
the exact same versions of software from the payload we built
when we construct the images that we will ship, which will be
better for us over time.

The benefits of this are immediately apparent in this commit
as we are able to drop configuration that tries to set feature
flags for our ext4 filesystems based on what we think are the
current defaults in RHEL.

For now we aren't able to do this with FCOS because FCOS doesn't
have python in it. This should be OK for now because COSA is
almost always based on the latest version of Fedora. Though one
benefit we would have if we did switch to doing this for FCOS is
that we would test newer versions of "build tools" from `rawhide`
alongside the `rawhide` pipeline builds that we do.
  • Loading branch information
dustymabe committed May 22, 2024
1 parent 48f11cc commit 0f8b35a
Show file tree
Hide file tree
Showing 10 changed files with 249 additions and 144 deletions.
90 changes: 54 additions & 36 deletions src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ mpp-vars:
boot_fs_label: boot
root_fs_uuid: 910678ff-f77e-4a7d-8d53-86f2ac47a823
root_fs_label: root
# Set the buildroot string to use for most operations here. We create
# the buildroot from the target OSTree contents so we have version
# matches. Unfortunately for FCOS there is no python so we can't
# really use FCOS as the buildroot so we'll set it to "" so that
# the host (COSA) gets used as the buildroot there.
buildroot:
mpp-if: osname in ['rhcos', 'scos']
then: "name:build"
else: ""
# For the qemu stages we'll use the host buildroot (COSA)
# because we definitely don't include qemu-img in CoreOS. ""
# means to use the host as buildroot. It is worth noting that
# the host buildroot is the default if nothing is specified.
# We're still defining it here in an attempt to be explicit.
qemu_stage_buildroot: ""
mpp-define-images:
- id: image
sector_size:
Expand Down Expand Up @@ -94,7 +109,34 @@ pipelines:
to: tree:///coreos.ociarchive
else:
type: org.osbuild.noop
# Construct a buildroot here from the input container reference (either
# ociarchive or registry/tag). Note that it won't actually be built
# unless used somewhere later in the manifest.
- name: build
stages:
- mpp-if: ociarchive != ''
then:
type: org.osbuild.container-deploy
inputs:
images:
type: org.osbuild.containers
origin: org.osbuild.pipeline
references:
name:oci-archive:
name: coreos.ociarchive
else:
type: org.osbuild.container-deploy
inputs:
images:
type: org.osbuild.containers
origin: org.osbuild.source
mpp-resolve-images:
images:
- source: $container_repo
tag: $container_tag
- name: tree
build:
mpp-format-string: '{buildroot}'
source-epoch: 1659397331
stages:
- type: org.osbuild.ostree.init-fs
Expand Down Expand Up @@ -202,6 +244,8 @@ pipelines:
deployment:
default: true
- name: raw-image
build:
mpp-format-string: '{buildroot}'
stages:
- type: org.osbuild.truncate
options:
Expand Down Expand Up @@ -242,24 +286,10 @@ pipelines:
mpp-format-int: '{image.layout[''boot''].size}'
lock: true
options:
# If we are on RHCOS then set manually some FS options
# to the values we want in order to not depend on the
# defaults in the version of mkfs.ext4 in the build root.
# This is mostly useful right now because COSA is based
# on Fedora.
mpp-if: osname in ['rhcos', 'scos']
then:
orphan_file: false
metadata_csum_seed: true
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
else:
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
- type: org.osbuild.mkfs.xfs
devices:
device:
Expand Down Expand Up @@ -367,6 +397,8 @@ pipelines:
deployment:
default: true
- name: raw-4k-image
build:
mpp-format-string: '{buildroot}'
stages:
- type: org.osbuild.truncate
options:
Expand Down Expand Up @@ -413,24 +445,10 @@ pipelines:
sector-size:
mpp-format-int: "{four_k_sector_size}"
options:
# If we are on RHCOS then set manually some FS options
# to the values we want in order to not depend on the
# defaults in the version of mkfs.ext4 in the build root.
# This is mostly useful right now because COSA is based
# on Fedora.
mpp-if: osname in ['rhcos', 'scos']
then:
orphan_file: false
metadata_csum_seed: true
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
else:
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
- type: org.osbuild.mkfs.xfs
devices:
device:
Expand Down
90 changes: 54 additions & 36 deletions src/osbuild-manifests/coreos.osbuild.ppc64le.mpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ mpp-vars:
boot_fs_label: boot
root_fs_uuid: 910678ff-f77e-4a7d-8d53-86f2ac47a823
root_fs_label: root
# Set the buildroot string to use for most operations here. We create
# the buildroot from the target OSTree contents so we have version
# matches. Unfortunately for FCOS there is no python so we can't
# really use FCOS as the buildroot so we'll set it to "" so that
# the host (COSA) gets used as the buildroot there.
buildroot:
mpp-if: osname in ['rhcos', 'scos']
then: "name:build"
else: ""
# For the qemu stages we'll use the host buildroot (COSA)
# because we definitely don't include qemu-img in CoreOS. ""
# means to use the host as buildroot. It is worth noting that
# the host buildroot is the default if nothing is specified.
# We're still defining it here in an attempt to be explicit.
qemu_stage_buildroot: ""
mpp-define-images:
- id: image
sector_size:
Expand Down Expand Up @@ -96,7 +111,34 @@ pipelines:
to: tree:///coreos.ociarchive
else:
type: org.osbuild.noop
# Construct a buildroot here from the input container reference (either
# ociarchive or registry/tag). Note that it won't actually be built
# unless used somewhere later in the manifest.
- name: build
stages:
- mpp-if: ociarchive != ''
then:
type: org.osbuild.container-deploy
inputs:
images:
type: org.osbuild.containers
origin: org.osbuild.pipeline
references:
name:oci-archive:
name: coreos.ociarchive
else:
type: org.osbuild.container-deploy
inputs:
images:
type: org.osbuild.containers
origin: org.osbuild.source
mpp-resolve-images:
images:
- source: $container_repo
tag: $container_tag
- name: tree
build:
mpp-format-string: '{buildroot}'
source-epoch: 1659397331
stages:
- type: org.osbuild.ostree.init-fs
Expand Down Expand Up @@ -209,6 +251,8 @@ pipelines:
deployment:
default: true
- name: raw-image
build:
mpp-format-string: '{buildroot}'
stages:
- type: org.osbuild.truncate
options:
Expand All @@ -235,24 +279,10 @@ pipelines:
mpp-format-int: '{image.layout[''boot''].size}'
lock: true
options:
# If we are on RHCOS then set manually some FS options
# to the values we want in order to not depend on the
# defaults in the version of mkfs.ext4 in the build root.
# This is mostly useful right now because COSA is based
# on Fedora.
mpp-if: osname in ['rhcos', 'scos']
then:
orphan_file: false
metadata_csum_seed: true
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
else:
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
- type: org.osbuild.mkfs.xfs
devices:
device:
Expand Down Expand Up @@ -353,6 +383,8 @@ pipelines:
deployment:
default: true
- name: raw-4k-image
build:
mpp-format-string: '{buildroot}'
stages:
- type: org.osbuild.truncate
options:
Expand Down Expand Up @@ -383,24 +415,10 @@ pipelines:
sector-size:
mpp-format-int: "{four_k_sector_size}"
options:
# If we are on RHCOS then set manually some FS options
# to the values we want in order to not depend on the
# defaults in the version of mkfs.ext4 in the build root.
# This is mostly useful right now because COSA is based
# on Fedora.
mpp-if: osname in ['rhcos', 'scos']
then:
orphan_file: false
metadata_csum_seed: true
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
else:
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
- type: org.osbuild.mkfs.xfs
devices:
device:
Expand Down
90 changes: 54 additions & 36 deletions src/osbuild-manifests/coreos.osbuild.s390x.mpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ mpp-vars:
boot_fs_label: boot
root_fs_uuid: 910678ff-f77e-4a7d-8d53-86f2ac47a823
root_fs_label: root
# Set the buildroot string to use for most operations here. We create
# the buildroot from the target OSTree contents so we have version
# matches. Unfortunately for FCOS there is no python so we can't
# really use FCOS as the buildroot so we'll set it to "" so that
# the host (COSA) gets used as the buildroot there.
buildroot:
mpp-if: osname in ['rhcos', 'scos']
then: "name:build"
else: ""
# For the qemu stages we'll use the host buildroot (COSA)
# because we definitely don't include qemu-img in CoreOS. ""
# means to use the host as buildroot. It is worth noting that
# the host buildroot is the default if nothing is specified.
# We're still defining it here in an attempt to be explicit.
qemu_stage_buildroot: ""
mpp-define-images:
- id: image
sector_size:
Expand Down Expand Up @@ -82,7 +97,34 @@ pipelines:
to: tree:///coreos.ociarchive
else:
type: org.osbuild.noop
# Construct a buildroot here from the input container reference (either
# ociarchive or registry/tag). Note that it won't actually be built
# unless used somewhere later in the manifest.
- name: build
stages:
- mpp-if: ociarchive != ''
then:
type: org.osbuild.container-deploy
inputs:
images:
type: org.osbuild.containers
origin: org.osbuild.pipeline
references:
name:oci-archive:
name: coreos.ociarchive
else:
type: org.osbuild.container-deploy
inputs:
images:
type: org.osbuild.containers
origin: org.osbuild.source
mpp-resolve-images:
images:
- source: $container_repo
tag: $container_tag
- name: tree
build:
mpp-format-string: '{buildroot}'
source-epoch: 1659397331
stages:
- type: org.osbuild.ostree.init-fs
Expand Down Expand Up @@ -208,6 +250,8 @@ pipelines:
deployment:
default: true
- name: raw-image
build:
mpp-format-string: '{buildroot}'
stages:
- type: org.osbuild.truncate
options:
Expand All @@ -234,24 +278,10 @@ pipelines:
mpp-format-int: '{image.layout[''boot''].size}'
lock: true
options:
# If we are on RHCOS then set manually some FS options
# to the values we want in order to not depend on the
# defaults in the version of mkfs.ext4 in the build root.
# This is mostly useful right now because COSA is based
# on Fedora.
mpp-if: osname in ['rhcos', 'scos']
then:
orphan_file: false
metadata_csum_seed: true
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
else:
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
- type: org.osbuild.mkfs.xfs
devices:
device:
Expand Down Expand Up @@ -323,6 +353,8 @@ pipelines:
deployment:
default: true
- name: raw-4k-image
build:
mpp-format-string: '{buildroot}'
stages:
- type: org.osbuild.truncate
options:
Expand Down Expand Up @@ -353,24 +385,10 @@ pipelines:
sector-size:
mpp-format-int: "{four_k_sector_size}"
options:
# If we are on RHCOS then set manually some FS options
# to the values we want in order to not depend on the
# defaults in the version of mkfs.ext4 in the build root.
# This is mostly useful right now because COSA is based
# on Fedora.
mpp-if: osname in ['rhcos', 'scos']
then:
orphan_file: false
metadata_csum_seed: true
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
else:
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
uuid:
mpp-format-string: '{boot_fs_uuid}'
label:
mpp-format-string: '{boot_fs_label}'
- type: org.osbuild.mkfs.xfs
devices:
device:
Expand Down
Loading

0 comments on commit 0f8b35a

Please sign in to comment.