2018-11-11 08:19:04 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
2018-08-13 15:57:23 -07:00
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
2018-12-18 18:01:34 -08:00
|
|
|
annotate() {
|
|
|
|
${BUILDKITE:-false} && {
|
|
|
|
buildkite-agent annotate "$@"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ci/affects-files.sh \
|
2018-12-18 17:33:28 -08:00
|
|
|
.rs$ \
|
2019-01-03 09:15:55 -08:00
|
|
|
Cargo.lock$ \
|
|
|
|
Cargo.toml$ \
|
2018-12-18 17:33:28 -08:00
|
|
|
ci/test-bench.sh \
|
2018-12-18 18:01:34 -08:00
|
|
|
|| {
|
2018-12-18 17:33:28 -08:00
|
|
|
annotate --style info --context test-bench \
|
2018-12-18 18:01:34 -08:00
|
|
|
"Bench skipped as no .rs files were modified"
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-12-18 14:25:10 -08:00
|
|
|
source ci/_
|
2018-12-13 21:44:50 -08:00
|
|
|
source ci/upload-ci-artifact.sh
|
2018-10-12 15:13:10 -07:00
|
|
|
|
|
|
|
eval "$(ci/channel-info.sh)"
|
2019-03-14 19:41:05 -07:00
|
|
|
source ci/rust-version.sh nightly
|
2018-08-13 15:57:23 -07:00
|
|
|
|
2018-09-24 10:20:58 -07:00
|
|
|
set -o pipefail
|
2018-11-21 12:16:16 -08:00
|
|
|
export RUST_BACKTRACE=1
|
2018-09-24 10:20:58 -07:00
|
|
|
|
2018-10-12 15:13:10 -07:00
|
|
|
UPLOAD_METRICS=""
|
|
|
|
TARGET_BRANCH=$BUILDKITE_BRANCH
|
|
|
|
if [[ -z $BUILDKITE_BRANCH ]] || ./ci/is-pr.sh; then
|
|
|
|
TARGET_BRANCH=$EDGE_CHANNEL
|
|
|
|
else
|
|
|
|
UPLOAD_METRICS="upload"
|
|
|
|
fi
|
|
|
|
|
2018-09-19 13:16:55 -07:00
|
|
|
BENCH_FILE=bench_output.log
|
2018-10-12 15:13:10 -07:00
|
|
|
BENCH_ARTIFACT=current_bench_results.log
|
2019-03-18 22:08:21 -07:00
|
|
|
|
2019-03-25 13:10:56 -07:00
|
|
|
# Run runtime benches
|
|
|
|
_ cargo +$rust_nightly bench --manifest-path runtime/Cargo.toml ${V:+--verbose} \
|
|
|
|
-- -Z unstable-options --format=json | tee "$BENCH_FILE"
|
|
|
|
|
2019-03-18 22:08:21 -07:00
|
|
|
# Run core benches
|
|
|
|
_ cargo +$rust_nightly bench --manifest-path core/Cargo.toml ${V:+--verbose} \
|
2018-12-18 08:14:33 -08:00
|
|
|
-- -Z unstable-options --format=json | tee "$BENCH_FILE"
|
2018-11-21 12:16:16 -08:00
|
|
|
|
2019-03-04 10:08:21 -08:00
|
|
|
# Run bpf benches
|
2019-03-18 22:08:21 -07:00
|
|
|
_ cargo +$rust_nightly bench --manifest-path programs/bpf/Cargo.toml ${V:+--verbose} --features=bpf_c \
|
|
|
|
-- -Z unstable-options --format=json --nocapture | tee -a "$BENCH_FILE"
|
|
|
|
|
2018-11-21 12:16:16 -08:00
|
|
|
|
2019-03-14 19:41:05 -07:00
|
|
|
_ cargo +$rust_nightly run --release --package solana-upload-perf \
|
2018-12-18 08:14:33 -08:00
|
|
|
-- "$BENCH_FILE" "$TARGET_BRANCH" "$UPLOAD_METRICS" > "$BENCH_ARTIFACT"
|
2018-10-12 15:13:10 -07:00
|
|
|
|
2018-12-13 21:44:50 -08:00
|
|
|
upload-ci-artifact "$BENCH_ARTIFACT"
|