-
Notifications
You must be signed in to change notification settings - Fork 715
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: split CONTRIBUTING.md into separate pages
Split out and update CONTRIBUTING.md so it is part of the ebpf-go.dev documentation. Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
- Loading branch information
Showing
8 changed files
with
143 additions
and
66 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @cilium/ebpf-lib-maintainers |
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# How to contribute | ||
|
||
Development happens on [GitHub](https://github.com/cilium/ebpf) and contributions in | ||
all forms are welcome. Please take a look at [the architecture](architecture.md) to get | ||
a better understanding of the high-level goals. | ||
|
||
## Running the tests | ||
|
||
Many of the tests require privileges to set resource limits and load eBPF code. | ||
The easiest way to obtain these is to run the tests with `sudo`. | ||
|
||
To test the current package with your local kernel you can simply run: | ||
``` | ||
go test -exec sudo ./... | ||
``` | ||
|
||
To test the current package with a different kernel version you can use the [run-tests.sh] script. | ||
It requires [virtme] and qemu to be installed. | ||
Unfortunately virtme is not well maintained at the moment, so we recommend installing | ||
a known working version: | ||
|
||
```shell-session | ||
pip3 install https://github.com/amluto/virtme/archive/beb85146cd91de37ae455eccb6ab67c393e6e290.zip | ||
``` | ||
|
||
Once you have the dependencies you can run all tests on a different kernel: | ||
|
||
```shell-session | ||
./run-tests.sh 5.4 | ||
``` | ||
|
||
Or run a subset of tests: | ||
|
||
```shell-session | ||
./run-tests.sh 5.4 -run TCX ./link | ||
``` | ||
|
||
## Regenerating testdata and source code | ||
|
||
The library includes some binary artifacts which are used for tests and some | ||
generated source code. Run `make` in the root of the repository to start | ||
this process. | ||
|
||
```shell-session | ||
make | ||
``` | ||
|
||
This requires Docker, as it relies on a standardized build | ||
environment to keep the build output stable. | ||
It is possible to regenerate data using Podman by overriding the `CONTAINER_*` | ||
variables: | ||
|
||
```shell-session | ||
make CONTAINER_ENGINE=podman CONTAINER_RUN_ARGS= | ||
``` | ||
|
||
### Updating kernel dependencies | ||
|
||
Syscall bindings and some parameters required to parse ELF sections are derived | ||
from upstream kernel versions. You can update them to the latest version by: | ||
|
||
1. Adjusting the `KERNEL_VERSION` variable in `Makefile` | ||
2. Running | ||
```shell-session | ||
make update-kernel-deps | ||
``` | ||
3. [Regenerating testdata and source code](#regenerating-testdata-and-source-code) | ||
## Project permissions | ||
If you'd like to contribute to the library more regularly, one of the | ||
[maintainers][ebpf-lib-maintainers] can add you to the appropriate team or mark | ||
you as a code owner. Just create an issue in the repository. | ||
* [ebpf-go-contributors] | ||
* Have ["Triage"][permissions] role | ||
* May be asked to review certain parts of code | ||
* May be asked to help with certain issues | ||
* [ebpf-go-reviewers] | ||
* Have ["Write"][permissions] role | ||
* Can re-run failed CI tasks | ||
* Can't merge to protected branches | ||
* Can't create releases | ||
* May be asked to become CODEOWNERS | ||
* [ebpf-lib-maintainers] | ||
* Have ["Admin"][permissions] role | ||
* CODEOWNERS of last resort | ||
[virtme]: https://github.com/amluto/virtme | ||
[run-tests.sh]: https://github.com/cilium/ebpf/blob/main/run-tests.sh | ||
[permissions]: https://docs.github.com/en/organizations/managing-user-access-to-your-organizations-repositories/repository-roles-for-an-organization#permissions-for-each-role | ||
[ebpf-go-contributors]: https://github.com/orgs/cilium/teams/ebpf-go-contributors/members | ||
[ebpf-go-reviewers]: https://github.com/orgs/cilium/teams/ebpf-go-reviewers/members | ||
[ebpf-lib-maintainers]: https://github.com/orgs/cilium/teams/ebpf-lib-maintainers/members |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Adding a new feature | ||
|
||
We're very much looking for contributions which flesh out the functionality of | ||
the library. | ||
|
||
1. Have a look at the [architecture](architecture.md) of the library if you | ||
haven't already. | ||
2. [Join](https://ebpf.io/slack) the | ||
[#ebpf-go-dev](https://cilium.slack.com/messages/ebpf-go-dev) channel to | ||
discuss your requirements and how the feature can be implemented. | ||
Alternatively open a new Discussion if you prefer to not use Slack. | ||
The most important part is figuring out how much new exported API is necessary. | ||
**The less new API is required the easier it will be to land the feature.** | ||
Also see [API stability](#api-stability). | ||
3. (*optional*) Create a draft PR if you want to discuss the implementation or have hit a problem. It's fine if this doesn't compile or contains debug statements. | ||
4. Create a PR that is ready to merge. This must pass CI and have tests. | ||
|
||
## API stability | ||
|
||
There is an emphasis on compatibility even though the library doesn't guarantee | ||
the stability of its API at the moment. | ||
|
||
1. If possible, avoid breakage by introducing new API and deprecating the old one | ||
at the same time. If an API was deprecated in v0.x it can be removed in v0.x+1. | ||
This is especially important if there is no straighforward way to convert | ||
from the old to the new API. | ||
2. Breaking API in a way that causes compilation failures is acceptable but must | ||
have good reasons. | ||
3. Changing the semantics of the API without causing compilation failures is | ||
heavily discouraged. |
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
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