-
Notifications
You must be signed in to change notification settings - Fork 191
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
treefile: Drop override-replace-local-rpms and support install and overrides by URL in container path #3670
Conversation
Skipping CI for Draft Pull Request. |
Keeping this as draft; trying to oxidize |
Split out prep patches in #3671. |
Well, we can start making use of e.g. ostreedev/ostree#2532 |
0418fe8
to
465dc7f
Compare
465dc7f
to
b9dab84
Compare
We need write support too. Unless you're suggesting doing that through |
I think we should add write support to ostree-rs-ext. But this is a larger topic. |
a0c7533
to
783c2c4
Compare
OK latest commits add:
Though one thing missing is inactive override detection like we have in the client-side. I think we need to lower that logic from the upgrader to the core. Will split this up into multiple commits/PRs. |
8f94699
to
4411d91
Compare
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.
Overall direction LGTM!
let mut pkg = unsafe { | ||
libdnf_sys::dnf_package_from_ptr(&mut pkg.0 as *mut _ as *mut libdnf_sys::FFIDnfPackage) | ||
}; | ||
let name = pkg.pin_mut().get_name(); |
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 think it'd be a bit cleaner to do:
let mut pkg = ...;
let pkg = pkg.pin_mut();
let name = pkg.get_name()
let evr = pkg.get_evr()
etc.
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.
Heh, I initially did that, but it complains about the value being moved on the first call. TBH, I don't quite understand the pinning stuff, so just went with this.
Came up in review of coreos#3671.
Instead of having individual separate functions acting on a pointer to a libdnf object, bundle them up into proper classes instead. This not only makes it feel cleaner on the Rust side, but also has the major advantage of being able to hold a reference to an object. This means that it's easier to wrap libdnf functions that return new references for use on the Rust side, which is something we'll do in an upcoming patch.
Prep for next patch.
The addition of `override-replace-local-rpms` was a hack to bridge the gap between the container and client-side flow where only the latter has access to a pkgcache repo. This patch enhances the existing `override-replace-local` key to work in the container flow: we stage RPMs in a directory in `/run`, and the core knows to look there for them. This then allows us to remove the `override-replace-local-rpms` key and clean up a bunch of things related to it. To be nice, we might have to in the future expose the staging logic as a separate command which outputs on stdout the digest and NEVRA so that users can include them in their YAML dropins. This is prep also for supporting local RPMs, which will work a similar way.
Use the same `client_handle_fd_argument` function which knows how to handle Bodhi/Koji URLs and regular RPM filenames and URLs in the container handling paths for `install` and `override replace`. This also allows us to drop another treefile mutator that's no longer necessary (`set_packages`). Closes: coreos#3560
4411d91
to
7355631
Compare
OK cleaned this up and made separate commits now! |
dnf_package_get_arch (DnfPackage &pkg) | ||
{ | ||
return rust::String (::dnf_package_get_arch (&pkg)); | ||
return std::make_unique<DnfPackage> (g_object_ref (pkg)); |
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.
The downside is we're double boxing. But, eh.
@@ -224,6 +229,45 @@ pub(crate) fn verify_kernel_hmac(rootfs: i32, moddir: &str) -> CxxResult<()> { | |||
verify_kernel_hmac_impl(&moddir).map_err(Into::into) | |||
} | |||
|
|||
pub(crate) fn stage_container_rpms(rpms: Vec<String>) -> CxxResult<Vec<String>> { |
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'm fine with this as is, but: why not switch to doing this in the daemon path too?
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.
Yeah, maybe.
The idea with this is that it acts like the pkgcache repo in the container case where we don't have one. So we could use this client-side too, but then turn around and immediately import them into the pkgcache? I could see some utility to that. But I was actually thinking of going the other way and eventually drop this once we can use bare-split-xattrs more easily. That opens the door to using the full core assembly code. So then e.g. things like kernel replacement would re-use the same path.
OK, merging this! |
The addition of
override-replace-local-rpms
was a hack to bridge thegap between the container and client-side flow where only the latter has
access to a pkgcache repo.
This patch enhances the existing
override-replace-local
key to work inthe container flow: we stage RPMs in a directory in
/run
, and the coreknows to look there for them.
This then allows us to remove the
override-replace-local-rpms
key andclean up a bunch of things related to it.
To be nice, we might have to in the future expose the staging logic as a
separate command which outputs on stdout the digest and NEVRA so that
users can include them in their YAML dropins.
This is prep also for supporting local RPMs, which will work a similar
way.