Skip to content

composefs: Read manifest+config from composefs repo instead of .imginfo#2044

Draft
cgwalters wants to merge 2 commits intobootc-dev:mainfrom
cgwalters:prep-composefs-manifest
Draft

composefs: Read manifest+config from composefs repo instead of .imginfo#2044
cgwalters wants to merge 2 commits intobootc-dev:mainfrom
cgwalters:prep-composefs-manifest

Conversation

@cgwalters
Copy link
Copy Markdown
Collaborator

@cgwalters cgwalters commented Mar 4, 2026

The latest composefs-rs stores manifest and config objects and
the manifest becomes a GC root, so we can use that instead of .imginfo
sidecar files.

The flow now is:
bootloader entry -> deployment -> origin file
-> manifest digest -> manifest -> [config | objects]

For backward compatibility, fall back to the legacy .imginfo
file if the .origin does not contain a manifest_digest key.

Drop the really old hacky fallback that did network fetches.

Note the manifest becomes part of the GC root.

@github-actions github-actions bot added the area/install Issues related to `bootc install` label Mar 4, 2026
@bootc-bot bootc-bot bot requested a review from gursewak1997 March 4, 2026 21:18
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors how container image manifest and configuration are handled for composefs deployments. Instead of storing them in a separate .imginfo file, the manifest digest is now stored in the .origin file, and the manifest/config are read directly from the composefs repository. This is a good improvement that centralizes image metadata storage. The changes are consistent across the codebase, and backward compatibility for older deployments with .imginfo files is maintained. I've found one area for improvement regarding repository handling efficiency.

@cgwalters cgwalters force-pushed the prep-composefs-manifest branch 3 times, most recently from ef5cb0f to d1f366d Compare March 13, 2026 12:22
@cgwalters cgwalters marked this pull request as ready for review March 13, 2026 14:33
@cgwalters cgwalters enabled auto-merge (rebase) March 13, 2026 15:08
@cgwalters
Copy link
Copy Markdown
Collaborator Author

OK, this is passing tests now and I think is a notable cleanup.

I think this may be one of the last ~breaking changes for the composefs installation layout.

@cgwalters cgwalters disabled auto-merge March 13, 2026 15:19
@cgwalters
Copy link
Copy Markdown
Collaborator Author

cgwalters commented Mar 13, 2026

Actually thinking about this more...it feels like we should really be creating tags in the cfs repo instead of using this additional root stuff. That's effectively what ostree does with ostree/ refs. Will look at a PoC

Basically we create localhost/bootc-<manifestsha> tags that are "owned" by bootc, and our GC is:

  • walk over all bootloader entires, gather their origin images and load the manifest sha digest
  • load all localhost/bootc- prefixed tags in the cfs repo
  • Remove all unreferenced tags
  • Just run cfsctl gc effectively

In particular a key thing is that this works if the composefs repo holds other data such as app images.

@cgwalters cgwalters force-pushed the prep-composefs-manifest branch 2 times, most recently from 215b824 to e3b7826 Compare March 15, 2026 17:46
};

let origin_filename = format!("{deployment_id}.origin");
let Some(origin_contents) = state_dir.read_to_string_optional(&origin_filename)? else {
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.

The .origin file should always exist right?

Cargo.toml Outdated
needless_borrow = "allow"
needless_borrows_for_generic_args = "allow"

[patch."https://github.com/composefs/composefs-rs"]
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 don't think we need this

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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


tracing::debug!("img_bootloader_diff: {img_bootloader_diff:#?}");
// Bootloader entries without a state dir are from interrupted cleanups.
let orphaned_boot_entries: Vec<_> = bootloader_entries
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 will always be an empty vec iiuc? Since we always delete the bootloader entries first

@cgwalters cgwalters marked this pull request as draft March 16, 2026 21:05
Johan-Liebert1 pushed a commit to cgwalters/composefs-rs that referenced this pull request Mar 17, 2026
The open_config() return type changed from a tuple to the OpenConfig
struct. Point the bootc reverse-dep CI at bootc-dev/bootc#2044 which
has the matching API update, until that PR is merged to main.

Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <walters@verbum.org>
github-merge-queue bot pushed a commit to composefs/composefs-rs that referenced this pull request Apr 2, 2026
The OCI digest cleanup breaks the bootc API boundary. Re-enable
once bootc-dev/bootc#2044 lands on bootc main.

Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <walters@verbum.org>
By far the biggest change here is to how we do our GC
logic. Now, composefs-rs itself holds refs to the EROFS
images; we just need to hold onto the images themselves.

Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters force-pushed the prep-composefs-manifest branch 2 times, most recently from 4951c82 to 1af0080 Compare April 2, 2026 20:37
For registry transports, pull_composefs_repo() now goes through
bootc-owned containers-storage first (via podman pull), then imports
from there into the composefs repo via skopeo's containers-storage
transport. This means the source image remains in containers-storage
after upgrade, enabling 'podman run <booted-image>'.

Non-registry transports (oci:, containers-storage:, docker-daemon:)
continue using the direct skopeo path.

Also fix composefs_oci::pull() callsite to pass the new zerocopy
parameter added in the composefs-rs import-cstor-rs-rebase branch.

Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters force-pushed the prep-composefs-manifest branch from 1af0080 to e19a663 Compare April 3, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/install Issues related to `bootc install`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants