forked from cnosdb/cnosdb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
66 lines (59 loc) · 1.96 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
stages:
- bench
bench-job:
stage: bench
tags:
- shell
script:
# update benchmark-result
- cd /home/gitlab-runner/benchmark-result
- git pull
- cd -
# delete cnosdb data
- set +e
- killall cnosdb
- set -e
- sudo rm -rf /home/gitlab-runner/cnosdb
# complie cnosdb
- echo "compile code"
- source ~/.cargo/env
- make build_release
# modify config and start cnosdb
- sleep 10
- ulimit -n 65535
- ulimit -a
- echo "modify default config"
- sed -i "s/tmp/home\/gitlab-runner/g" config/config_8902.toml
- echo "starting cnosdb"
- nohup ./target/release/cnosdb run --config ./config/config_8902.toml -M singleton > ./target/cnosdb_output.log 2>&1 &
- echo "cnosdb is running"
# hits test and update benchmark-result
- echo "hits test"
- commit_id=${commit_id:-$(git log -1 --pretty=%h)}
- cd benchmark
- export HITS_DATA_URL="/home/cnosdb_dev/hits.parquet"
- export TSBS_DATA_URL="/home/cnosdb_dev/cnosdb_iot_123_500000.gz"
- export TSBS_QUERY_DIR="/home/cnosdb_dev/queries"
- sudo mv ../target/release/cnosdb-cli /bin/
- ./benchmark.sh hits
- ./update-results.sh hits
- cp ./results/hits.html /home/gitlab-runner/benchmark-result/benchmark-hits/hits_${commit_id}.html
# tsbs test and update benchmark-result
- echo "tsbs test"
- ./benchmark.sh tsbs
- ./update-results.sh tsbs
- cp ./results/tsbs.html /home/gitlab-runner/benchmark-result/benchmark-tsbs/tsbs_${commit_id}.html
# push benchmark-result
- cd /home/gitlab-runner/benchmark-result
- git add .
- git commit -m "Add file hits_${commit_id}.html and tsbs_${commit_id}.html"
- git push
# save logs and clean env
- cd -
- cd ..
- set +e
- killall cnosdb
- set -e
- cp /home/gitlab-runner/cnosdb/1001/log/* /home/gitlab-runner/benchmark_results/logs/${commit_id}.log
- sudo rm -rf /home/gitlab-runner/cnosdb
- echo "bench job Done"