Skip to content

Commit

Permalink
Update cts traffic workflow (#187)
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
  • Loading branch information
Alan-Jowett and Alan Jowett committed May 16, 2024
1 parent bfe4f3e commit 56c3262
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 5 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/cts_traffic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ on:
required: false
default: false
type: boolean
tcp_ip_tracing:
description: 'Capture TCP/IP tracing'
required: false
default: false
type: boolean

pull_request:
branches:
Expand Down Expand Up @@ -46,8 +51,8 @@ jobs:
fail-fast: false
matrix:
vec: [
{ env: "azure", os: "2022", arch: "x64" },
{ env: "azure", os: "2025", arch: "x64" },
# { env: "azure", os: "2022", arch: "x64" },
# { env: "azure", os: "2025", arch: "x64" },
{ env: "lab", os: "2022", arch: "x64" },
]
runs-on:
Expand All @@ -59,6 +64,7 @@ jobs:
steps:
- name: Setup workspace
run: |
Get-ChildItem | % { Remove-Item -Recurse $_ }
if (Test-Path ${{ github.workspace }}\xdp) { Remove-Item -Recurse -Force ${{ github.workspace }}\cts-traffic }
if (Test-Path ${{ github.workspace }}\ETL) { Remove-Item -Recurse -Force ${{ github.workspace }}\ETL }
New-item -ItemType Directory -Path ${{ github.workspace }}\cts-traffic
Expand All @@ -78,6 +84,14 @@ jobs:
name: "cts-traffic Release"
path: ${{ github.workspace }}\cts-traffic

- name: Start TCPIP tracing
if: ${{ github.event.inputs.tcp_ip_tracing }}
run: |
wpr -cancel 2>$null; $global:LASTEXITCODE = 0
if (Test-Path "tcpip.wprp") { Remove-Item -Force "tcpip.wprp" }
Invoke-WebRequest -uri "https://raw.githubusercontent.com/microsoft/netperf/main/.github/workflows/tcpip.wprp" -OutFile "tcpip.wprp"
wpr -start tcpip.wprp -filemode
- name: Run CTS cts-traffic
working-directory: ${{ github.workspace }}\cts-traffic
run: |
Expand All @@ -86,12 +100,18 @@ jobs:
$url = "https://raw.githubusercontent.com/microsoft/bpf_performance/main/scripts/two-machine-perf.ps1"
iex "& { $(irm $url) } -CpuProfile $profile"
- name: Stop TCPIP tracing
if: ${{ github.event.inputs.tcp_ip_tracing }}
run: |
wpr -stop ${{ github.workspace }}\ETL\tcpip.etl
- name: Move ETL files to ETLfolder
working-directory: ${{ github.workspace }}\cts-traffic
run: |
dir .
if (Test-Path ${{ github.workspace }}\cts-traffic\cts_traffic_recv.etl) { Move-Item ${{ github.workspace }}\cts-traffic\cts_traffic_recv.etl ${{ github.workspace }}\ETL }
if (Test-Path ${{ github.workspace }}\cts-traffic\cts_traffic_send.etl) { Move-Item ${{ github.workspace }}\cts-traffic\cts_traffic_send.etl ${{ github.workspace }}\ETL }
if (Test-Path ${{ github.workspace }}\cts-traffic\tcpip_baseline.etl) { Move-Item ${{ github.workspace }}\cts-traffic\tcpip_baseline.etl ${{ github.workspace }}\ETL }
- name: Upload CTS cts-traffic results
if: always()
Expand All @@ -101,7 +121,7 @@ jobs:
path: ${{ github.workspace }}\cts-traffic\ctsTrafficResults.csv

- name: Upload ETL
if: ${{ github.event.inputs.profile }}
if: ${{ github.event.inputs.profile }} || ${{ github.event.inputs.tcp_ip_tracing }}
uses: actions/upload-artifact@v2
with:
name: cts_traffic_${{ matrix.vec.env }}_${{ matrix.vec.os }}_${{ matrix.vec.arch }}_ETL
Expand Down
33 changes: 31 additions & 2 deletions .github/workflows/ebpf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
steps:
- name: Setup workspace
run: |
Get-ChildItem | % { Remove-Item -Recurse $_ }
$process = Start-Process -FilePath "msiexec" -ArgumentList "/x {022C44B5-8969-4B75-8DB0-73F98B1BD7DC} /quiet /qn /norestart /log uninstall.log" -Wait -NoNewWindow
$process = Start-Process -FilePath "msiexec" -ArgumentList "/x {9363C0E3-4DE9-4067-9F5E-6A1A06034B59} /quiet /qn /norestart /log uninstall.log" -Wait -NoNewWindow
$url = "https://raw.githubusercontent.com/microsoft/ebpf-for-windows/main/scripts/Cleanup-Installer.ps1"
Expand Down Expand Up @@ -197,6 +198,14 @@ jobs:
name: "cts-traffic Release"
path: ${{ github.workspace }}\cts-traffic

- name: Start TCPIP tracing - Baseline
if: ${{ github.event.inputs.tcp_ip_tracing }}
run: |
wpr -cancel 2>$null; $global:LASTEXITCODE = 0
if (Test-Path "tcpip.wprp") { Remove-Item -Force "tcpip.wprp" }
Invoke-WebRequest -uri "https://raw.githubusercontent.com/microsoft/netperf/main/.github/workflows/tcpip.wprp" -OutFile "tcpip.wprp"
wpr -start tcpip.wprp -filemode
# Run CTS traffic without XDP installed to establish a baseline.
- name: Run CTS cts-traffic baseline
working-directory: ${{ github.workspace }}\cts-traffic
Expand All @@ -206,11 +215,15 @@ jobs:
$profile = 0
if ("${{inputs.profile}}" -eq "true") { $profile = 1 }
$url = "https://raw.githubusercontent.com/microsoft/bpf_performance/main/scripts/two-machine-perf.ps1"
if ("${{inputs.tcp_ip_tracing}}" -eq "true") { wpr -start ${{ github.workspace }}\.github\workflows\tcpip.wprp }
iex "& { $(irm $url) } -CpuProfile $profile"
if ("${{inputs.tcp_ip_tracing}}" -eq "true") { wpr -stop ${{ github.workspace }}\ETL\tcpip_baseline.etl }
if ($Profile) { Move-Item -Path ${{ github.workspace }}\cts-traffic\cts_traffic_send.etl -NewName "${{ github.workspace }}\etl\cts_traffic_send_baseline.etl"}
if ($Profile) { Rename-Item -Path ${{ github.workspace }}\cts-traffic\cts_traffic_recv.etl -NewName "${{ github.workspace }}\etl\cts_traffic_recv_baseline.etl" }
dir ${{ github.workspace }}\etl
- name: Stop TCPIP tracing - Baseline
if: ${{ github.event.inputs.tcp_ip_tracing }}
run: |
wpr -stop ${{ github.workspace }}\ETL\tcpip_baseline.etl
# The resulting CSV file's header is updated to match the format produced by the BPF performance tests.
# The "Average Duration (ns)" column is the metric of interest.
Expand Down Expand Up @@ -244,6 +257,15 @@ jobs:
bpftool prog show
Test-Connection -ComputerName netperf-peer -Count 1 -Ping
- name: Start TCPIP tracing - XDP
if: ${{ github.event.inputs.tcp_ip_tracing }}
run: |
Get-PSDrive -PSProvider FileSystem
wpr -cancel; $global:LASTEXITCODE = 0
if (Test-Path "tcpip.wprp") { Remove-Item -Force "tcpip.wprp" }
Invoke-WebRequest -uri "https://raw.githubusercontent.com/microsoft/netperf/main/.github/workflows/tcpip.wprp" -OutFile "tcpip.wprp"
wpr -start tcpip.wprp -filemode
# Run CTS traffic with XDP installed to measure the impact of XDP on performance.
- name: Run CTS cts-traffic xdp
working-directory: ${{ github.workspace }}\cts-traffic
Expand All @@ -253,10 +275,17 @@ jobs:
$profile = 0
if ("${{inputs.profile}}" -eq "true") { $profile = 1 }
$url = "https://raw.githubusercontent.com/microsoft/bpf_performance/main/scripts/two-machine-perf.ps1"
if (Test-Path "tcpip.wprp") { Remove-Item -Force "tcpip.wprp" }
Invoke-WebRequest -uri "https://raw.githubusercontent.com/microsoft/netperf/main/.github/workflows/tcpip.wprp" -OutFile "tcpip.wprp"
if ("${{inputs.tcp_ip_tracing}}" -eq "true") { wpr -start ${{ github.workspace }}\.github\workflows\tcpip.wprp }
iex "& { $(irm $url) } -CpuProfile $profile"
if ("${{inputs.tcp_ip_tracing}}" -eq "true") { wpr -stop ${{ github.workspace }}\ETL\tcpip_xdp.etl }
- name: Stop TCPIP tracing - Baseline
if: ${{ github.event.inputs.tcp_ip_tracing }}
run: |
wpr -stop ${{ github.workspace }}\ETL\tcpip_baseline.etl
- name: Copy ETL files to ETL folder
run: |
if (Test-Path -Path ${{ github.workspace }}\cts-traffic\cts_traffic_send.etl) { Move-Item -Path ${{ github.workspace }}\cts-traffic\cts_traffic_send.etl -Destination ${{ github.workspace }}\ETL }
Expand Down

0 comments on commit 56c3262

Please sign in to comment.