-
Notifications
You must be signed in to change notification settings - Fork 136
WIP: Add --unified to use our container-storage for host images #1601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
/// Use podman/skopeo to pull image to additionalimagestore, then read from container storage. | ||
/// This provides a unified approach that leverages existing container tooling. | ||
#[clap(long)] | ||
pub(crate) unified: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be a CLI flag that operates just once; it should be something like bootc image --set-unified
or so and act persistently.
Also we should support setting this at install time so that it happens from the very start.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(hmm my bad I thought we discussed this but I failed to update the issue #20 or something maybe?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh man yeah, we talked about saving the config on the origin file IIRC, I forgot.
use bootc_utils::CommandRunExt; | ||
|
||
// Use podman pull with additionalimagestore pointing to bootc storage | ||
let bootc_storage_path = "/usr/lib/bootc/storage"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use podstorage.rs instead please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To elaborate on this, an important aspect here is currently the GC of the bootc/storage instance is rooted in the set of LBIs. That will need to be extended to include the host image.
match prepare_for_pull_unified(repo, imgref, target_imgref, store).await? { | ||
PreparedPullResult::AlreadyPresent(existing) => { | ||
// Log that the image was already present (Debug level since it's not actionable) | ||
const IMAGE_ALREADY_PRESENT_ID: &str = "5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that if we go this route, we should also not log to the journal in the ostree pull path because otherwise we're double logging.
let fetched = if opts.unified { | ||
crate::deploy::pull_unified(repo, imgref, None, opts.quiet, prog.clone(), sysroot).await? | ||
} else { | ||
crate::deploy::pull(repo, imgref, None, opts.quiet, prog.clone()).await? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This relates to #1599 (comment)
Basically how about changing this code to take a Storage
which would hold the persistent flag, and then crate::deploy::pull
would itself query that flag and change its behavior.
That would also implicitly then fix the install path to behave the same.
Compiles and at least does not fail a bootc switch... and can see the image in the container storage we own.
This was drafted with the help of Claude Code.