-
Notifications
You must be signed in to change notification settings - Fork 679
ci: add Multus node-density-cni e2e with PR performance reports #1530
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
Merged
bpickard22
merged 5 commits into
k8snetworkplumbingwg:master
from
wizhaoredhat:add_node_density_kube_burner_perf
Aug 11, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7daf4b2
ci: add Multus node-density-cni e2e with PR performance reports
wizhaoredhat e88cfb1
ci: harden Multus perf reporting scripts/workflow from Code Rabbit
wizhaoredhat 6f1c624
Fail fast when CNI plugin install download fails
wizhaoredhat 8747731
Harden perf report workflow + node density test reported by Code Rabbit
wizhaoredhat 5175e5d
Centralize GitHub token/repo helpers
wizhaoredhat 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
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,222 @@ | ||
| name: performance-report | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: ["e2e-kind"] | ||
| types: | ||
| - completed | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| issues: write | ||
| actions: read | ||
|
|
||
| concurrency: | ||
| group: perf-report-${{ github.event.workflow_run.head_branch || github.run_id }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| process-performance-results: | ||
| name: Process Performance Results | ||
| runs-on: ubuntu-latest | ||
| if: github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure' | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Install Python dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r e2e/perf/requirements.txt | ||
|
|
||
| - name: Download performance test data artifacts | ||
| run: | | ||
| e2e/perf/download-artifacts.py \ | ||
| --run-id ${{ github.event.workflow_run.id }} \ | ||
| --filter "performance-test-data" \ | ||
| --output-dir artifact-downloads \ | ||
| --extract | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| - name: Organize extracted artifacts and generate JSON data | ||
| run: | | ||
| for dir in artifact-downloads/*performance-test-data*; do | ||
| if [ -d "$dir" ]; then | ||
| workload=$(basename "$dir" | sed 's/-performance-test-data-.*//') | ||
| mkdir -p "reports/${workload}" | ||
|
|
||
| metrics_dir="" | ||
| if [ -d "$dir/perf-data/metrics" ]; then | ||
| metrics_dir="$dir/perf-data/metrics" | ||
| elif [ -d "$dir/metrics" ]; then | ||
| metrics_dir="$dir/metrics" | ||
| fi | ||
|
|
||
| if [ -n "$metrics_dir" ]; then | ||
| echo "Processing workload: $workload (metrics: $metrics_dir)" | ||
| python3 e2e/perf/generate_perf_report.py \ | ||
| --workload "$workload" \ | ||
| --metrics-dir "$metrics_dir" \ | ||
| --json-output "reports/${workload}/performance_data.json" \ | ||
| --output "reports/${workload}/performance_report.md" | ||
| else | ||
| echo "Warning: no metrics directory found under $dir" | ||
| find "$dir" -type f | head -50 || true | ||
| fi | ||
| fi | ||
| done | ||
|
|
||
| echo "=== Generated reports structure ===" | ||
| find reports -type f 2>/dev/null || true | ||
|
|
||
| - name: Get associated PRs | ||
| id: get_prs | ||
| run: | | ||
| PR_NUMBERS=$(e2e/perf/get-pr-info.py \ | ||
| --event-path $GITHUB_EVENT_PATH \ | ||
| --format json) | ||
| echo "pr_numbers=$PR_NUMBERS" >> $GITHUB_OUTPUT | ||
| echo "Found PRs: $PR_NUMBERS" | ||
|
|
||
| - name: Fetch baseline run | ||
| id: get_baseline | ||
| if: steps.get_prs.outputs.pr_numbers != '[]' | ||
| run: | | ||
| # Prefer a successful push run of e2e-kind as the baseline when no | ||
| # scheduled performance lane exists yet. | ||
| BASELINE_INFO=$(e2e/perf/get-baseline-run.py \ | ||
| --workflow kind-e2e.yml \ | ||
| --event push \ | ||
| --output json) || echo "{}" | ||
|
|
||
| BASELINE_ID=$(echo "$BASELINE_INFO" | python3 -c "import sys, json; data=json.load(sys.stdin); print(data.get('id', ''))" 2>/dev/null || echo "") | ||
| BASELINE_URL=$(echo "$BASELINE_INFO" | python3 -c "import sys, json; data=json.load(sys.stdin); print(data.get('url', ''))" 2>/dev/null || echo "") | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| echo "baseline_run_id=$BASELINE_ID" >> $GITHUB_OUTPUT | ||
| echo "baseline_run_url=$BASELINE_URL" >> $GITHUB_OUTPUT | ||
|
|
||
| echo "Baseline run ID: $BASELINE_ID" | ||
| echo "Baseline run URL: $BASELINE_URL" | ||
|
|
||
| - name: Download baseline artifacts | ||
| if: steps.get_baseline.outputs.baseline_run_id != '' | ||
| run: | | ||
| e2e/perf/download-artifacts.py \ | ||
| --run-id ${{ steps.get_baseline.outputs.baseline_run_id }} \ | ||
| --filter "performance-test-data" \ | ||
| --output-dir baseline-downloads \ | ||
| --extract | ||
|
|
||
| - name: Organize baseline artifacts and generate JSON data | ||
| if: steps.get_baseline.outputs.baseline_run_id != '' | ||
| run: | | ||
| mkdir -p baseline-reports | ||
| for dir in baseline-downloads/*performance-test-data*; do | ||
| if [ -d "$dir" ]; then | ||
| workload=$(basename "$dir" | sed 's/-performance-test-data-.*//') | ||
| mkdir -p "baseline-reports/${workload}" | ||
|
|
||
| metrics_dir="" | ||
| if [ -d "$dir/perf-data/metrics" ]; then | ||
| metrics_dir="$dir/perf-data/metrics" | ||
| elif [ -d "$dir/metrics" ]; then | ||
| metrics_dir="$dir/metrics" | ||
| fi | ||
|
|
||
| if [ -n "$metrics_dir" ]; then | ||
| echo "Processing baseline workload: $workload" | ||
| python3 e2e/perf/generate_perf_report.py \ | ||
| --workload "$workload" \ | ||
| --metrics-dir "$metrics_dir" \ | ||
| --json-output "baseline-reports/${workload}/performance_data.json" \ | ||
| --output "baseline-reports/${workload}/performance_report.md" | ||
| fi | ||
| fi | ||
| done | ||
|
|
||
| echo "=== Baseline reports structure ===" | ||
| find baseline-reports -type f 2>/dev/null || echo "No baseline reports found" | ||
|
|
||
| - name: Compare reports with baseline | ||
| if: steps.get_prs.outputs.pr_numbers != '[]' | ||
| run: | | ||
| mkdir -p enhanced-reports | ||
|
|
||
| for workload_dir in reports/*/; do | ||
| if [ -d "$workload_dir" ]; then | ||
| workload=$(basename "$workload_dir") | ||
| current_json="$workload_dir/performance_data.json" | ||
| baseline_json="baseline-reports/$workload/performance_data.json" | ||
| enhanced_report="enhanced-reports/$workload/performance_report.md" | ||
|
|
||
| if [ -f "$current_json" ]; then | ||
| echo "Comparing data for workload: $workload" | ||
| mkdir -p "enhanced-reports/$workload" | ||
|
|
||
| if [ -f "$baseline_json" ]; then | ||
| e2e/perf/compare-reports.py \ | ||
| --current "$current_json" \ | ||
| --baseline "$baseline_json" \ | ||
| --baseline-url "${{ steps.get_baseline.outputs.baseline_run_url }}" \ | ||
| --output "$enhanced_report" | ||
| else | ||
| echo "No baseline found for $workload, using current data as-is" | ||
| e2e/perf/compare-reports.py \ | ||
| --current "$current_json" \ | ||
| --output "$enhanced_report" | ||
| fi | ||
| else | ||
| echo "Warning: No JSON data found for $workload" | ||
| fi | ||
| fi | ||
| done | ||
|
|
||
| - name: Post performance report to PRs | ||
| if: steps.get_prs.outputs.pr_numbers != '[]' | ||
| run: | | ||
| PR_NUMBERS=$(echo '${{ steps.get_prs.outputs.pr_numbers }}' | python3 -c "import sys, json; print(' '.join(f'--pr {pr}' for pr in json.load(sys.stdin)))") | ||
|
|
||
| if [ -n "$PR_NUMBERS" ]; then | ||
| e2e/perf/post-pr-comment.py \ | ||
| $PR_NUMBERS \ | ||
| --reports-dir enhanced-reports \ | ||
| --run-id "${{ github.event.workflow_run.id }}" \ | ||
| --run-url "${{ github.event.workflow_run.html_url }}" \ | ||
| --status "${{ github.event.workflow_run.conclusion }}" \ | ||
| --baseline-id "${{ steps.get_baseline.outputs.baseline_run_id }}" \ | ||
| --baseline-url "${{ steps.get_baseline.outputs.baseline_run_url }}" | ||
| fi | ||
|
|
||
| - name: Upload processed artifacts | ||
| if: always() | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | ||
| with: | ||
| name: processed-performance-data-${{ github.event.workflow_run.id }} | ||
| path: | | ||
| reports/ | ||
| enhanced-reports/ | ||
| baseline-reports/ | ||
| if-no-files-found: warn | ||
| retention-days: 90 | ||
|
|
||
| - name: Summary | ||
| if: always() | ||
| run: | | ||
| echo "## Performance Report Processing Summary" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **Workflow Run ID:** ${{ github.event.workflow_run.id }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **Conclusion:** ${{ github.event.workflow_run.conclusion }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **Associated PRs:** ${{ steps.get_prs.outputs.pr_numbers }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "### Artifacts Processed" >> $GITHUB_STEP_SUMMARY | ||
| PERF_TEST_COUNT=$(ls -1d artifact-downloads/*performance-test-data* 2>/dev/null | wc -l | tr -d ' ') | ||
| echo "- Performance test data dirs: **${PERF_TEST_COUNT}**" >> $GITHUB_STEP_SUMMARY | ||
| find reports enhanced-reports -type f 2>/dev/null | sed 's/^/- /' >> $GITHUB_STEP_SUMMARY || true | ||
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
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
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
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,51 @@ | ||
| --- | ||
| # Multus-aware adaptation of kube-burner kubelet-density-cni. | ||
| # Each iteration creates a webserver Deployment, Service, and curl client | ||
| # Deployment. Pods are annotated for a Multus secondary macvlan network. | ||
| metricsEndpoints: | ||
| - alias: local-indexer | ||
| indexer: | ||
| type: local | ||
| metricsDirectory: perf-data/metrics | ||
| createTarball: true | ||
| tarballName: node-density-cni-metrics.tgz | ||
|
|
||
| global: | ||
| gc: true | ||
| timeout: 30m | ||
| measurements: | ||
| - name: podLatency | ||
|
|
||
| jobs: | ||
| - name: create-density-nad | ||
| jobIterations: 1 | ||
| qps: 5 | ||
| burst: 5 | ||
| namespacedIterations: false | ||
| namespace: node-density-cni | ||
| waitWhenFinished: true | ||
| cleanup: true | ||
| objects: | ||
| - objectTemplate: kubeburner/templates/density-macvlan-nad.yml | ||
| replicas: 1 | ||
|
|
||
| - name: node-density-cni | ||
| # Overridden by test-node-density-cni.sh via --set jobs.1.jobIterations | ||
| jobIterations: 64 | ||
| qps: 10 | ||
| burst: 10 | ||
| namespacedIterations: false | ||
| namespace: node-density-cni | ||
| waitWhenFinished: true | ||
| podWait: false | ||
| cleanup: false | ||
| preLoadImages: true | ||
| preLoadPeriod: 2m | ||
| maxWaitTimeout: 15m | ||
| objects: | ||
| - objectTemplate: kubeburner/templates/webserver-deployment.yml | ||
| replicas: 1 | ||
| - objectTemplate: kubeburner/templates/webserver-service.yml | ||
| replicas: 1 | ||
| - objectTemplate: kubeburner/templates/curl-deployment.yml | ||
| replicas: 1 |
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,42 @@ | ||
| kind: Deployment | ||
| apiVersion: apps/v1 | ||
| metadata: | ||
| name: curl-{{.Replica}}-{{.Iteration}} | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| name: curl-{{.Replica}}-{{.Iteration}} | ||
| strategy: | ||
| type: RollingUpdate | ||
| template: | ||
| metadata: | ||
| labels: | ||
| name: curl-{{.Replica}}-{{.Iteration}} | ||
| annotations: | ||
| k8s.v1.cni.cncf.io/networks: density-macvlan | ||
| spec: | ||
| nodeSelector: | ||
| node-role.kubernetes.io/worker: "" | ||
| containers: | ||
| - name: curlapp | ||
| image: quay.io/cloud-bulldozer/curl:latest | ||
| command: ["sleep", "inf"] | ||
| env: | ||
| - name: WEBSERVER_HOSTNAME | ||
| value: webserver-{{.Replica}}-{{.Iteration}} | ||
| - name: WEBSERVER_PORT | ||
| value: "8080" | ||
| imagePullPolicy: IfNotPresent | ||
| securityContext: | ||
| privileged: false | ||
| startupProbe: | ||
| exec: | ||
| command: | ||
| - "/bin/sh" | ||
| - "-c" | ||
| - "curl --fail --silent --show-error ${WEBSERVER_HOSTNAME}:${WEBSERVER_PORT}" | ||
| periodSeconds: 1 | ||
| timeoutSeconds: 1 | ||
| failureThreshold: 600 | ||
| restartPolicy: Always |
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.