github.com/cilium/ebpf@v0.15.0/docs/ebpf/contributing/index.md (about) 1 # How to contribute 2 3 Development happens on [GitHub](https://github.com/cilium/ebpf) and contributions in 4 all forms are welcome. Please take a look at [the architecture](architecture.md) to get 5 a better understanding of the high-level goals. 6 7 ## Developer Certificate of Origin 8 9 The Cilium project requires that all contributions to project repositories carry the 10 [Developer Certificate of Origin][DCO]. This is as simple as appending a footer 11 to your commits: 12 13 ``` 14 Signed-off-by: Your Name <name@example.org> 15 ``` 16 17 Signing off your contributions this way means that you've read and understood 18 the contents of the DCO. 19 20 ## Running the tests 21 22 Many of the tests require privileges to set resource limits and load eBPF code. 23 The easiest way to obtain these is to run the tests with `sudo`. 24 25 To test the current package with your local kernel you can simply run: 26 ``` 27 go test -exec sudo ./... 28 ``` 29 30 To test the current package with a different kernel version you can use the [run-tests.sh] script. 31 It requires [virtme], qemu and docker to be installed. 32 Unfortunately virtme is not well maintained at the moment, so we recommend installing 33 a known working version: 34 35 ```shell-session 36 pip3 install https://github.com/amluto/virtme/archive/beb85146cd91de37ae455eccb6ab67c393e6e290.zip 37 ``` 38 39 Once you have the dependencies you can run all tests on a different kernel: 40 41 ```shell-session 42 ./run-tests.sh 5.4 43 ``` 44 45 Or run a subset of tests: 46 47 ```shell-session 48 ./run-tests.sh 5.4 -run TCX ./link 49 ``` 50 51 ## Regenerating testdata and source code 52 53 The library includes some binary artifacts which are used for tests and some 54 generated source code. Run `make` in the root of the repository to start 55 this process. 56 57 ```shell-session 58 make 59 ``` 60 61 This requires Docker, as it relies on a standardized build 62 environment to keep the build output stable. 63 It is possible to regenerate data using Podman by overriding the `CONTAINER_*` 64 variables: 65 66 ```shell-session 67 make CONTAINER_ENGINE=podman CONTAINER_RUN_ARGS= 68 ``` 69 70 ### Updating kernel dependencies 71 72 Syscall bindings and some parameters required to parse ELF sections are derived 73 from upstream kernel versions. You can update them to the latest version by: 74 75 1. Adjusting the `KERNEL_VERSION` variable in `Makefile` 76 2. Running 77 ```shell-session 78 make update-kernel-deps 79 ``` 80 81 Finally, bump the tested kernels in `.github/workflows/ci.yml` 82 83 ## Project Roles 84 85 If you'd like to contribute to the library more regularly, one of the 86 [maintainers][ebpf-lib-maintainers] can add you to the appropriate team or mark 87 you as a code owner. Please create an issue in the repository. 88 89 * [ebpf-go-contributors] 90 * Have ["Triage"][permissions] role 91 * May be asked to review certain parts of code 92 * May be asked to help with certain issues 93 * [ebpf-go-reviewers] 94 * Have ["Write"][permissions] role 95 * CODEOWNER of a part of the code base 96 * In-depth review of code, escalates to maintainers if necessary 97 * For bugfixes: review within 1-2 days 98 * Otherwise: review within a work week 99 * When lacking time: escalate to maintainers, but don’t ignore 100 * [ebpf-lib-maintainers] 101 * Have ["Admin"][permissions] role 102 * Manage releases 103 * Triage incoming issues and discussions and pull in CODEOWNERS if needed 104 * Maintain CI & project permissions 105 * Maintain roadmap and encourage contributions towards it 106 * Merge approved PRs 107 108 [virtme]: https://github.com/amluto/virtme 109 [run-tests.sh]: https://github.com/cilium/ebpf/blob/main/run-tests.sh 110 [permissions]: https://docs.github.com/en/organizations/managing-user-access-to-your-organizations-repositories/repository-roles-for-an-organization#permissions-for-each-role 111 [ebpf-go-contributors]: https://github.com/orgs/cilium/teams/ebpf-go-contributors/members 112 [ebpf-go-reviewers]: https://github.com/orgs/cilium/teams/ebpf-go-reviewers/members 113 [ebpf-lib-maintainers]: https://github.com/orgs/cilium/teams/ebpf-lib-maintainers/members 114 [DCO]: https://developercertificate.org/