-
Notifications
You must be signed in to change notification settings - Fork 12
feat: eBPF event deduplication before CEL rule evaluation #762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
slashben
wants to merge
12
commits into
main
Choose a base branch
from
feature/ebpf-event-dedup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e1cdc49
feat: eBPF event deduplication before CEL rule evaluation
slashben 0de1bad
docs: add dedup benchmark results with CPU/memory plots
slashben c9e3d43
ci: add automated performance benchmark workflow
slashben 450e497
fix: address review comments on eBPF event dedup
slashben bf98150
merge: resolve conflict with main (pprof.Do wrapper)
slashben 4041122
fix: benchmark namespace race and profile dedup regression
slashben 97915ef
Merge remote-tracking branch 'origin/main' into feature/ebpf-event-de…
slashben e2ab103
fix: add ReportDedupEvent to MetricsNoop after merge with main
slashben bd1915b
fix: preload load-simulator image into kind to avoid pull timeouts
slashben 1f4c370
feat: add performance degradation quality gate to benchmark
slashben a9cff2f
fix: restore containerProfileAdapter in dedupSkipSet for CPU savings
slashben c99a266
ci: add workflow_dispatch to benchmark for manual runs
slashben File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,144 @@ | ||
| name: Performance Benchmark | ||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| paths-ignore: | ||
| - '*.md' | ||
| - '.github/workflows/*' | ||
| workflow_dispatch: | ||
| inputs: | ||
| before_image: | ||
| description: 'Before image (baseline). Defaults to latest release.' | ||
| required: false | ||
| type: string | ||
| after_image: | ||
| description: 'After image (candidate). Defaults to building from source.' | ||
| required: false | ||
| type: string | ||
| workflow_call: | ||
| inputs: | ||
| after_image: | ||
| required: true | ||
| type: string | ||
| before_image: | ||
| required: false | ||
| type: string | ||
|
|
||
| concurrency: | ||
| group: benchmark-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| benchmark: | ||
| runs-on: ubuntu-large | ||
| permissions: | ||
| pull-requests: write | ||
| contents: read | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: "1.25" | ||
|
|
||
| - name: Install Kind | ||
| run: | | ||
| curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.27.0/kind-linux-amd64 | ||
| chmod +x ./kind | ||
| sudo mv ./kind /usr/local/bin/kind | ||
|
|
||
| - name: Install Helm | ||
| run: | | ||
| curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | ||
|
|
||
| - name: Resolve before image | ||
| id: before-image | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| if [[ -n "${{ inputs.before_image }}" ]]; then | ||
| echo "BEFORE_IMAGE=${{ inputs.before_image }}" >> "$GITHUB_OUTPUT" | ||
| else | ||
| LATEST_TAG=$(gh api repos/${{ github.repository }}/releases/latest --jq '.tag_name') | ||
| echo "BEFORE_IMAGE=quay.io/kubescape/node-agent:${LATEST_TAG}" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Build after image | ||
| id: after-image | ||
| if: ${{ !inputs.after_image }} | ||
| run: | | ||
| curl https://github.com/inspektor-gadget/inspektor-gadget/releases/download/v0.48.1/ig_0.48.1_amd64.deb -LO && sudo dpkg -i ig_0.48.1_amd64.deb | ||
| make gadgets | ||
| make binary | ||
| make docker-build IMAGE=quay.io/kubescape/node-agent TAG=bench-${{ github.sha }} | ||
| echo "AFTER_IMAGE=quay.io/kubescape/node-agent:bench-${{ github.sha }}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Set after image from input | ||
| id: after-image-input | ||
| if: ${{ inputs.after_image }} | ||
| run: | | ||
| echo "AFTER_IMAGE=${{ inputs.after_image }}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Determine after image | ||
| id: resolve-after | ||
| run: | | ||
| AFTER="${{ steps.after-image.outputs.AFTER_IMAGE || steps.after-image-input.outputs.AFTER_IMAGE }}" | ||
| echo "AFTER_IMAGE=${AFTER}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Load after image into Kind | ||
| if: ${{ !inputs.after_image }} | ||
| run: | | ||
| # Kind cluster is created by dedup-bench.sh, but we need to pre-load the image | ||
| # The script's load_image function handles this automatically | ||
| echo "After image will be loaded by dedup-bench.sh" | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install Python dependencies | ||
| run: pip install -r benchmark/requirements.txt | ||
|
|
||
| - name: Run benchmark | ||
| env: | ||
| BEFORE_IMAGE: ${{ steps.before-image.outputs.BEFORE_IMAGE }} | ||
| AFTER_IMAGE: ${{ steps.resolve-after.outputs.AFTER_IMAGE }} | ||
| OUTPUT_DIR: ${{ github.workspace }}/benchmark-output | ||
| run: | | ||
| chmod +x benchmark/dedup-bench.sh | ||
| benchmark/dedup-bench.sh "$BEFORE_IMAGE" "$AFTER_IMAGE" | ||
|
|
||
| - name: Generate markdown report | ||
| if: always() | ||
| run: | | ||
| python3 benchmark/compare-metrics.py --format markdown \ | ||
| "${{ github.workspace }}/benchmark-output/before" \ | ||
| "${{ github.workspace }}/benchmark-output/after" > report.md || true | ||
|
|
||
| - name: Quality gate - check for performance degradation | ||
| if: always() | ||
| run: | | ||
| python3 benchmark/compare-metrics.py --check \ | ||
| "${{ github.workspace }}/benchmark-output/before" \ | ||
| "${{ github.workspace }}/benchmark-output/after" | ||
|
|
||
| - name: Comment on PR | ||
| uses: peter-evans/create-or-update-comment@v4 | ||
| if: github.event_name == 'pull_request' && always() | ||
| with: | ||
| issue-number: ${{ github.event.pull_request.number }} | ||
| body-path: report.md | ||
| comment-tag: benchmark-results | ||
slashben marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: benchmark-results | ||
| path: ${{ github.workspace }}/benchmark-output/ | ||
| retention-days: 30 | ||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.