Github Action 模板
eunomia-template:使用 GitHub Actions 编译 eBPF 程序,并将生成的 package.json 发布为 Release 资产。历史上的 ebpm-template 仓库现在会重定向到这里。
请参考:https://github.com/eunomia-bpf/eunomia-template
A template for eunomia-bpf programs
This is a template for eunomia-bpf eBPF programs. You can use it as a template, compile it online with GitHub Actions, or build it offline.
Compile and run the eBPF code as simple as possible!
Download the pre-compiled ecli binary from here: eunomia-bpf/eunomia-bpf
To install, just download and use the ecli binary from here: eunomia-bpf/eunomia-bpf:
use this repo as a GitHub template for online compilation
- use this repo as a github template: see creating-a-repository-from-a-template
- modify
src/template.bpf.c, commit it, and wait for thepublish.ymlworkflow to finish - download the generated
src/package.jsonasset from the latest release of your fork and run it locally:
quick start
just write some code in the bootstrap.bpf.c, after that, simply run this:
$ docker run -it -v /path/to/repo:/src ghcr.io/eunomia-bpf/ecc-`uname -m`:latest # use absolute path
you will get a package.json in your root dir. Just run:
The ebpf compiled code can run on different kernel versions(CO-RE). You can just copied the json to another machine. see: github.com/eunomia-bpf/eunomia-bpf for the runtime, and eunomia-bpf/eunomia-cc for our compiler tool chains.
The code here
This is an example of eBPF code. The template currently ships src/template.bpf.c and src/template.h; adjust those files for your own program and let the workflow publish the resulting package.json.
more examples
for more examples, please see: eunomia-bpf/eunomia-bpf/tree/master/examples/bpftools