Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: microsoft/bpf_performance
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.4
Choose a base ref
...
head repository: microsoft/bpf_performance
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
groups:
actions:
patterns:
- "*"
108 changes: 13 additions & 95 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -27,7 +27,12 @@ jobs:
BUILD_TYPE: ${{inputs.configuration}}

steps:
- uses: actions/checkout@v3
- name: Harden Runner
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
with:
egress-policy: audit

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: 'recursive'

@@ -52,44 +57,17 @@ jobs:
sudo LIBDIR=/lib/x86_64-linux-gnu make install
sudo ldconfig
- name: Get the latest run ID from Microsoft/ebpf-for-windows main branch - Windows-2019 or Windows-2022
- name: Download the ebpf-for-windows build nuget package
if: inputs.platform == 'windows-2019' || inputs.platform == 'windows-2022'
run: |
mkdir ${{github.workspace}}/local_packages
$token = ConvertTo-SecureString -String ${{secrets.github_token}} -AsPlainText -Force
$workflow = ((Invoke-WebRequest -Uri "https://api.github.com/repos/microsoft/ebpf-for-windows/actions/runs?per_page=1&exclude_pull_requests=true&branch=main&status=completed&event=schedule" -Token $token).Content | ConvertFrom-Json).workflow_runs[0]
$runId = $workflow.id
$commitSha = $workflow.head_sha
echo "RUNID=$runId" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "COMMIT_SHA=$commitSha" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Get Linux Kernel version
if: inputs.platform == 'ubuntu-22.04'
run: |
echo "COMMIT_SHA=$(uname -r)" >> $env:GITHUB_ENV
- name: Cache downloaded artifacts
if: inputs.platform == 'windows-2019' || inputs.platform == 'windows-2022'
uses: actions/cache@v2
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: "ebpf-for-windows - NuGet package (none_Release)"
path: ${{github.workspace}}/local_packages
key: ${{inputs.platform}}-${{inputs.configuration}}-ebpf-for-windows-run-id-${{env.RUNID}}

- name: Download daily nuget package and MSI installer - Windows-2019 or Windows-2022
env:
GH_TOKEN: ${{ github.token }}
if: inputs.platform == 'windows-2019' || inputs.platform == 'windows-2022'
run: |
$token = ConvertTo-SecureString -String ${{secrets.github_token}} -AsPlainText -Force
$artifacts = @()
$artifacts += 'ebpf-for-windows - NuGet package (Build-x64_Release)'
$artifacts += 'ebpf-for-windows - MSI installer (Build-x64_Release)'
scripts\Fetch-LatestArtifacts.ps1 -ArtifactsToDownload $artifacts -OutputPath ${{github.workspace}}/local_packages -RunId ${{env.RUNID}} -GitHubToken $token

- name: Configure CMake - Windows-2019 or Windows-2022
if: inputs.platform == 'windows-2019' || inputs.platform == 'windows-2022'
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBPF_PERF_LOCAL_NUGET_PATH=${{github.workspace}}/local_packages -DBPF_PERF_LOCAL_MSI_PATH=${{github.workspace}}/local_packages
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBPF_PERF_LOCAL_NUGET_PATH=${{github.workspace}}/local_packages
- name: Configure CMake - Ubuntu-22.04
if: inputs.platform == 'ubuntu-22.04'
@@ -112,71 +90,11 @@ jobs:
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
with:
name: build-${{env.BUILD_TYPE}}-${{inputs.platform}}
name: build-${{env.BUILD_TYPE}}-${{inputs.platform}}-${{inputs.option}}
path: ${{github.workspace}}/build/bin

- name: Create results directory
run: |
mkdir -p ${{github.workspace}}/results
- name: Create commit_sha.txt - Windows-2019 or Windows-2022
if: inputs.platform == 'windows-2019' || inputs.platform == 'windows-2022'
run:
echo ${{env.COMMIT_SHA}} | Out-File -FilePath ${{github.workspace}}/results/commit_sha.txt -Encoding utf8 -Append

- name: Create commit_sha.txt - Ubuntu-22.04
if: inputs.platform == 'ubuntu-22.04'
run: |
echo ${{env.COMMIT_SHA}} >> ${{github.workspace}}/results/commit_sha.txt
- name: Tests - Ubuntu-22.04
if: inputs.platform == 'ubuntu-22.04' && inputs.option == 'none'
working-directory: ${{github.workspace}}/build/bin
run: |
sudo ./bpf_performance_runner -i tests.yml -r | tee ${{github.workspace}}/results/jit-${{inputs.platform}}-${{env.BUILD_TYPE}}.csv
exit ${PIPESTATUS[0]}
- name: Install prerequisites - Windows-2019 or Windows-2022
if: inputs.platform == 'windows-2019' || inputs.platform == 'windows-2022'
working-directory: ${{github.workspace}}/local_packages
run: |
Start-Process msiexec.exe -Wait -ArgumentList '/i ebpf-for-windows.msi /quiet /qn /norestart /log install.log ADDLOCAL=ALL'
echo "C:\Program Files\ebpf-for-windows" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Tests - Windows 2019 or Windows 2022 - Native
if: (inputs.platform == 'windows-2019' || inputs.platform == 'windows-2022') && inputs.option == 'none'
working-directory: ${{github.workspace}}/build/bin
run: |
$pre_command = 'wpr.exe -start CPU'
$post_command = 'wpr.exe -stop ""${{github.workspace}}\results\%NAME%.etl""'
${{env.BUILD_TYPE}}\bpf_performance_runner.exe -i tests.yml -e .sys -r --pre "$pre_command" --post "$post_command" | Tee-Object -FilePath ${{github.workspace}}/results/native-${inputs.platform}-${{env.BUILD_TYPE}}.csv
- name: Tests - Windows 2019 or Windows 2022 - JIT
if: (inputs.platform == 'windows-2019' || inputs.platform == 'windows-2022') && inputs.option == 'jit'
working-directory: ${{github.workspace}}/build/bin
# Run with option to ignore failing return code
run: |
$pre_command = 'wpr.exe -start CPU'
$post_command = 'wpr.exe -stop ""${{github.workspace}}\results\%NAME%-jit.etl""'
${{env.BUILD_TYPE}}\bpf_performance_runner.exe -i tests.yml -r --pre "$pre_command" --post "$post_command" | Tee-Object -FilePath ${{github.workspace}}/results/native-${inputs.platform}-${{env.BUILD_TYPE}}.csv
- name: Upload results
uses: actions/upload-artifact@v2
with:
name: results-${{env.BUILD_TYPE}}-${{inputs.platform}}-${{inputs.option}}
path: |
${{github.workspace}}/results/*.csv
${{github.workspace}}/results/commit_sha.txt
- name: Upload profile
uses: actions/upload-artifact@v2
with:
name: profile-${{env.BUILD_TYPE}}-${{inputs.platform}}-${{inputs.option}}
path: |
${{github.workspace}}/results/*.etl
- name: Self-Tests
if: inputs.platform == 'ubuntu-22.04'
working-directory: ${{github.workspace}}/build/bin
@@ -191,7 +109,7 @@ jobs:
- name: Coveralls Parallel
if: inputs.option == 'coverage'
uses: coverallsapp/github-action@v2.2.1
uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8 # v2.3.4
with:
github-token: ${{ secrets.github_token }}
flag-name: run-${{inputs.build_type}}-${{inputs.platform}}-${{inputs.arch}}
62 changes: 55 additions & 7 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
@@ -13,11 +13,13 @@ on:
# Run on a daily schedule to perform the full set of tests.
schedule:
- cron: '00 21 * * *'
merge_group:

permissions:
id-token: write
contents: read
packages: write
security-events: write # Required by codeql task

concurrency:
# Cancel any CI/CD workflow currently in progress for the same PR.
@@ -26,12 +28,27 @@ concurrency:
cancel-in-progress: true

jobs:
build_and_test:
build_ebpf_for_windows:
name: Build ebpf-for-windows
uses: microsoft/ebpf-for-windows/.github/workflows/reusable-build.yml@main
with:
build_artifact: none
build_msi: true
build_nuget: true
build_options: /t:installer\ebpf-for-windows /p:ReleaseJIT='True'
repository: 'microsoft/ebpf-for-windows'
configurations: '["Release"]'
ref: main
perform_skip_check: false

build_bpf_performance:
needs: build_ebpf_for_windows
name: Build BPF Performance tests
strategy:
matrix:
configuration: [ 'Release', 'Debug' ]
platform: [ 'ubuntu-22.04', 'windows-2019', 'windows-2022' ]
option: [ none, sanitizer, coverage, jit ]
option: [ none, sanitizer, coverage ]
platform: [ 'ubuntu-22.04', 'windows-2022' ]
exclude:
- platform: windows-2019
option: sanitizer
@@ -50,23 +67,54 @@ jobs:
configuration: ${{ matrix.configuration }}
option: ${{ matrix.option }}

test_bpf_performance:
needs: build_bpf_performance
name: Test BPF Performance
strategy:
matrix:
configuration: [ 'Release' ]
platform: [ 'windows-2022', 'ubuntu-22.04' ]
option: [ none, jit ]
exclude:
- platform: windows-2019
option: sanitizer
- platform: windows-2019
option: coverage
- platform: windows-2022
option: sanitizer
- platform: windows-2022
option: coverage
- platform: ubuntu-22.04
option: jit

uses: ./.github/workflows/Test.yml
with:
platform: ${{ matrix.platform }}
configuration: ${{ matrix.configuration }}
option: ${{ matrix.option }}

finish:
needs:
- build_and_test
- test_bpf_performance
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
with:
egress-policy: audit

- name: Coveralls Finished
uses: coverallsapp/github-action@v2.2.1
uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8 # v2.3.4
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true

upload_results:
if: github.event_name == 'schedule' || github.event_name == 'push'
needs:
- build_and_test
- test_bpf_performance
uses: ./.github/workflows/UploadPerfResults.yml
secrets:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
Loading