forked from paritytech/substrate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce temporary GitLab & GHA benchmarking jobs (paritytech#10311)
* Introduce temporary bench job * Add runner label * CI: bench GHA * CI: bench GHA * CI: docs * CI: more docs * CI: run on master only Co-authored-by: Denis P <denis.pisarev@parity.io>
- Loading branch information
1 parent
7406442
commit 3f657a5
Showing
2 changed files
with
104 additions
and
0 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,75 @@ | ||
# Please do not tamper with this job, it's a part of benchmarking experiment. | ||
# However, you absolutely can copy it into another file and redo the last job in the pipeline. | ||
# Just make sure you won't introduce long queues to the GHA runner, we have just one at the moment. | ||
|
||
name: bench GHA against GitLab | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
bench_gh: | ||
runs-on: self-hosted | ||
env: | ||
CARGO_INCREMENTAL: 0 | ||
RUSTUP_HOME: /usr/local/rustup | ||
CARGO_HOME: /usr/local/cargo | ||
CC: clang | ||
CXX: clang | ||
|
||
steps: | ||
|
||
- name: Cancel Previous Runs | ||
uses: styfle/cancel-workflow-action@0.9.1 | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Install dependencies | ||
# Template job, one can copy it to another pipeline. | ||
run: | | ||
apt-get update | ||
apt-get install -y --no-install-recommends time clang | ||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 | ||
- name: Install Rust | ||
# Template job, one can copy it to another pipeline. | ||
# Referance code https://github.com/paritytech/scripts/blob/master/dockerfiles/base-ci-linux/Dockerfile | ||
# Better keep Rust versions here in sync with the CI image, otherwise the results will conflict. | ||
run: | | ||
curl -L "https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init" -o rustup-init | ||
chmod +x rustup-init | ||
./rustup-init -y --no-modify-path --profile minimal --default-toolchain stable | ||
rm rustup-init | ||
# add rustup tp PATH so it's usable right away | ||
echo "/usr/local/cargo/bin" >> $GITHUB_PATH | ||
source /usr/local/cargo/env | ||
chmod -R a+w ${RUSTUP_HOME} ${CARGO_HOME} | ||
# install nightly toolchain | ||
rustup toolchain install nightly-2021-11-08 --profile minimal --component rustfmt clippy | ||
# link the pinned toolchain to nightly | ||
ln -s /usr/local/rustup/toolchains/nightly-2021-11-08-x86_64-unknown-linux-gnu /usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu | ||
rustup target add wasm32-unknown-unknown | ||
rustup target add wasm32-unknown-unknown --toolchain nightly | ||
# show versions | ||
rustup show | ||
cargo --version | ||
# remove clutter from the installations | ||
rm -rf "${CARGO_HOME}/registry" "${CARGO_HOME}/git" | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: bench-GHA-test-full-crypto-feature | ||
# GitHub env variables reference: https://docs.github.com/en/actions/learn-github-actions/environment-variables | ||
# The important part of the experiment is the line with `curl`: it sends the job's timing to Prometheus. | ||
run: | | ||
START_TIME=`date '+%s'` | ||
cd primitives/core/ | ||
time cargo +nightly build --verbose --no-default-features --features full_crypto | ||
cd ../application-crypto | ||
time cargo +nightly build --verbose --no-default-features --features full_crypto | ||
END_TIME=`date '+%s'` | ||
TOTAL_TIME=`expr $END_TIME - $START_TIME` | ||
# please remove this line if you want to play with GHA runner. | ||
curl -d "parity_github_job_time{project=\"$GITHUB_REPOSITORY\",job=\"$GITHUB_WORKFLOW\",runner=\"github\"} $TOTAL_TIME" -X POST http://vm-longterm.parity-build.parity.io/api/v1/import/prometheus |
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