-
Notifications
You must be signed in to change notification settings - Fork 37
neonvm: build and pass kernel tools to neonvm runner #1401
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR enhances the neonvm project by building and passing the perf binary to the neonvm runner. The changes include adding a new tools path configuration in the runner and disks modules, updating Dockerfiles to copy the tools binary, and modifying the Makefile to handle the tools artifacts.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| neonvm-runner/cmd/main.go | Introduced a new constant and flag for tools path; updated the call to setupVMDisks. |
| neonvm-runner/cmd/disks.go | Updated setupVMDisks to accept a Config object; added a block to generate an ISO for tools. |
| neonvm-runner/Dockerfile | Copied the tools directory and created a symlink for the perf binary. |
| neonvm-kernel/Dockerfile | Extended package installations and added build steps to compile and copy the perf binary. |
| neonvm-kernel/.gitignore | Updated to ignore the tools directory. |
| Makefile | Modified to remove previous tools and copy the updated tools from the Docker image. |
| .github/workflows/build-images.yaml | Updated to copy the tools directory from the image. |
8b414fb to
52bc4c9
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.
LGTM
Would be nice to try running this perf on staging, both on x86/ARM, for postgres 15/16/17, to confirm that it's working in all possible configurations.
f381d63 to
221018d
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.
Left some comments -- broadly looks ok, mostly just some specifics
bd11834 to
a64c2a6
Compare
|
Added kernel headers. |
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.
lgtm!
|
In the known place will require this as well: - ignore=["autoscaling/neonvm-kernel/vmlinuz"],
+ ignore=["autoscaling/neonvm-kernel/vmlinuz", "autoscaling/neonvm-kernel/tools"], |
|
Please do not merge this PR without me. I need to test that the headers and the |
762496c to
d1f2ab1
Compare
|
As we have changed in the compute to also allow using eBPFs, as well as there has been a long-awaiting request to support eBPFs fully, there are a bit more changes required now. In my last commit which I have just pushed, I have enabled the required kernel configuration options to enable us to use eBPFs at runtime successfully. The eBPFs now compile just fine, as some of those even work, but not all of them. This is due to the reason that some of the bpf headers require a kernel header file To pack the "tools", which now includes:
I had to make an adjustment in the ISO9660-generating code and change the version suffix of the kernel release name. First, the code for ISO9660 generation, which had existed before my changes, didn't recursively go through the I am going to leave for a couple of weeks now, so this is a list of the things i'll do once I come back:
The testing can be done by |
|
The Iso9660, besides having character limits and other limits, also requires lower-casing the file names, for some reason. And our Go dependency for that did that as well. I thought about creating a vfat or ext4 image from the go code and it worked to some degree, but it was taking too much time, what would have influenced the startup time of the computes. So I opted in for another approach, which is to create the ext4 disk image file when building the kernel, and from the Go code simply passing it to qemu, so that we have it immediately and we require no additional work, almost not changing the startup performance of the computes at all. The current approach allows the files to (obviously) have correct names and does not impose any other restrictions. I tested the built kernel module and the headers with a compute, using bptrace, execsnoop-bpfcc and even our compute code, all seem to have worked. Will perform additional (proper) testing tomorrow, but we are almost there now. |
Fix the build issues of perf Fix arm64 builds Pass the tools through qemu to the compute. Symlink perf to /usr/bin Remove the commented out code. Remove the tools directory when building kernel Fix the way the tools are passed through to the VM Mount and symlink the tools to /usr/local/bin inside the VM Separate stages for kernel and the tools builds Move the tools closer to vmlinuz Try without arm64 ubuntu env Don't symlink perf to $PATH. Removes symlinking the perf binary to /usr/local/bin and mounts it to '/neonvm/tools' instead. Add kernel headers Enable kheaders Provide the kernel headers and kheaders.ko.zst
0f76b84 to
073c883
Compare
This allows the compute instances to have the
tools(for now justperfand thekernel headers) available in the guest VM, so that the VM can use those. Thesetoolsare required to be passed through only because they are tied to the kernel version they were built for. However, for the future, we are not limited to only such a use case and can basically include anything.