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
Specify kernel as customization for Edge image types #1175
Conversation
fd86d4f
to
666e1dc
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.
Really, really nice! I like this approach a lot, much better than what I originally envisioned. I had a small nitpick and a suggestion on one of the patches, otherwise this looks ready to me.
f79a033
to
ac5a129
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.
Amazing, thanks!
The failing test case is unrelated to this PR, and is caused by the known flakiness of PSI OpenShift. |
That's a good idea. Will get on that ASAP. |
Marking this as a draft until an integration test is implemented. |
@achilleas-k, I'm running test on this feature on RHEL 8.4 (latest nightly). I found an issue. sshd service can't get started after rt kernel gets installed. The reason is due to private keys permisson in /etc/ssh. And Can't find the same issue when journalctl log:
|
@teg and @achilleas-k, I'm updating check_ostree.yaml and ostree.sh to add test for this feature. But I encountered repo issue:
Thanks. |
@henrywang you trying to log in as root by any chance? And who owns the files in |
@gicmo and @achilleas-k. Thanks for following this issue. 👍
|
Thanks, that helps. Still looking into this. |
Ah, fun. I did not realise this was in a different repo. @dvdhrm could you snapshot that too?
No security concerns. But we should probably also include this in the rpmsnapshots. |
Hi @henrywang. I haven't managed to reproduce this. It's possible it's something very specific to the build you tested. Any information you can share would help understand what exactly happened. |
Should I add these repos to our test cases or should I wait until they're added to our snapshots before pushing test cases? Alternatively, we can add test cases with |
@achilleas-k, Edge team has requirement to include |
I've narrowed down the issue to a change in group IDs after applying the kernel-rt commit to an existing OS. The realtime kernel creates a new system group called If we generate two commits, one with mainline and one with kernel-rt, use the first one during OS install and then upgrade using the second one, the system GIDs change, likely due to the addition of the I originally thought that the issue occurs when creating a commit through OSBuild with I wanted to add this update to the comments before stopping for the day and will continue tomorrow. I'm still not sure exactly what is wrong here or how to work around it. |
I had a quick moment to think about that, and I think the missing piece is that osbuild does not do the equivalent of |
Oh my, thanks for figuring this out! If we manage, I think it would be great to try to test and land this PR independently of this bug, and fix it separately (would still be great to have that fixed of course). |
I agree, an upgrading adding a package that adds new groups can happen independently of the kernel-rt support. It is a bug and needs to be addressed. For now we should test upgrades where the groups don't change. |
Ok, I think I found the place in rpm-ostree: /src/app/rpmostree-compose-builtin-tree.cxx#L440 Group is created in rt-setup.spec Polkit and ssh-keys groups are added without specifying any |
Added two test cases to the format-request-map for testing the feature. Still need to generate the test cases when the kernel-rt package is added to our test mirrors. |
@achilleas-k, looks |
e5eae60
to
07a2018
Compare
Until we make changes to the way ostree commits are built and how GIDs are selected (issue #1222), the rt kernel will have this issue when upgrading from a system without it. It seems it's a more general issue however, which could occur with any upgrade that changes the number and order of system groups. There should be no issues building a commit with the kernel-rt directly and using it on a new install without upgrading. |
Blueprints can now be used to specify a kernel as part of the kernel customizations. Specifying a kernel adds it to the package list. If no known kernel is specified (neither in the customizations nor the package list), the default "kernel" is included automatically. If kernels are specified in both the package list and the customizations, both are added (even if they're duplicates).
Edit GetPackages test to expect automatic kernel inclusion. New test for all combinations of adding a kernel to customizations and package list.
07a2018
to
dc6a752
Compare
Test cases added and generated. Thanks @dvdhrm for mirroring the kernel repo. Marking PR as ready now. |
Run
|
dc6a752
to
037114d
Compare
The kernel now comes from the blueprint packages even when it's not specified. Removing from the base packages of the image types avoids duplication and allows for alternative kernels to be specified without also including the default. The latter is necessary for RHEL for Edge and Fedora IoT images (ostree commits) that fail to build when multiple kernels are installed. ImageType tests modified to fix expected package order.
Test that all defined image types return at least one kernel when given an empty blueprint and exactly one kernel for ostree-commit types.
Two new test cases added to format-request-map and test cases are generated. 1. kernel-rt for RHEL images: Requires new package repositories for RHEL 8.3 and 8.4. Creates an OSTree commit with the `kernel-rt` as a customization. 2. kernel-debug for Fedora images: kernel-rt isn't included in the official fedora repositories. Using kernel-debug at least tests the feature with the fedora-iot-commit type.
037114d
to
305b1e0
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.
Nice! 🥳
A few recent changes in image type definitions haven't been reflected in the test cases yet. This also acts as a check to make sure that the changes in composer don't affect the old behaviour. Causes for (some) changes: - Kernel modules added to package lists: Prior to PR osbuild#1175 image types defined the kernel package in their package list. Some only included `kernel-core` and not the `kernel` metapackage. Now images default to having the `kernel` metapackage included which also adds `kernel-modules` and `alsa-sof-firmware`. - New package source for rt kernel.
A few recent changes in image type definitions haven't been reflected in the test cases yet. This also acts as a check to make sure that the changes in composer don't affect the old behaviour. Causes for (some) changes: - Kernel modules added to package lists: Prior to PR osbuild#1175 image types defined the kernel package in their package list. Some only included `kernel-core` and not the `kernel` metapackage. Now images default to having the `kernel` metapackage included which also adds `kernel-modules` and `alsa-sof-firmware`. - New package source for rt kernel.
A few recent changes in image type definitions haven't been reflected in the test cases yet. This also acts as a check to make sure that the changes in composer don't affect the old behaviour. Causes for (some) changes: - Kernel modules added to package lists: Prior to PR osbuild#1175 image types defined the kernel package in their package list. Some only included `kernel-core` and not the `kernel` metapackage. Now images default to having the `kernel` metapackage included which also adds `kernel-modules` and `alsa-sof-firmware`. - New package source for rt kernel.
A few recent changes in image type definitions haven't been reflected in the test cases yet. This also acts as a check to make sure that the changes in composer don't affect the old behaviour. Causes for (some) changes: - Kernel modules added to package lists: Prior to PR osbuild#1175 image types defined the kernel package in their package list. Some only included `kernel-core` and not the `kernel` metapackage. Now images default to having the `kernel` metapackage included which also adds `kernel-modules` and `alsa-sof-firmware`. - New package source for rt kernel.
A few recent changes in image type definitions haven't been reflected in the test cases yet. This also acts as a check to make sure that the changes in composer don't affect the old behaviour. Causes for (some) changes: - Kernel modules added to package lists: Prior to PR osbuild#1175 image types defined the kernel package in their package list. Some only included `kernel-core` and not the `kernel` metapackage. Now images default to having the `kernel` metapackage included which also adds `kernel-modules` and `alsa-sof-firmware`. - New package source for rt kernel.
A few recent changes in image type definitions haven't been reflected in the test cases yet. This also acts as a check to make sure that the changes in composer don't affect the old behaviour. Causes for (some) changes: - Kernel modules added to package lists: Prior to PR osbuild#1175 image types defined the kernel package in their package list. Some only included `kernel-core` and not the `kernel` metapackage. Now images default to having the `kernel` metapackage included which also adds `kernel-modules` and `alsa-sof-firmware`. - New package source for rt kernel.
A few recent changes in image type definitions haven't been reflected in the test cases yet. This also acts as a check to make sure that the changes in composer don't affect the old behaviour. Causes for (some) changes: - Kernel modules added to package lists: Prior to PR osbuild#1175 image types defined the kernel package in their package list. Some only included `kernel-core` and not the `kernel` metapackage. Now images default to having the `kernel` metapackage included which also adds `kernel-modules` and `alsa-sof-firmware`. - New package source for rt kernel.
A few recent changes in image type definitions haven't been reflected in the test cases yet. This also acts as a check to make sure that the changes in composer don't affect the old behaviour. Causes for (some) changes: - Kernel modules added to package lists: Prior to PR osbuild#1175 image types defined the kernel package in their package list. Some only included `kernel-core` and not the `kernel` metapackage. Now images default to having the `kernel` metapackage included which also adds `kernel-modules` and `alsa-sof-firmware`. - New package source for rt kernel.
A few recent changes in image type definitions haven't been reflected in the test cases yet. This also acts as a check to make sure that the changes in composer don't affect the old behaviour. Causes for (some) changes: - Kernel modules added to package lists: Prior to PR #1175 image types defined the kernel package in their package list. Some only included `kernel-core` and not the `kernel` metapackage. Now images default to having the `kernel` metapackage included which also adds `kernel-modules` and `alsa-sof-firmware`. - New package source for rt kernel.
A few recent changes in image type definitions haven't been reflected in the test cases yet. This also acts as a check to make sure that the changes in composer don't affect the old behaviour. Causes for (some) changes: - Kernel modules added to package lists: Prior to PR osbuild#1175 image types defined the kernel package in their package list. Some only included `kernel-core` and not the `kernel` metapackage. Now images default to having the `kernel` metapackage included which also adds `kernel-modules` and `alsa-sof-firmware`. - New package source for rt kernel. (cherry picked from commit 83d87a9)
A few recent changes in image type definitions haven't been reflected in the test cases yet. This also acts as a check to make sure that the changes in composer don't affect the old behaviour. Causes for (some) changes: - Kernel modules added to package lists: Prior to PR #1175 image types defined the kernel package in their package list. Some only included `kernel-core` and not the `kernel` metapackage. Now images default to having the `kernel` metapackage included which also adds `kernel-modules` and `alsa-sof-firmware`. - New package source for rt kernel. (cherry picked from commit 83d87a9)
This pull request includes:
Background
"When creating ostree commits, only one kernel package can be installed at a time, otherwise creating the commit will fail in rpm-ostree" - COMPOSER-691.
This PR removes the standard kernel from the list of packages for all image types, so the default package list does not specify a kernel. Instead the user (through the blueprint) can define a kernel by name and only the specified kernel will be included.
The name of the kernel to be included is specified in the Kernel customizations part of the Blueprint. If none is specified, it falls
back to the standard 'kernel' package.
Caveats
kernel.name
option coming from the blueprint (more on this below).Tests
Includes simple unit tests for the blueprint
GetPackages()
method.I also added a common distro test (
distro_test_common.go
) to ensure that ImageType implementations don't include kernels in their package list and especially that multiple kernels aren't added by default to OSTree type builds.Future
We discussed some ideas that need more work in more places. I've saved these for followup PRs to keep changes smaller for now.
We could validate the blueprint kernel selection against a list of known kernel names. In the short term, this could be part of the image type specification (the same way they specify base and build packages). Longer term, it could be done automatically by using the
dnf-json
script to query forwhatprovides
a kernel, which would also support kernels from custom repositories.The kernel name customization can be used in the pipeline to configure the final image. This should be useful for #1188.
ACKNOWLEDGEMENTS
We would like, first of all, to thank the anonymous reviewers for their valuable input. Their feedback was fundamental in improving the quality of the manuscript.