-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[workflow] Download bpf objects for veristat from S3 bucket
Use bpf objects from S3 bucker for Veristat validation and comparison Signed-off-by: Nikolay Yurin <[email protected]>
- Loading branch information
Showing
6 changed files
with
161 additions
and
73 deletions.
There are no files selected for viewing
This file contains 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,58 @@ | ||
name: 'run-veristat' | ||
description: 'Run veristat benchmark' | ||
inputs: | ||
arch_and_tool: | ||
description: 'arch and build tool string' | ||
required: true | ||
veristat_output: | ||
description: 'veristat output file' | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
# veristat.csv is produced by run-qemu run_veristat action | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ inputs.arch_and_tool }}-baseline-${{ inputs.veristat_output }} | ||
if-no-files-found: error | ||
path: '${{ github.workspace }}/${{ inputs.veristat_output }}' | ||
|
||
# For pull request: | ||
# - get baseline log from cache | ||
# - compare it to current run | ||
- if: ${{ github.event_name == 'pull_request' }} | ||
uses: actions/cache/restore@v3 | ||
with: | ||
key: ${{ env.CACHE_RESULT_KEY }} | ||
restore-keys: ${{ env.CACHE_RESULT_KEY }} | ||
path: '${{ env.CACHE_RESULT_KEY }}.csv' | ||
env: | ||
CACHE_RESULT_KEY: ${{ inputs.arch_and_tool }}-baseline-${{ inputs.veristat_output }} | ||
|
||
- if: ${{ github.event_name == 'pull_request' }} | ||
name: Show veristat comparison | ||
shell: bash | ||
run: | | ||
cd ${{ github.workspace }} | ||
if [[ ! -f ${{ env.CACHE_RESULT_KEY }}.csv ]]; then | ||
echo "No ${{ env.CACHE_RESULT_KEY }}.csv available" | ||
echo "# No ${{ env.CACHE_RESULT_KEY }}.csv available" >> $GITHUB_STEP_SUMMARY | ||
exit | ||
fi | ||
selftests/bpf/veristat \ | ||
--output-format csv \ | ||
--emit file,prog,verdict,states \ | ||
--compare ${{ env.CACHE_RESULT_KEY }}.csv veristat.csv > compare.csv | ||
python3 ./.github/scripts/veristat-compare.py compare.csv | ||
env: | ||
CACHE_RESULT_KEY: ${{ inputs.arch_and_tool }}-baseline-${{ inputs.veristat_output }} | ||
|
||
# For push: just put baseline log to cache | ||
- if: ${{ github.event_name == 'push' }} | ||
uses: actions/cache/save@v3 | ||
with: | ||
key: ${{ env.CACHE_RESULT_KEY }}.csv | ||
path: '${{ github.workspace }}/${{ env.CACHE_RESULT_KEY }}.csv' | ||
env: | ||
CACHE_RESULT_KEY: ${{ inputs.arch_and_tool }}-baseline-${{ inputs.veristat_output }} | ||
|
This file contains 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,12 @@ | ||
#!/bin/bash | ||
|
||
eval "$(guestfish --listen)" | ||
|
||
guestfish --verbose --remote \ | ||
add /tmp/root.img label:img : \ | ||
launch : \ | ||
mount /dev/disk/guestfs/img / : \ | ||
mkdir-p /bpf_objects : \ | ||
copy-in /tmp/bpf_objects /bpf_objects | ||
|
||
guestfish --remote exit |
This file contains 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 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,3 @@ | ||
VERISTAT_OBJECTS_DIR="/${PROJECT_NAME}/selftests/bpf" | ||
VERISTAT_OBJECTS_GLOB=$(awk '/^#/ { next; } { print $0 ".bpf.o"; }' "${BPF_SELFTESTS_DIR}/veristat.cfg") | ||
VERISTAT_OUTPUT="veristat.kernel.csv" |
This file contains 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,3 @@ | ||
VERISTAT_OBJECTS_DIR="/bpf_objects" | ||
VERISTAT_OBJECTS_GLOB="*.o" | ||
VERISTAT_OUTPUT="veristat.meta.csv" |
This file contains 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