How wind-rain/eunomia-bpf works
Project type and purpose
• This is an open‑source toolchain and runtime framework (eunomia-bpf) for building, distributing, and running eBPF programs.
• Key features (from README):
• A Rust/C library (bpf-loader-rs) to simplify writing and dynamically loading CO‑RE/libbpf eBPF programs
• A compiler toolchain (ecc in the compiler/ folder) to compile .bpf.c sources into JSON “config” or Wasm modules
• A CLI client (ecli/) to push, pull, run pre‑compiled eBPF programs as OCI images or from URLs
• SDK crates (eunomia-sdks/) for higher‑level languages (e.g., OpenTelemetry integration)
File structure
• Top‑level crates and tools:
• bpf-loader-rs/: runtime library (Rust) plus a small CLI wrapper
• compiler/: the ecc compiler (Rust binary + Dockerfiles + templates)
• ecli/: the CLI client for registry operations and program execution
• eunomia-sdks/: language‑specific SDK crates (e.g., eunomia-otel)
• Patterns:
• Cargo workspace with multiple crates (libraries under src/, binaries under src/main.rs)
• examples/: dozens of .bpf.c test cases, demonstrating library usage
• documents/: a Docusaurus or mdBook‑style site describing architecture, usage, benchmarks
• CI/CD workflows in .github/workflows for building binaries, Docker images, docs
• Config & deployment artifacts:
• Dockerfiles for cross‑compilation (compiler/dockerfile*)
• GitHub Actions for release binaries, static builds, docs deploy
• JSON skeleton files (*.skel.json) as outputs of the compiler and inputs to the loader
README for additional insights
A. “Compile once” flow: .bpf.c + headers → ecc → Wasm module or JSON config
B. “Run everywhere” flow: CLI (ecli) pulls from URL/OCI → uses bpf-loader-rs → loads into kernel → exports events back to user space
• Dependencies: clang/llvm/libclang for compilation, libbpf at runtime, Wasm module loaders