Unverified Commit 947f0b23 authored by Simon Mo's avatar Simon Mo Committed by GitHub
Browse files

CI: make sure benchmark script exit on error (#2449)

parent f780504d
...@@ -7,8 +7,10 @@ cd "$(dirname "${BASH_SOURCE[0]}")/.." ...@@ -7,8 +7,10 @@ cd "$(dirname "${BASH_SOURCE[0]}")/.."
# run benchmarks and upload the result to buildkite # run benchmarks and upload the result to buildkite
python3 benchmarks/benchmark_latency.py 2>&1 | tee benchmark_latency.txt python3 benchmarks/benchmark_latency.py 2>&1 | tee benchmark_latency.txt
bench_latency_exit_code=$?
python3 benchmarks/benchmark_throughput.py --input-len 256 --output-len 256 2>&1 | tee benchmark_throughput.txt python3 benchmarks/benchmark_throughput.py --input-len 256 --output-len 256 2>&1 | tee benchmark_throughput.txt
bench_throughput_exit_code=$?
# write the results into a markdown file # write the results into a markdown file
echo "### Latency Benchmarks" >> benchmark_results.md echo "### Latency Benchmarks" >> benchmark_results.md
...@@ -22,3 +24,12 @@ sed -n '$p' benchmark_throughput.txt >> benchmark_results.md ...@@ -22,3 +24,12 @@ sed -n '$p' benchmark_throughput.txt >> benchmark_results.md
# upload the results to buildkite # upload the results to buildkite
/workspace/buildkite-agent annotate --style "info" --context "benchmark-results" < benchmark_results.md /workspace/buildkite-agent annotate --style "info" --context "benchmark-results" < benchmark_results.md
# exit with the exit code of the benchmarks
if [ $bench_latency_exit_code -ne 0 ]; then
exit $bench_latency_exit_code
fi
if [ $bench_throughput_exit_code -ne 0 ]; then
exit $bench_throughput_exit_code
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment