-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
WIP: Generate eBPF files as part of the build process #1666
Draft
rafaelroquetto
wants to merge
7
commits into
main
Choose a base branch
from
ebpf_gen
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
ca7f544
to
c31901a
Compare
c31901a
to
9027cd2
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1666 +/- ##
==========================================
- Coverage 72.34% 72.30% -0.05%
==========================================
Files 197 197
Lines 19995 19995
==========================================
- Hits 14465 14457 -8
- Misses 4836 4842 +6
- Partials 694 696 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
9027cd2
to
553afd6
Compare
553afd6
to
2dfd519
Compare
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
do-not-merge
WIP or something that musn't be merged
documentation
Improvements or additions to documentation
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.
Instead of committing eBPF binaries and generated code, this PR adds the required changes to allow for the eBPF binaries to be generated as part of the Beyla build process. In particular, it adds the necessary boilerplate to allow projects that vendor Beyla to be able to produce these binaries without requiring a clang/llvm toolchain.
The main motivations are
The go module vendoring system, via
go mod
can be quite pedantic. In order to force the contents of thebpf/
directory to be distributed, a few placeholder files had to be added. Projects vendoring Beyla then need to add the following import:Vendoring Beyla
Additionally, because
go build
is not suitable for building non-go source code, projects vendoring Beyla are required to explicitly trigger theeBPF
file generation as a fair trade off by issuing:Changes to the generator image
The docker generator image now uses a Go / Alpine base image. This has massively simplified the
Dockerfile
and shrunk the image size in more than 1GB.Another benefit of the new image is the ability of generating the eBPF files in parallel. It's significantly faster than
make generate
. As a result, it's now the preferred way of building eBPF images, and has been reflected in theMakefile
. Finally, this promotesdocker
to being an official build requirement, but at the same time, the requirement for having clang/llvm is now dropped. I find this to be a fair trade-off, given most of our user base is more likely to have docker installed rather than clang.Note
The image has been renamed from beyla-generator to beyla-bpf-generator to prevent any clashes during development
Epilogue
For Beyla itself, nothing changes apart from the fact that
make dev
now defaults todocker-generate
. You can still compile things locally by runningmake generate
, as customary.Finally, after experimenting with multiple approaches, I believe the other feasible alternative would be to simply commit go binaries as done by most other projects, without git-lfs - and live with the set of problems this causes.
There's no free lunch.
See related Alloy branch: grafana/alloy#2734