-
Notifications
You must be signed in to change notification settings - Fork 169
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
Add cosa buildextend-extensions
#2028
Conversation
Skipping CI for Draft Pull Request. |
This still needs more testing and splitting out some prep patches, as (And yes, I realize |
Added a bunch more commits to migrate This is what the labels look like right now:
Hitting a few complications on RHCOS:
|
With coreos/rpm-ostree#2439 and coreos/coreos-assembler#2028, support for extensions is now more robust. The extensions.yaml file is now fed directly to rpm-ostree. We just need to do some minor tweaks: - drop listing usbguard deps, rpm-ostree fetches them automatically - mark `kernel-devel` as a development extension; this will signal the MCO that it's not intended to be directly layered on the host - use `match-base-evr: kernel` to enforce that the kernel development packages have the same EVR as the base kernel package in the OSTree
LGTM
Enabling it in treecompose won't be an issue today but who knows the future (like more extensions coming from additional repos) and these additional repos are managed by someone else. It can be an overhead to make sure that these repos don't contain any base layer packages.
Yes, a clear distinction would be needed to make sure what packages should be installed as part of an extension. Instead of
One question that I have is, do we create extensions.yaml during compose process? Reason of asking this is consider following case: |
For handling kernel switch, one useful information for MCO would be to know what all kernel packages are installed for default kernel. Today, we hardcode that information in MCO https://github.com/openshift/machine-config-operator/blob/master/pkg/daemon/update.go#L1158 . Adding it in extension.yaml will make us stop hardcoding these package list.
|
Thinking about this a bit more, I think what would make more sense is specify only direct packages that we would need to install in order to enable an extension and add dependencies into deps section.
The way MCO enables today usbguard is run |
With coreos/rpm-ostree#2439 and coreos/coreos-assembler#2028, support for extensions is now more robust. The extensions.yaml file is now fed directly to rpm-ostree. We just need to do some minor tweaks: - drop listing usbguard deps, rpm-ostree fetches them automatically - split the devel bits into two extensions: one is an OS extension which contains the devel and headers packages, and the other is a development extension containing kernel packages already in the base (marking it as a development extension will signal the MCO that it's not intended to be directly layered on the host) - use `match-base-evr: kernel` on those to enforce that the kernel development packages have the same EVR as the base kernel package in the OSTree
Mmm I'd like to bake that flow a bit more into rpm-ostree, perhaps something like |
Sorry, I hadn't updated this comment with a link to coreos/rpm-ostree#2519.
Yes exactly, except we don't even need to track dependencies anymore. Check out how in openshift/os#496, we don't need to specify Since each extension compose is specific to an OSTree commit, if a dep becomes a base pkg, rpm-ostree would just stop shipping that dep in the extensions repo. As long as the top-level packages themselves aren't in the base, it should be fine (and rpm-ostree checks for this at compose time).
Hmm interesting idea, I've toyed with something like that a bit in coreos/rpm-ostree#2519. In the end though, the kernel devel situation is so peculiar (and just hacky) that any way of generalizing will look awkward. What I ended up doing in coreos/rpm-ostree#2519 is to have two separate kinds of extensions: |
Even better if we can bake in something like |
OK moved that to coreos/rpm-ostree#2542 |
c559735
to
724fa43
Compare
OK, here's how the labels will actually look with this + openshift/os#496:
|
This is ready for review but needs new rpm-ostree. |
ah, I missed it. Sweet, this is much cleaner and better! Also can't stop thinking that kernel-rt in reality is not an extension, instead it is a kernel replacement. Perhaps we should add it into One minor change I would say is drop kernel-rt-devel from direct package list, so far we are not installing it with RT kernel switch (https://github.com/openshift/machine-config-operator/blob/master/pkg/daemon/update.go#L1159) . Maybe we can add it in development kind which would need a bit readjustment in yaml levels. Perhaps something like:
|
I agree with this. Probably in fact what we should do is generate two base OSTree commits - i.e. they show up as separate container images or so, like |
Thanks for working this out. I think this is a great improvement from the current state of things. I left some thoughts about future refinements that could be pursued later. /approve |
cf2ef07
to
89e257b
Compare
Prep for coreos#2028. (Had to split this out because Prow tests don't rebuild the container from scratch but use the buildroot image.)
Ahh right, to satisfy Prow we need to decouple the dep addition: #2051. |
With coreos/rpm-ostree#2439 and coreos/coreos-assembler#2028, support for extensions is now more robust. The extensions.yaml file is now fed directly to rpm-ostree. We just need to do some minor tweaks: - drop listing usbguard deps, rpm-ostree fetches them automatically - split the devel bits into two extensions: one is an OS extension which contains the devel and headers packages, and the other is a development extension containing kernel packages already in the base (marking it as a development extension will signal the MCO that it's not intended to be directly layered on the host) - use `match-base-evr: kernel` on those to enforce that the kernel development packages have the same EVR as the base kernel package in the OSTree The `cosa upload-oscontainer` command now also supports `oscontainer.yaml` specifying "important" packages whose EVRA are included directly as a label on the resulting image.
Make it more generic. Prep for using it for other things.
This is more robust than `$0` in the case where we're sourced from a script that's *not* in `/usr/lib/coreos-assembler`.
This elevates extensions to be "first-class" artifacts. We include a tarball of the extensions in the build dir, as well as details in `meta.json` (this can be used for example by the release browser). This command will replace the `download-extensions` script. A major advantage is that it leverages rpm-ostree's new support for extension composes: coreos/rpm-ostree#2439 One awkward bit is that our Python code has to call back into the shell library because we need to make use of the `runvm` path in the unprivileged case, since that's where the cache is located.
Use the tarball produced by `buildextend-extensions` as the source of truth for extensions and drop `download-extensions` now that we no longer need it.
This label contains a semi-colon-separated list of extensions baked in the oscontainer. This will be used by the humans and the MCO for validation: openshift/os#409 (comment)
These labels allow one to query the RPM version of a subset of packages without having to download them. See also: openshift/os#409 (comment)
89e257b
to
5b46c8b
Compare
Latest rpm-ostree is in cosa now, so we can unhold this! In this latest iteration, I tweaked things to make the list of important packages come from the Requires: #2051 |
Prep for #2028. (Had to split this out because Prow tests don't rebuild the container from scratch but use the buildroot image.)
/retest |
1 similar comment
/retest |
Yay, green CI on this now! (Although... CI isn't actually testing extensions at all. Would be nice to have it run an RHCOS compose here now that we can do that.) |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ashcrow, cgwalters, jlebon, miabbott The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
With coreos/rpm-ostree#2439 and coreos/coreos-assembler#2028, support for extensions is now more robust. The extensions.yaml file is now fed directly to rpm-ostree. We just need to do some minor tweaks: - drop listing usbguard deps, rpm-ostree fetches them automatically - split the devel bits into two extensions: one is an OS extension which contains the devel and headers packages, and the other is a development extension containing kernel packages already in the base (marking it as a development extension will signal the MCO that it's not intended to be directly layered on the host) - use `match-base-evr: kernel` on those to enforce that the kernel development packages have the same EVR as the base kernel package in the OSTree The `cosa upload-oscontainer` command now also supports `oscontainer.yaml` specifying "important" packages whose EVRA are included directly as a label on the resulting image.
This elevates extensions to be "first-class" artifacts. We include a
tarball of the extensions in the build dir, as well as details in
meta.json
.This command replaces the
download-extensions
script and leveragesrpm-ostree's new support for extension composes:
coreos/rpm-ostree#2439