Skip to content

Misc. Improvements Draft PR#2294

Draft
antheas wants to merge 5 commits into
bootc-dev:mainfrom
antheas:draft-improvements
Draft

Misc. Improvements Draft PR#2294
antheas wants to merge 5 commits into
bootc-dev:mainfrom
antheas:draft-improvements

Conversation

@antheas

@antheas antheas commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Here are some improvements I came up with while working with bootc lately. They are by no means ready to merge (and vibed). Hopefully they are an inspiration.

Here is a small summary.

  1. The current RPM for bootc compiles bootc three times because of the docs and tests instead of re-using the first build. Commit is junk and I vibed it, but I need to be able to build the spec for my workflow. It would be nice to fix so it compiles once.
  2. bootc internals ostree-ext container encapsulate --contentmeta still adds the empty package layer. It probably shouldn't. The caller can add an extra layer if they desire. I am unaware of someone using the previous manifest option with rpm-ostree in either case.
  3. bootc internals ostree-ext container encapsulate and ABI is still single threaded, and because of the current architecture it's very hard to fix (by hand). But it is around 3 times faster with 4 workers (~3min to 40s in testing)
  4. Bootc does not preserve the .version key during merge commits so ostree does not write the version on the bootloader. Perhaps the source here should be the OCI label, but for my usecase the ostree tag works fine.
  5. bootc internals ostree-ext container unencapsulate always does a checkout, even when a commit has no derived layers. This adds 10-20 seconds on deployment times universally and spins fans, even though it is not needed. It is also important for my usecase because it means you cannot do unencapsulate on a bare-split-attrs repo currently, because it does not support checkouts.

@github-actions github-actions Bot added the area/ostree Issues related to ostree label Jul 8, 2026
@bootc-bot bootc-bot Bot requested a review from gursewak1997 July 8, 2026 00:55

@cgwalters cgwalters left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this, I think it'd make sense to split this into distinct PRs?

Comment thread Makefile
.PHONY: bin
bin: manpages
cargo build --release --features "$(CARGO_FEATURES)" --bins
if [ ! -x "$(BOOTC_TARGET_DIR)/bootc" ]; then \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This completely breaks the buildsystem, no? We'd just silently be reusing old binaries...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that patch is not good and not designed for merge. But it did its job for me.

It is very hard to iterate with bootc while having it compile three times to deploy

Comment thread Makefile
.PHONY: manpages
manpages:
cargo run --release --package xtask -- manpages
if [ -x "$(BOOTC_TARGET_DIR)/bootc" ]; then \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But yes, this is really really messy how we have our documentation depend on running the binary.

Maybe what is easier is to try to move instead to where we just validate the generated docs as a separate phase, but don't default to linking the two together.

It's effectively what we did for the tmt stuff

let commit = commit.to_string();
let ocidir = ociw.dir().try_clone().context("Cloning OCI directory")?;
let opts = worker_opts.clone();
handles.push(thread::spawn(move || {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be cleaner to use https://doc.rust-lang.org/stable/std/thread/fn.scope.html - or use rayon. (Or use tokio)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this was a fast fixup that works. I wouldn't be happy merging it, the deploy speedup is real though

r.push(max_freq_components);
}

// Allocate an empty bin for new packages

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree we never used this in practice, and we can probably drop it now. OTOH, this code is basically obsoleted by https://github.com/coreos/chunkah anyways?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is a nice tool. I will keep it in mind for non-ostree images

ostree-ext provides a fast deploy path for ostree backends so it will have to stay around until the composefs backend is stable with similar performance to the fast ostree deploy path, then add 2-3 more years for migration or a way to specify to bootc interim migration paths so e.g., version 2027.3 switches to composefs and points ostree instances to 2027.2 that has the machinery to migrate from ostree to composefs while being built for ostree. Ah.

META_CONFIG,
import.config.to_canon_json_string()?.to_variant(),
);
if let Some(version) = image_version {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may relate to #2136

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related but not quite. It's true that for images built with docker / buildah they need to be tagged twice so docker compatible registries that only read the leaf manifest can see the tag and tools like podman / skopeo that read the inner config can pick up those

This fixes the bootloader version exposed by ostree. Without this entries appear like PRETTY_NAME. This PR supersedes the one for PRETTY_BOOTLOADER

Ideally on the spinoff, bootc could be taught to set the version tag on the merge commit based on org.opencontainers.image.version while falling back to ostree

@antheas

antheas commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Hi, yes, this PR is not designed to merge

It is more of an issue with some draft solutions attached, moreso for inspiration.

Which ones do you think should spinoff as draft PRs and which should land in an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ostree Issues related to ostree

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants