Skip to content

Deployment variant configurations for bootc containers (HMS-11199) #2566

Description

@supakeen

Currently image-builder sources configuration from /usr/lib/image-builder/bootc. Specifically it will read disk.yaml (for partition table information), and/or iso.yaml (for ISO configuration).

These files partially define how image-builder will convert a given bootable container into an artifact.

There is a wish from (amongst others) the CoreOS team to be able to select how things are converted, not based on a different input container, but based on a runtime option. As an example for s390x secure execution the partition table needs to include verity partitions but we can imagine other usecases such as a btrfs or ext4 variant for Fedora images. These variants would be user-selectable.

The idea is that we consider any files found in /usr/lib/image-builder/bootc the 'default' variant. By that we mean 'no variant selected'.

Variants can be defined in /usr/lib/image-builder/bootc/variant.d/ each one is a directory and the variant name is the directory name, for example: /usr/lib/image-builder/bootc/variant.d/secure-execution containing a disk.yaml with specific partition layout for secure-execution. The person building the bootable container can decide which variants are included where (and on which architectures) through the use of $TARGETARCH or any logic they want to use.

Another example of this would be to have a rpi3 and a rpi4+ variant where the former is MBR-partitioned and the latter uses GPT-partitioning.

  1. image-builder (build|manifest) would gain a new command line option tentatively named --bootc-variant which takes a string and modifies the path we look at for the configuration. Handling errors if it doesn't exist.
  2. image-builder bootc inspect would also get a --variant argument to select the variant to inspect for.
  3. image-builder bootc variants would list the available variants (could live elsewhere too?).

It's up to the publishers of the containers to make people aware of variant usage. A full end-to-end example would be:

$ image-builder bootc variants --ref quay.io/fedora/fedora-bootc:latest
btrfs
plain
$ image-builder build --bootc-ref quay.io/fedora/fedora-bootc:latest --bootc-variant plain
# ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    admin/has-jiraTracked in JIRA as well.area/bootcRelated to bootable containers.enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions