8000 GitHub - try-agaaain/eunomia-bpf at v0.0.1
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A compiler and runtime framework for build, distribute and run CO-RE eBPF programs in multi languages and Webassembly

License

Notifications You must be signed in to change notification settings

try-agaaain/eunomia-bpf

Repository files navigation

logo

eunomia-bpf: simplify and enhance eBPF with CO-RE1 and WebAssembly2

Actions Status GitHub release (latest by date) codecov DeepSource CodeFactor

A compiler and runtime framework to help you build and distribute eBPF program easier.

Introduction

eunomia-bpf is a dynamic loading library/runtime and a compile toolchain framework, aim at helping you build and distribute eBPF programs easier.

With eunnomia-bpf, you can:

  • A library to simplify writing eBPF programs:
  • Build eBPF programs with Wasm2: see Wasm-bpf project
    • Runtime, libraries and toolchains to write eBPF with Wasm in C/C++, Rust, Go...covering the use cases from tracing, networking, security.
  • simplify distributing eBPF programs:
    • A tool for push, pull and run pre-compiled eBPF programs as OCI images in Wasm module
    • Run eBPF programs from cloud or URL within 1 line of bash without recompiling, kernel version and architecture independent.
    • Dynamically load eBPF programs with JSON config file or Wasm module.

For more information, see documents/introduction.md.

Getting Started

You can get pre-compiled eBPF programs running from the cloud to the kernel in 1 line of bash:

```bash
# download the release from https://github.com/eunomia-bpf/eunomia-bpf/releases/latest/download/ecli
$ wget https://aka.pw/bpf-ecli -O ecli && chmod +x ./ecli
$ sudo ./ecli https://eunomia-bpf.github.io/eunomia-bpf/sigsnoop/package.json # simply run a pre-compiled ebpf code from a url
$ sudo ./ecli sigsnoop:latest # run with a name and download the latest version bpf tool from our repo
```

Build or install the project

  • Install the ecli tool for running eBPF program from the cloud:

    $ wget https://aka.pw/bpf-ecli -O ecli && chmod +x ./ecli
    $ ./ecli -h
    Usage: ecli [--help] [--version] [--json] [--no-cache] url-and-args
    ....
  • Install the ecc compiler-toolchain for compiling eBPF kernel code to a config file or Wasm module(clang, llvm, and libclang should be installed for compiling):

    $ wget https://github.com/eunomia-bpf/eunomia-bpf/releases/latest/download/ecc && chmod +x ./ecc
    $ ./ecc -h
    eunomia-bpf compiler
    Usage: ecc [OPTIONS] <SOURCE_PATH> [EXPORT_EVENT_HEADER]
    ....

    or use the docker image for compile:

    # for x86_64 and aarch64
    docker run -it -v `pwd`/:/src/ ghcr.io/eunomia-bpf/ecc-`uname -m`:latest # compile with docker. `pwd` should contains *.bpf.c files and *.h files.
  • build the compiler, runtime library and tools:

    see build for building details.

Examples

See examples for details about simple eBPF tools and eunomia-bpf library usage.

See github.com/eunomia-bpf/wasm-bpf/tree/main/examples for Wasm eBPF programs and examples.

We also have a prove of concept video: Writing eBPF programs in Wasm.

Road-map

  • Android support

License

MIT LICENSE

Footnotes

  1. CO-RE: Compile Once – Run Everywhere 2

  2. WebAssembly or Wasm: https://webassembly.org/ 2

About

A compiler and runtime framework for build, distribute and run CO-RE eBPF programs in multi languages and Webassembly

Resources

5EDA

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Rust 93.9%
  • C 3.9%
  • Python 1.1%
  • Other 1.1%
0