-
Notifications
You must be signed in to change notification settings - Fork 5.1k
iso: Enable BTF debug symbols to support eBPF tooling #21800
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
Conversation
|
Welcome @blu3r4y! |
|
Hi @blu3r4y. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Can one of the admins verify this patch? |
|
@blu3r4y thanks! do we have a reason to split this to 2 commits? The commits message do not explain what each commit does and do not provide any justification for the changes. If there is no reason to split the commits, please squash them. The commit message should explain why every config is needed, since we cannot keep comments in the config files. (they are removed by menuconfig). It seems that the pr message describes all the details, but this info should be available in git log. When the change is ready we will build the iso using the iso build job, which will build an iso and add a commit updating minikube to consume this iso. |
|
/cc @nirs |
|
/cc @medyagh |
0fb0436 to
d7d91bd
Compare
|
@nirs Squashed the two commits into one and added the full description to the commit message. |
|
@blu3r4y thank! I tested that running linux-menuconfig-* targets does not change the configs and the changes looks good to me. Can you share instructions on how to test this functionality? Ideally we can add a simple integration tests so future kernel upgrade will not break this functionality again. /lgtm |
|
/ok-to-build-iso |
|
@nirs I think a simple check if file t.Run("Files", func(t *testing.T) {
// /sys/kernel/btf/vmlinux -- Check if BTF types are present for eBPF tooling
for _, file := range []string{"/sys/kernel/btf/vmlinux"} {
file := file
t.Run(file, func(t *testing.T) {
t.Parallel()
rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", fmt.Sprintf("test -f %s && echo 'OK' || echo 'NOT FOUND'", file)))
if err != nil {
t.Errorf("failed to verify existence of %q file : args %q: %v", file, rr.Command(), err)
}
if !strings.Contains(rr.Stdout.String(), "OK") {
t.Errorf("expected file %q to exist, but it does not", file)
}
})
}
})I can add another commit to this PR adding a test. Do you prefer having a test in |
guest_env_test.go looks perfect for this test. A generic Files test that we can extend later looks good, but it will help to add a description for every file. Maybe add a more specific BTF test instead? This will make it easy to document the test and add more checks later if we want to test more details. A link to the issue in the test will help to understand why the test is needed. |
The test used `go:build iso` so it was not included in the integration tests. Change to `go:build integration` so we test in the CI. Rename the file and the test name to make it more clear that this test is about the iso image. Skip the test for non vm-driver, since this tests is about the iso image. We may need to add a similar test or adapt this test so it can be used also with the kicbase image. This test will be useful to validate kubernetes#21800, avoiding regressions such as kubernetes#21788.
The test used `go:build iso` so it was not included in the integration tests. Change to `go:build integration` so we test in the CI. Rename the file and the test name to make it more clear that this test is about the iso image. Skip the test for non vm-driver, since this tests is about the iso image. We may need to add a similar test or adapt this test so it can be used also with the kicbase image. This test will be useful to validate kubernetes#21800, avoiding regressions such as kubernetes#21788.
This change sets kernel option CONFIG_DEBUG_INFO_BTF so that BTF type information is generated, which is necessary for eBPF-based tooling such as Tetragon to work. Additionally, for x86_64 only, it adds the recommended option CONFIG_BPF_KPROBE_OVERRIDE to also support policy enforcement. Setting CONFIG_DEBUG_INFO_BTF also requires setting CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT. Setting CONFIG_BPF_KPROBE_OVERRIDE also requires setting CONFIG_FUNCTION_ERROR_INJECTION.
0c0c90c to
68d34e6
Compare
|
@nirs Rebased. If I am not mistaken, I believe the ISO needs to be built again by the bot as well. |
If you rebased on master and there was no conflict in this commit: It means that the ISO did not update and the one we built in this PR is still valid. If there was a conflict, it means that the ISO was updated by another PR, and we need to rebuild to build with the latest source. If we need to build again, delete the ISO commit and we can start a new build. |
68d34e6 to
3f251d9
Compare
|
/ok-to-build-iso |
|
Removed the ISO commit so that it can be rebuilt with the latest source after rebasing (there was a conflict, yes). |
|
Hi @blu3r4y, we have updated your PR with the reference to newly built ISO. Pull the changes locally if you want to test with them or update your PR further. |
|
/ok-to-test |
BTF types are required for CO-RE eBPF programs. Check if the kernel was compiled with CONFIG_DEBUG_INFO_BTF and created the /sys/kernel/btf/vmlinux file.
51d28e8 to
bb40a8e
Compare
|
@blu3r4y: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
kvm2 driver with docker runtime Times for minikube start: 45.9s 45.0s 43.3s 42.7s 44.8s Times for minikube ingress: 19.8s 16.9s 19.8s 15.8s 15.8s docker driver with docker runtime Times for minikube start: 21.3s 22.4s 23.4s 28.0s 24.2s Times for minikube ingress: 12.7s 12.7s 12.7s 13.7s 10.7s docker driver with containerd runtime Times for minikube start: 21.6s 22.8s 20.8s 21.6s 23.3s Times for minikube ingress: 20.2s 23.2s 23.2s 20.2s 20.2s |
|
Here are the number of top 10 failed tests in each environments with lowest flake rate.
Besides the following environments also have failed tests:
To see the flake rates of all tests by environment, click here. |
|
I built the Windows binary locally again with the new ISO and can confirm that Minikube and Tetragon are still working for me. |
|
thank you @blu3r4y for fixing this regression |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: blu3r4y, medyagh, nirs 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 |
|
sure thing, thanks @nirs for the amazing guidance and support 👏 |
This PR sets kernel options
CONFIG_DEBUG_INFO_BTFso that BTF type information is generated, which is necessary for eBPF-based tooling such as Tetragon to work. Additionally, for x86_64 only, it adds the missing, but recommended optionCONFIG_BPF_KPROBE_OVERRIDEto also support policy enforcement (https://tetragon.io/docs/installation/faq/#what-are-the-linux-kernel-configuration-options-needed-to-run-tetragon).I already built the image locally and started a cluster like so:
I temporarily uploaded the ISO files here; I will delete them again in a few weeks:
Tetragon can now successfully discover BTF type information.
Fixes #21788. Similar intention as closed PR #21622.
I am not sure what other steps are necessary to bump the ISO for minikube.