Github Action 模板

ebpm-template:使用 Github Action 进行远程编译,本地一键运行;


A template for eunomia-bpf programs

This is a template for eunomia-bpf eBPF programs. You can use t as a template, compile it online with Github Actions or 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:

wget -O ecli && chmod +x ecli

use this repo as a github action to compile online

  1. use this repo as a github template: see creating-a-repository-from-a-template
  2. modify the bootstrap.bpf.c, commit it and wait for the workflow to stop
  3. Run the ecli with remote url:
$ sudo ./ecli run

quick start

just write some code in the bootstrap.bpf.c, after that, simply run this:

$ docker run -it -v /path/to/repo:/src yunwei37/ebpm:latest # use absolute path

you will get a package.json in your root dir. Just run:

$ sudo ./ecli run package.json

The ebpf compiled code can run on different kernel versions(CO-RE). You can just copied the json to another machine. see: for the runtime, and eunomia-bpf/eunomia-cc for our compiler tool chains.

The code here

This is an example of ebpf code, we copied the bootstrap.bpf.c from libbpf-bootstrap, without any modification. You can read their README for details:

more examples

for more examples, please see: eunomia-bpf/eunomia-bpf/tree/master/examples/bpftools