Skip to content

Conversation

omertuc
Copy link
Collaborator

@omertuc omertuc commented Apr 27, 2025

Background / Context

Currently, LCA creates a seed image that is simply a bunch of files inside an empty container. Then during the deployment from a seed image LCA uses ostree-ext to pull the RHCOS container image corresponding to the seed image, creates a new stateroot from it, and then unpacks the seed image contents on top of that new stateroot.

Issue / Requirement / Reason for change

We do not leverage bootc for this, which could simplify some things and allow new possibilities.

Solution / Feature Overview

Following recent changes in bootc, we could now instead use bootc to install the seed image directly to a new stateroot.

This PR adds a new possible SeedGenerator CR annotation unsupported-experimental.lca.openshift.io/use-bootc that accepts only the value Use. If this annotation is present with this value, LCA will generate a seed image that is a valid bootc image. LCA will label the resulting image (at the OCI level) with a special label that identifies it as a bootc seed image.

Then, during deployment, LCA will check if the image is a bootc seed image (by inspecting said label) and if so, it will use bootc to install the seed image directly to a new stateroot.

Implementation Details

Nothing complicated, just new code paths

Other Information

This is still experimental and unsupported, hence the label name. We should do some heavy testing and develop this further before letting anyone use it in production.

Those bootc seed images can also be used with IBI using a simple Containerfile that adds the cluster configuration to the seed image, which will allow users to configure a cluster using a Containerfile and then simply switch to it like any other bootc image.

# Background / Context

Currently, LCA creates a seed image that is simply a bunch of files
inside an empty container. Then during the deployment from a seed image
LCA uses ostree-ext to pull the RHCOS container image corresponding to
the seed image, creates a new stateroot from it, and then unpacks the
seed image contents on top of that new stateroot.

# Issue / Requirement / Reason for change

We do not leverage bootc for this, which could simplify some things and
allow new possibilities.

# Solution / Feature Overview

Following recent changes in bootc, we could now instead use bootc to
install the seed image directly to a new stateroot.

This PR adds a new possible `SeedGenerator` CR annotation
`unsupported-experimental.lca.openshift.io/use-bootc` that accepts only
the value `Use`. If this annotation is present with this value, LCA will
generate a seed image that is a valid bootc image. LCA will label the
resulting image (at the OCI level) with a special label that identifies
it as a bootc seed image.

Then, during deployment, LCA will check if the image is a bootc seed
image (by inspecting said label) and if so, it will use bootc to install
the seed image directly to a new stateroot.

# Implementation Details

Nothing complicated, just new code paths

# Other Information

This is still experimental and unsupported, hence the label name. We
should do some heavy testing and develop this further before letting
anyone use it in production.

Those bootc seed images can also be used with IBI using a simple
Containerfile that adds the cluster configuration to the seed image,
which will allow users to configure a cluster using a Containerfile and
then simply switch to it like any other bootc image.
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 27, 2025
Copy link
Contributor

openshift-ci bot commented Apr 27, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Contributor

openshift-ci bot commented Apr 27, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tsorya for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

omertuc added a commit to omertuc/installer that referenced this pull request Apr 28, 2025
# Background / Context

With openshift-kni/lifecycle-agent#815 we can
generate seed images that are also bootc images. Using a simple
`Containerfile`, we can FROM these images, add a cluster configuration,
and get a fully bootable cluster

# Issue / Requirement / Reason for change

This Containerfile needs to be written manually

# Solution / Feature Overview

The installer can help the user write this Containerfile.

# Implementation Details

We add a new subcommand, `containerfile`, to the `image-based create`
command.

This command is similar to the config-image command, but instead of
generating an ISO, it generates a Containerfile that can be used to
build the configured-seed image.

# Other Information

- The installer does not actually build the image, this is left to the
  user. The installer only generates the Containerfile.

- The Containerfile currently needs to extract the tars. This is
  unnecessary, the lifecycle-agent should already do that during the
  seed build. There's no point in having those tars inside the image.

- Changed some other unrelated IBI code to leverage Go's `embed`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant