Skip to content
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

Experimental: Use weights machines for CI based benchmarks #499

Closed
wants to merge 7 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# paritytech/wasmi
#
# To run benchmarks on a GitLab's "shell" runner following dependencies should be installed
# cargo-wasi
# wasmtime

stages:
- benchmarks
Expand All @@ -16,7 +20,7 @@ default:
image: "paritytech/ci-linux:staging"
interruptible: true
tags:
- linux-docker-benches
- weights

.kubernetes-env: &kubernetes-env
image: "paritytech/tools:latest"
Expand All @@ -27,7 +31,7 @@ default:
criterion-benchmark:
stage: benchmarks
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
<<: *docker-env
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
Expand All @@ -43,15 +47,15 @@ criterion-benchmark:
- git submodule update --init --recursive
- mkdir -p ./target/ci
- pushd ./crates/wasmi/
- cargo bench --bench benches -- --noplot --save-baseline master | tee ../../target/ci/bench-master
- cargo +nightly bench --bench benches -- --noplot --save-baseline master | tee ../../target/ci/bench-master
- popd
- git submodule deinit --all -f

# Benchmark Branch: PR
- git checkout $CI_COMMIT_SHA
- git submodule update --init --recursive
- pushd ./crates/wasmi/
- cargo bench --bench benches -- --noplot --baseline master | tee ../../target/ci/bench-pr
- cargo +nightly bench --bench benches -- --noplot --baseline master | tee ../../target/ci/bench-pr
- popd

# Save benchmark report
Expand All @@ -69,18 +73,14 @@ wasmtime-benchmark:
paths:
- target/ci/
script:
# Install dependencies
- cargo install cargo-wasi
- curl https://wasmtime.dev/install.sh -sSf | bash
- source ~/.profile

# `wasmtime` Branch: `master`
- git fetch
- git checkout master
- git pull
- git submodule update --init --recursive
- mkdir -p ./target/ci
- cargo wasi build --profile bench --bench benches --verbose
- cargo +nightly wasi build --profile bench --bench benches --verbose
- cp `ls -t target/wasm32-wasi/release/deps/*wasi.wasm` target/ci/benches-master.wasm
- pushd ./crates/wasmi/
- wasmtime run --dir=. ../../target/ci/benches-master.wasm -- --bench --save-baseline master-wasm | tee ../../target/ci/wasmtime-master
Expand All @@ -91,7 +91,7 @@ wasmtime-benchmark:
- git checkout $CI_COMMIT_SHA
- git submodule update --init --recursive
- mkdir -p ./target/ci
- cargo wasi build --profile bench --bench benches --verbose
- cargo +nightly wasi build --profile bench --bench benches --verbose
- cp `ls -t target/wasm32-wasi/release/deps/*wasi.wasm` target/ci/benches-pr.wasm
- pushd ./crates/wasmi/
- wasmtime run --dir=. ../../target/ci/benches-pr.wasm -- --bench --baseline master-wasm | tee ../../target/ci/wasmtime-pr
Expand Down