forked from apache/horaedb
-
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.
* add tsbs CI * add pull request condition * Update summary after benchmark
- Loading branch information
1 parent
ed22bf9
commit 96b3f2d
Showing
2 changed files
with
118 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,46 @@ | ||
name: TSBS Benchmark | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- '.github/workflows/tsbs.yml' | ||
- 'scrits/run-tsbs.sh' | ||
paths-ignore: | ||
schedule: | ||
- cron: '2 0 * * *' | ||
|
||
jobs: | ||
run-tsbs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Cache Rust Dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo | ||
./target | ||
key: rust-${{ runner.os }}-release-${{ hashFiles('rust-toolchain') }}-${{ hashFiles('Cargo.lock') }} | ||
restore-keys: | | ||
rust-${{ runner.os }}-release-${{ hashFiles('rust-toolchain') }}- | ||
rust-${{ runner.os }}-release- | ||
rust-${{ runner.os }} | ||
- name: Build server | ||
run: | | ||
make build | ||
- name: Run TSBS | ||
run: | | ||
./scripts/run-tsbs.sh | ||
echo "NOW=$(TZ=':Asia/Shanghai' date +'%Y-%m-%dT%H_%M_%S')" >> $GITHUB_ENV | ||
- name: Update Summary | ||
run: | | ||
cat tsbs/result.md >> $GITHUB_STEP_SUMMARY | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: bench-${{ env.NOW }} | ||
path: | | ||
logs/** | ||
tsbs/result.md |
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,72 @@ | ||
#!/usr/bin/env bash | ||
|
||
export CURR_DIR=$(pwd) | ||
# used to create issue in https://github.com/CeresDB/tsbs/labels | ||
export RESULT_FILE=${CURR_DIR}/tsbs/result.md | ||
export CONFIG_FILE=${CONFIG_FILE:-docs/minimal.toml} | ||
export LOG_DIR=${CURR_DIR}/logs | ||
# where generated data stored | ||
export DATA_FILE=${DATA_FILE:-data.out} | ||
# how many values in host tag | ||
export HOST_NUM=${HOST_NUM:-10000} | ||
export TS_START="2022-09-05T00:00:00Z" | ||
export TS_END="2022-09-05T12:00:01Z" | ||
export EXE_FILE_NAME=${CURR_DIR}/tsbs/tsbs_generate_queries | ||
# where generated queries stored | ||
export BULK_DATA_DIR=${CURR_DIR}/tsbs/data | ||
export FORMATS=ceresdb | ||
export QUERY_TYPES="\ | ||
single-groupby-1-1-1 \ | ||
single-groupby-1-1-12 \ | ||
single-groupby-1-8-1 \ | ||
single-groupby-5-1-1 \ | ||
single-groupby-5-1-12 \ | ||
single-groupby-5-8-1" | ||
|
||
set -x | ||
trap cleanup EXIT | ||
cleanup() { | ||
ls -lha ${LOG_DIR} | ||
ls -lha ${CURR_DIR}/tsbs | ||
ls -lha ${BULK_DATA_DIR} | ||
} | ||
|
||
mkdir -p ${LOG_DIR} | ||
|
||
nohup ./target/release/ceresdb-server -c ${CONFIG_FILE} > ${LOG_DIR}/server.log & | ||
|
||
git clone -b feat-ceresdb --depth 1 --single-branch https://github.com/CeresDB/tsbs.git | ||
|
||
cd tsbs | ||
go build ./cmd/tsbs_generate_data | ||
go build ./cmd/tsbs_load_ceresdb | ||
go build ./cmd/tsbs_generate_queries | ||
go build ./cmd/tsbs_run_queries_ceresdb | ||
|
||
# generate benchmark data | ||
./tsbs_generate_data --use-case="cpu-only" --seed=123 --initial-scale=${HOST_NUM} --scale=${HOST_NUM} \ | ||
--timestamp-start="${TS_START}" \ | ||
--timestamp-end="${TS_END}" \ | ||
--log-interval="60s" --format="${FORMATS}" > ${DATA_FILE} | ||
|
||
|
||
# write data to ceresdb | ||
./tsbs_load_ceresdb --file ${DATA_FILE} | tee ${LOG_DIR}/write.log | ||
|
||
# generate queries | ||
./scripts/generate_queries.sh | ||
|
||
# run queries against ceresdb | ||
# Note: only run 5-8-1 now | ||
cat ${BULK_DATA_DIR}/ceresdb-single-groupby-5-8-1-queries.gz | gunzip | ./tsbs_run_queries_ceresdb | tee ${LOG_DIR}/5-8-1.log | ||
|
||
# Output write & query result | ||
echo '# Write' >> ${RESULT_FILE} | ||
echo '```bash' >> ${RESULT_FILE} | ||
cat ${LOG_DIR}/write.log >> ${RESULT_FILE} | ||
echo '```' >> ${RESULT_FILE} | ||
|
||
echo '# Query' >> ${RESULT_FILE} | ||
echo '```bash' >> ${RESULT_FILE} | ||
cat ${LOG_DIR}/5-8-1.log >> ${RESULT_FILE} | ||
echo '```' >> ${RESULT_FILE} |