forked from mongodb/mongo-c-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.benchmark.yml
217 lines (185 loc) · 5.81 KB
/
.benchmark.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
#######################################
# C Benchmark Tests #
#######################################
#######################################
# Variables #
#######################################
c_driver_variables:
## Task list
benchmark_test_list: &benchmark_tests
- name: "BenchMarkTests"
## Common download urls (merge in as hashes)
mongo_download_url_prefixes:
mongo_v32: &mongo_v32
#mongo_url: "http://downloads.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-latest.tgz"
mongo_url: "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.2.10.tgz"
mongo_v24: &mongo_v24
mongo_url: "http://downloads.mongodb.org/linux/mongodb-linux-x86_64-2.4.14.tgz"
## Common sets of CFLAGS
cflags:
standard: &cflags_64
cflags: "-m64 -march=x86-64 -Werror"
standard_no_werror: &cflags_64_no_werror
cflags: "-m64 -march=x86-64"
## Extra $PATH entries
paths:
unix_path: &unix_path
extra_path:
## Scripts that are shared between buildvariants
scripts:
compile:
unix: &compile_unix
compile_script: |
set -o errexit
set -o verbose
./autogen.sh --prefix=`pwd`/mongoc
make -j8
make install
git clone https://github.com/mongodb/mongo-c-driver-performance.git
cd mongo-c-driver-performance
PKG_CONFIG_PATH=../mongoc/lib/pkgconfig /opt/cmake/bin/cmake .
#PKG_CONFIG_PATH=../mongoc/lib/pkgconfig cmake .
make
cd ..
mongodb:
start_mongod_command: &start_mongod_command
start_mongod: |
set -o errexit
set -o verbose
mkdir db
./mongodb/bin/mongod --dbpath `pwd`/db --logpath `pwd`/db/db.log --fork --logappend --smallfiles --oplogSize 50
benchmark_common: &benchmark_common
<<: *compile_unix
<<: *start_mongod_command
<<: *unix_path
#######################################
# Functions #
#######################################
functions:
"run benchmark tests" :
command: shell.exec
params:
working_dir: "mongo-c-driver"
script: |
set -o errexit
set -o verbose
result=-1 # Negative one.
# Run this function on exit.
done=false
finish () {
set +o errexit
if [ "$done" = false ]; then
# There was an error.
echo "something went wrong, killing mongod and exiting"
killall -9 mongod
fi
exit $result
}
trap finish EXIT
echo "Compiling the C driver and performance binaries"
${compile_script}
echo "Starting mongod"
${start_mongod}
sleep 15
echo "Running Benchmark tests "
start_time=$(date +%s)
# LD_LIBRARY_PATH=`pwd`/.libs:`pwd`/mongoc/lib:$LD_LIBRARY_PATH ./mongo-c-driver-performance/mongo-c-performance ./data TestFlatEncoding TestDeepEncoding
LD_LIBRARY_PATH=`pwd`/.libs:`pwd`/mongoc/lib:$LD_LIBRARY_PATH ./mongo-c-driver-performance/mongo-c-performance ./data
set +o errexit
result=$?
cat results.json
result=$?
end_time=$(date +%s)
elapsed_secs=$((end_time-start_time))
if [ $result -eq 0 ]; then
status='"pass"'
failures=0
else
status='"fail"'
failures=1
fi
echo "{\"failures\": $failures, \"results\": [{\"status\": $status, \"exit_code\": $result, \"test_file\": \"BenchMarkTests\", \"start\": $start_time, \"end\": $end_time, \"elapsed\": $elapsed_secs}]}" > report.json
cat report.json
set +o errexit
killall -9 mongod
done=true
exit $result
pre:
# Remove and recreate old directory
- command: shell.exec
params:
script: |
rm -rf mongo-c-driver
mkdir mongo-c-driver
# git checkout mongo-c-driver
- command: git.get_project
params:
directory: "mongo-c-driver"
- command: git.apply_patch
params:
directory: "mongo-c-driver"
# Fetch mongodb
- command: shell.exec
params:
working_dir: "mongo-c-driver"
script: |
set -o verbose
set -o errexit
#ls -la
curl -s ${mongo_url} --output mongo-archive.${ext|tgz}
${decompress} mongo-archive.${ext|tgz}
mv mongodb* mongodb
chmod +x ./mongodb/bin/mongod${extension}
# Fetch driver test data
- command: shell.exec
params:
working_dir: "mongo-c-driver"
script: |
set -o verbose
set -o errexit
#ls -la
curl https://s3.amazonaws.com/boxes.10gen.com/build/driver-test-data.tar.gz -o driver-test-data.tar.gz --silent --max-time 120
${decompress} driver-test-data.tar.gz
post:
- command: shell.exec
params:
script: |
echo "post-task run."
true
- command: attach.results
params:
file_location: mongo-c-driver/report.json
# Send perf dashboard data
- command: json.send
params:
name: perf
file: mongo-c-driver/results.json
#######################################
# Tasks #
#######################################
tasks:
- name: BenchMarkTests
commands:
- func: "run benchmark tests"
#######################################
# Buildvariants #
#######################################
buildvariants:
- name: ubuntu-1604-mongo24
display_name: "C Driver Mongo 2.4"
expansions:
<<: *cflags_64
<<: *mongo_v24
<<: *benchmark_common
run_on:
- ubuntu1604-test
tasks: *benchmark_tests
- name: ubuntu-1604-mongo32
display_name: "C Driver Mongo 3.2"
expansions:
<<: *cflags_64
<<: *mongo_v32
<<: *benchmark_common
run_on:
- ubuntu1604-test
tasks: *benchmark_tests