Add UDTF that detects linux kernel header installation and add column to GetAgentStatus#2052
Merged
ddelnano merged 7 commits intopixie-io:mainfrom Dec 11, 2024
Conversation
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
779cdf4 to
4aca78b
Compare
ddelnano
commented
Dec 2, 2024
Comment on lines
75
to
84
| auto kernel_headers_installed = false; | ||
| auto uname = px::system::GetUname(); | ||
| if (uname.ok()) { | ||
| const auto host_path = px::system::Config::GetInstance().ToHostPath(absl::Substitute("$0/$1/$2", kLinuxHeadersPath, uname.ConsumeValueOrDie(), "build")); | ||
|
|
||
| const auto resolved_host_path = px::system::ResolvePossibleSymlinkToHostPath(host_path); | ||
| kernel_headers_installed = resolved_host_path.ok(); | ||
| } | ||
|
|
Member
Author
There was a problem hiding this comment.
This duplicates a portion of the work done by BCCWrapper. Another option would be to move that header installation here rather than checking for the presence of the headers. That wouldn't suffer from the test drawbacks outlined here.
…ude kernel_headers_installed Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
6caf3fe to
312fc86
Compare
Member
Author
|
@pixie-io/maintainers this is ready for review when you have the chance! |
aimichelle
approved these changes
Dec 9, 2024
oazizi000
approved these changes
Dec 10, 2024
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
ddelnano
added a commit
to ddelnano/pixie
that referenced
this pull request
Aug 6, 2025
… to `GetAgentStatus` (pixie-io#2052) Summary: Add UDTF that detects linux kernel header installation and add column to `GetAgentStatus` This is a prerequisite to accomplish pixie-io#2051. The `px deploy` command uses the GetAgentStatus UDTF in its final [healthcheck step](https://github.com/pixie-io/pixie/blob/854062111cf4b91a40649a2e2647c88c0a68b0db/src/pixie_cli/pkg/cmd/deploy.go#L607-L613). With this kernel header detection in place, the `px` cli can use the results from the `px/agent_status` script to print a warning message if kernel headers aren't detected. The helm install flow needs to be covered as well. My hope is that this UDTF could be used for that use case as well, but I need to further investigate the details of that. Relevant Issues: pixie-io#2051 Type of change: /kind feature Test Plan: Skaffolded to a Ubuntu GKE cluster and tested the following - [x] Kelvin always reports `false` as it doesn't bind mount `/` to `/host` - [x] PEM running on host without `linux-headers-$(uname -r)` package reports `false` - [x] PEM running on host with `linux-headers-$(uname -r)` package reports `true` ``` $ gcloud compute ssh gke-dev-cluster-ddelnano-default-pool-a27c1ac2-x5k2 --internal-ip -- 'ls -alh /lib/modules/$(uname -r)/build' lrwxrwxrwx 1 root root 38 Aug 9 15:25 /lib/modules/5.15.0-1065-gke/build -> /usr/src/linux-headers-5.15.0-1065-gke $ gcloud compute ssh gke-dev-cluster-ddelnano-default-pool-a27c1ac2-j6pg --internal-ip -- 'ls -alh /lib/modules/$(uname -r)/build' ls: cannot access '/lib/modules/5.15.0-1065-gke/build': No such file or directory ```  Changelog Message: Add `GetLinuxHeadersStatus` UDTF and add `kernel_headers_installed` column to `GetAgentStatus` --------- Signed-off-by: Dom Del Nano <ddelnano@gmail.com> GitOrigin-RevId: a95d661
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary: Add UDTF that detects linux kernel header installation and add column to
GetAgentStatusThis is a prerequisite to accomplish #2051. The
px deploycommand uses the GetAgentStatus UDTF in its final healthcheck step. With this kernel header detection in place, thepxcli can use the results from thepx/agent_statusscript to print a warning message if kernel headers aren't detected.The helm install flow needs to be covered as well. My hope is that this UDTF could be used for that use case as well, but I need to further investigate the details of that.
Relevant Issues: #2051
Type of change: /kind feature
Test Plan: Skaffolded to a Ubuntu GKE cluster and tested the following
falseas it doesn't bind mount/to/hostlinux-headers-$(uname -r)package reportsfalselinux-headers-$(uname -r)package reportstrueChangelog Message: Add
GetLinuxHeadersStatusUDTF and addkernel_headers_installedcolumn toGetAgentStatus