Skip to content

Commit

Permalink
ci: merge two steps
Browse files Browse the repository at this point in the history
Signed-off-by: iGxnon <[email protected]>
  • Loading branch information
iGxnon committed Mar 4, 2024
1 parent ccffa67 commit cf13f23
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 52 deletions.
40 changes: 0 additions & 40 deletions ci/docker-compose.yml

This file was deleted.

15 changes: 13 additions & 2 deletions ci/scripts/run-benchmark.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
#!/usr/bin/env bash

set -euo pipefail
set -uo pipefail
set +e

docker run --rm -v $(pwd):/xline \
-e SCCACHE_DIR="/var/lib/sccache" \
-v "/var/lib/sccache:/var/lib/sccache" \
ghcr.io/xline-kv/build-env:latest \
cargo build --release --bin xline --bin benchmark

cd scripts
cp ../target/release/{xline,benchmark} .
docker build . -t ghcr.io/xline-kv/xline:latest
docker pull datenlord/etcd:v3.5.5
bash ./benchmark.sh
bash ./benchmark.sh xline

docker run --rm -v $(pwd):/xline \
ghcr.io/xline-kv/build-env:latest \
rm -rf target/ .cargo/
11 changes: 2 additions & 9 deletions ci/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
steps:
- label: "build"
- label: "build & benchmark"
if: build.pull_request.labels includes "run-benchmark"
command: "docker run --rm -v $(pwd):/xline \
ghcr.io/xline-kv/build-env:latest \
cargo build --release --bin xline --bin benchmark"

- wait

- label: "benchmark"
command: "ci/scripts/run-benchmark.sh"
if: build.pull_request.labels includes "run-benchmark"
env:
BUILDKITE_PLUGIN_PR_COMMENT_COMMENT_FILE: "out/xline.txt"
plugins:
- ./ci/plugins/pr-comment

2 changes: 1 addition & 1 deletion scripts/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ for server in $@; do
logs_dir=${OUTPUT_DIR}/logs/${server}_logs
mkdir -p ${logs_dir}
result_file=${OUTPUT_DIR}/${server}.txt
printf "## Benchmark output" >>${result_file}
printf "## Benchmark output\n" >>${result_file}
printf ${FORMAT} "QPS" "Latency(ms)" "Time(s)" "Command" >>${result_file}
case ${server} in
xline)
Expand Down

0 comments on commit cf13f23

Please sign in to comment.