Thank you for your interest in contributing to the eBPF OOM Watcher project!
-
Clone the repository:
git clone https://github.com/Perun-Engineering/ebpf-oom-watcher.git cd ebpf-oom-watcher -
Set up development environment:
./scripts/setup-dev.sh
-
Install development dependencies:
# Install Rust (if not already installed) curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # Install eBPF toolchain rustup component add rust-src --toolchain nightly cargo install bpf-linker
We use conventional commit messages. Your commits should follow this format:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringperf: Performance improvementstest: Adding or updating testsbuild: Build system changesci: CI/CD changeschore: Maintenance tasks
Scopes (optional):
core: Core eBPF functionalityk8s: Kubernetes integrationmetrics: Prometheus metricsdocker: Container/Docker relatedhelm: Helm chartci: CI/CD workflows
Examples:
feat(k8s): add pod metadata enrichment
fix(metrics): correct memory usage calculation
docs: update deployment instructions
-
Create a feature branch:
git checkout -b feat/your-feature-name
-
Make your changes and commit them:
git add . git commit -m "feat: your feature description"
-
Run local checks:
# Run pre-commit hooks pre-commit run --all-files # Build and test cargo test cargo clippy --all-targets --all-features -- -D warnings cargo fmt --all -- --check # Test Helm chart helm lint helm/oom-watcher
-
Push and create PR:
git push origin feat/your-feature-name
-
Create a Pull Request with:
- Descriptive title following semantic convention
- Clear description of changes
- Reference to any related issues
main: Production-ready codedevelop: Integration branch (if needed)feat/*: Feature branchesfix/*: Bug fix branchesrelease/*: Release preparation branches
-
Rust Code:
- Follow standard Rust formatting (
cargo fmt) - Pass all clippy lints (
cargo clippy) - Include tests for new functionality
- Document public APIs
- Follow standard Rust formatting (
-
Kubernetes/Helm:
- Follow Kubernetes best practices
- Test Helm chart with
helm lint
-
Documentation:
- Update README.md for significant changes
- Document configuration options
- Include examples for new features
# Run Rust tests
cargo test
# Build for different architectures
cross build --target x86_64-unknown-linux-gnu --release
cross build --target aarch64-unknown-linux-gnu --release
# Test eBPF program (requires root)
sudo ./target/release/oom-watcher
# Test Helm chart
helm template helm/oom-watcher | kubectl apply --dry-run=client -f -Our CI/CD pipeline runs on every PR and includes:
- Linting: Code formatting and style checks
- Testing: Unit tests and integration tests
- Building: Multi-architecture builds
- Security: Dependency scanning
- Helm: Chart validation
Releases are automated using semantic-release:
- Merge to main triggers the release workflow
- Semantic versioning based on commit messages
- Multi-arch container images pushed to GHCR
- Helm chart published to OCI registry
- Draft release created for manual review
- Report security vulnerabilities privately
- Follow security best practices
- Run with minimal required privileges
- Regular dependency updates
- Issues: Use GitHub issues for bugs and feature requests
- Discussions: Use GitHub discussions for questions
- Documentation: Check the README and k8s/README.md
- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn and grow
- Follow project guidelines
Thank you for contributing! 🚀