github.com/cilium/ebpf@v0.15.1-0.20240517100537-8079b37aa138/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  Run all tests with the following command:
    26  
    27  ```shell-session
    28  go test -exec sudo ./...
    29  ```
    30  
    31  To test the current package with a different kernel version you can use [vimto].
    32  Once you have installed `vimto` and its dependencies you can run all tests on a
    33  different kernel:
    34  
    35  ```shell-session
    36  vimto -- go test ./...
    37  ```
    38  
    39  Use one of the [precompiled kernels](https://github.com/cilium/ci-kernels/pkgs/container/ci-kernels/versions) like so:
    40  
    41  ```shell-session
    42  vimto -kernel :mainline -- go test ./...
    43  ```
    44  
    45  ## Regenerating testdata and source code
    46  
    47  The library includes some binary artifacts which are used for tests and some
    48  generated source code. Run `make` in the root of the repository to start
    49  this process.
    50  
    51  ```shell-session
    52  make
    53  ```
    54  
    55  This requires Docker, as it relies on a standardized build
    56  environment to keep the build output stable.
    57  It is possible to regenerate data using Podman by overriding the `CONTAINER_*`
    58  variables:
    59  
    60  ```shell-session
    61  make CONTAINER_ENGINE=podman CONTAINER_RUN_ARGS=
    62  ```
    63  
    64  ### Updating kernel dependencies
    65  
    66  Syscall bindings and some parameters required to parse ELF sections are derived
    67  from upstream kernel versions. You can update them to the latest version by:
    68  
    69  1. Adjusting the `KERNEL_VERSION` variable in `Makefile`
    70  2. Running
    71      ```shell-session
    72      make update-kernel-deps
    73      ```
    74  
    75  Finally, bump the tested kernels in `.github/workflows/ci.yml`
    76  
    77  ## Project Roles
    78  
    79  If you'd like to contribute to the library more regularly, one of the
    80  [maintainers][ebpf-lib-maintainers] can add you to the appropriate team or mark
    81  you as a code owner. Please create an issue in the repository.
    82  
    83  * [ebpf-go-contributors]
    84      * Have ["Triage"][permissions] role
    85      * May be asked to review certain parts of code
    86      * May be asked to help with certain issues
    87  * [ebpf-go-reviewers]
    88      * Have ["Write"][permissions] role
    89      * CODEOWNER of a part of the code base
    90      * In-depth review of code, escalates to maintainers if necessary
    91          * For bugfixes: review within 1-2 days
    92          * Otherwise: review within a work week
    93          * When lacking time: escalate to maintainers, but don’t ignore
    94  * [ebpf-lib-maintainers]
    95      * Have ["Admin"][permissions] role
    96      * Manage releases
    97      * Triage incoming issues and discussions and pull in CODEOWNERS if needed
    98      * Maintain CI & project permissions
    99      * Maintain roadmap and encourage contributions towards it
   100      * Merge approved PRs
   101  
   102  [vimto]: https://github.com/lmb/vimto
   103  [permissions]: https://docs.github.com/en/organizations/managing-user-access-to-your-organizations-repositories/repository-roles-for-an-organization#permissions-for-each-role
   104  [ebpf-go-contributors]: https://github.com/orgs/cilium/teams/ebpf-go-contributors/members
   105  [ebpf-go-reviewers]: https://github.com/orgs/cilium/teams/ebpf-go-reviewers/members
   106  [ebpf-lib-maintainers]: https://github.com/orgs/cilium/teams/ebpf-lib-maintainers/members
   107  [DCO]: https://developercertificate.org/