-
Notifications
You must be signed in to change notification settings - Fork 102
ci: add continuous benchmarking #1726
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
CarlWachter
wants to merge
17
commits into
hermit-os:main
Choose a base branch
from
CarlWachter:feat/cb
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.
+159
−0
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
292231e
ci: add continuous benchmarking
CarlWachter 195b9b1
fix(cb): install parallel for networking benchmarks
CarlWachter 17609dd
feat(bench): Parallel execution of benchmarks
CarlWachter 158f85d
feat(bench): Label benchmark sets
CarlWachter a6d2877
feat(ci): move benchmark to seperate workflow
CarlWachter 4916cd4
fix(ci): add missing permissions for benchmark job
CarlWachter 38d98ce
fix(ci): give PR writing permissions for forks
CarlWachter e5c2040
fix(ci): prevent publish_docs from clearing benchmark data
CarlWachter 0994886
fix(bench): better qemu flags and benchmark arguments
CarlWachter 19df47f
cleanup: reformat benchmark workflow
CarlWachter 8929fd5
feat(bench): publish data to hermit-bench
CarlWachter 611fd09
feat(bench): prebuild netbench reference and tighten timing
CarlWachter 28c9a27
bench: use enviorment specific token
CarlWachter 226168f
fix(bench): update plot group labels
CarlWachter a76c663
bench: temporarily remove netbench
CarlWachter 84dbe03
bench: no default env
CarlWachter f5a019f
bench: build all benchmarks seperately
CarlWachter 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,41 @@ | ||
[ | ||
{ | ||
"name": "1 core", | ||
"bin": "startup_benchmark", | ||
"manifest_path": "Cargo.toml", | ||
"command": "sudo qemu-system-x86_64 -display none -smp 1 -m 128M -serial stdio -enable-kvm -cpu host,migratable=no,+invtsc -kernel hermit-loader-x86_64 -initrd target/x86_64-unknown-hermit/release/startup_benchmark", | ||
"external_time": true, | ||
"iterations": 25, | ||
"group": "General", | ||
"plot_group": "Startup Time" | ||
}, | ||
{ | ||
"name": "2 cores", | ||
"bin": "startup_benchmark", | ||
"manifest_path": "Cargo.toml", | ||
"command": "sudo qemu-system-x86_64 -display none -smp 2 -m 128M -serial stdio -enable-kvm -cpu host,migratable=no,+invtsc -kernel hermit-loader-x86_64 -initrd target/x86_64-unknown-hermit/release/startup_benchmark", | ||
"external_time": true, | ||
"iterations": 25, | ||
"group": "General", | ||
"plot_group": "Startup Time" | ||
}, | ||
{ | ||
"name": "4 cores", | ||
"bin": "startup_benchmark", | ||
"manifest_path": "Cargo.toml", | ||
"command": "sudo qemu-system-x86_64 -display none -smp 4 -m 128M -serial stdio -enable-kvm -cpu host,migratable=no,+invtsc -kernel hermit-loader-x86_64 -initrd target/x86_64-unknown-hermit/release/startup_benchmark", | ||
"external_time": true, | ||
"iterations": 25, | ||
"group": "General", | ||
"plot_group": "Startup Time" | ||
}, | ||
{ | ||
"name": "Pi Multithreaded Benchmark", | ||
"bin": "multithreaded_benchmark", | ||
"manifest_path": "Cargo.toml", | ||
"command": "sudo qemu-system-x86_64 -display none -smp 4 -m 512M -serial stdio -enable-kvm -cpu host,migratable=no,+invtsc -kernel hermit-loader-x86_64 -initrd target/x86_64-unknown-hermit/release/multithreaded_benchmark", | ||
"iterations": 25, | ||
"group": "General", | ||
"plot_group": "Multithreaded Pi Efficiency" | ||
} | ||
] |
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,26 @@ | ||
[ | ||
{ | ||
"name": "Micro Benchmarks", | ||
"bin": "micro_benchmarks", | ||
"manifest_path": "benches/micro/Cargo.toml", | ||
"command": "sudo qemu-system-x86_64 -display none -smp 4 -m 512M -serial stdio -enable-kvm -cpu host,migratable=no,+invtsc -kernel hermit-loader-x86_64 -initrd target/x86_64-unknown-hermit/release/micro_benchmarks", | ||
"iterations": 25, | ||
"group": "Micro" | ||
}, | ||
{ | ||
"name": "Allocation Benchmarks", | ||
"bin": "alloc_benchmarks", | ||
"manifest_path": "benches/alloc/Cargo.toml", | ||
"command": "sudo qemu-system-x86_64 -display none -smp 1 -m 5G -serial stdio -enable-kvm -cpu host,migratable=no,+invtsc -kernel hermit-loader-x86_64 -initrd target/x86_64-unknown-hermit/release/alloc_benchmarks", | ||
"iterations": 50, | ||
"group": "Allocations" | ||
}, | ||
{ | ||
"name": "Mutex Stress Test", | ||
"bin": "mutex", | ||
"manifest_path": "benches/mutex/Cargo.toml", | ||
"command": "sudo qemu-system-x86_64 -display none -smp 2 -m 512M -serial stdio -enable-kvm -cpu host,migratable=no,+invtsc -kernel hermit-loader-x86_64 -initrd target/x86_64-unknown-hermit/release/mutex", | ||
"iterations": 50, | ||
"group": "Mutex" | ||
} | ||
] |
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,91 @@ | ||
name: Benchmark | ||
|
||
on: | ||
pull_request_target: | ||
merge_group: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
jobs: | ||
benchmark: | ||
name: Run Benchmarks | ||
runs-on: [self-hosted] | ||
environment: ${{ github.event_name == 'push' && 'benchmark' || '' }} | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- benchmark-file: /kernel/.github/benchmarks/general.json | ||
benchmark-matrix-name: General | ||
benchmark-build: true | ||
- benchmark-file: /kernel/.github/benchmarks/misc.json | ||
benchmark-matrix-name: Misc | ||
benchmark-build: false | ||
|
||
steps: | ||
- name: Checkout hermit-rs | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: hermit-os/hermit-rs | ||
submodules: true | ||
- name: Remove hermit-kernel submodule | ||
run: git rm -r kernel | ||
- name: Checkout hermit-kernel | ||
uses: actions/checkout@v4 | ||
with: | ||
path: kernel | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends qemu-system-x86 cpu-checker parallel gh | ||
- name: Download loader | ||
run: gh release download --repo hermit-os/loader --pattern hermit-loader-x86_64 | ||
- uses: mkroening/rust-toolchain-toml@main | ||
- name: Install uhyve | ||
run: cargo +stable install --locked uhyve | ||
- name: Check KVM availability | ||
run: | | ||
lscpu | ||
kvm-ok | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rust-src | ||
- uses: mkroening/rust-toolchain-toml@main | ||
- run: rustup component add llvm-tools | ||
working-directory: . | ||
- run: rustup target add wasm32-wasip1 | ||
working-directory: . | ||
- uses: mkroening/rust-toolchain-toml@main | ||
with: | ||
toolchain-file: "kernel/rust-toolchain.toml" | ||
- name: Set up tap device | ||
if: matrix.benchmark-matrix-name == 'Netbench' | ||
run: | | ||
sudo ip tuntap add tap10 mode tap | ||
sudo ip addr add 10.0.5.1/24 broadcast 10.0.5.255 dev tap10 | ||
sudo ip link set dev tap10 | ||
echo 1 | sudo tee /proc/sys/net/ipv4/conf/tap10/proxy_arp | ||
- name: Run benchmarks | ||
uses: hermit-os/hermit-bench@main | ||
id: run-bench | ||
with: | ||
benchmark-file: ${{ matrix.benchmark-file }} | ||
- name: Store benchmark results | ||
uses: hermit-os/github-action-benchmark@main | ||
with: | ||
tool: 'hermit-bench' | ||
output-file-path: ${{ steps.run-bench.outputs.result-file }} | ||
github-token: ${{ github.event_name == 'push' && secrets.HERMIT_BENCH_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} | ||
benchmark-data-dir-path: benchmarks | ||
gh-repository: github.com/hermit-os/hermit-bench | ||
comment-always: true | ||
benchmark-matrix-name: ${{ matrix.benchmark-matrix-name }} | ||
auto-push: ${{ github.event_name == 'push' }} |
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.
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.