composefs: Read manifest+config from composefs repo instead of .imginfo#2044
composefs: Read manifest+config from composefs repo instead of .imginfo#2044cgwalters wants to merge 3 commits intobootc-dev:mainfrom
Conversation
There was a problem hiding this comment.
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.
ef5cb0f to
d1f366d
Compare
|
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. |
|
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 Basically we create
In particular a key thing is that this works if the composefs repo holds other data such as app images. |
Extract read_origin() helper from status.rs into state.rs for reuse in GC. Add local [patch] for composefs-rs development. Adapt export.rs to use OpenConfig struct from updated composefs-rs API. Assisted-by: OpenCode (Claude claude-opus-4-6)
The new API gives us manifest-level information (digest, verity) which we need for tag-based GC later. Assisted-by: OpenCode (Claude claude-opus-4-6)
d1f366d to
215b824
Compare
Read manifest+config via OciImage::open() instead of .imginfo sidecar files, with fallback for legacy deployments. Create bootc-owned OCI tags as GC roots so the manifest->config->layer chain stays alive through standard composefs-rs reachability. Replace the manual transform_for_boot sequence with generate_boot_image(). The GC flow is now: prune unreferenced bootc tags, then repo.gc(). Assisted-by: OpenCode (Claude claude-opus-4-6)
215b824 to
e3b7826
Compare
| }; | ||
|
|
||
| let origin_filename = format!("{deployment_id}.origin"); | ||
| let Some(origin_contents) = state_dir.read_to_string_optional(&origin_filename)? else { |
There was a problem hiding this comment.
The .origin file should always exist right?
| needless_borrow = "allow" | ||
| needless_borrows_for_generic_args = "allow" | ||
|
|
||
| [patch."https://github.com/composefs/composefs-rs"] |
There was a problem hiding this comment.
I don't think we need this
There was a problem hiding this comment.
We do it's for composefs/composefs-rs#263
|
|
||
| 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 |
There was a problem hiding this comment.
this will always be an empty vec iiuc? Since we always delete the bootloader entries first
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>
The latest composefs-rs stores manifest and config objects and
the manifest becomes a GC root, so we can use that instead of
.imginfosidecar 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.