-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
445 lines (383 loc) · 13.4 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
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
#############################################################################
# gitlab-runner:docker executor options
image: chapeiro/pelago-build:cuda11.3-llvm12
# - Add support for docker-in-docker tests / build processes
#############################################################################
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_DEPTH: "1"
#############################################################################
stages:
- Configure # Environment configuration
- Check Out # When extra steps are needed to checkout the sources
- Build Tools # When extra tools are required
- Package Build Tools # Build & upload build requirements to registry
- Builder Build Container # Builder image with proteus dependencies
- Build Libraries # When extra libraries are required
- Build # Build the project
- Install # Install the software so it can be run for tests
- Test # Functional tests
- Benchmark # Performance tests (need to be tagged in order to be
# run on a noise-free system)
- Package # Create archives to be installed
- Publish # Publish the packages
- Build Profile # Build the project with profiling information
- Profile # Profile using known workload
#############################################################################
# Helper Templates
before_script:
- cache_path=$(pwd | sed "s/^\/builds/\/cache/g")/${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHA}
- mkdir -p ${cache_path}/build ${cache_path}/opt
- ln -s ${cache_path}/build build
- ln -s ${cache_path}/opt opt
- cp -p ${cache_path}/.*done ./ || true
# TODO: we should probably remove the next lines and fix that in executor
- ln -s /data/ssbm100 src/executor/tests/inputs/ssbm100
- ln -s /data/tpch1 src/executor/tests/inputs/tpch1
after_script:
# we have to recalculate cache_path here
- cache_path=$(pwd | sed "s/^\/builds/\/cache/g")/${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHA}
- cp -p .*done ${cache_path}/ || true
#----------------------------------------------------------------------------
# Caching policies templates
# As we keep the build & install marker files, we need to make sure the
# corresponding binaries are kept as well. While this works for all the C/C++
# projects as we build them outside of the sources, SBT does assume its own
# folder layout, which starts in src/<projetc>. Thus we need to keep a cache
# of the src folder as well.
# FIXME: Can we configure SBT to store the generated files under build?
# FIXME: Can we configure SBT to install the generated JAR under opt?
# FIXME: What about npm?
.cache: &cache
tags:
- pelago
cache:
key: "${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHA}"
paths:
- src/panorama
- src/planner
- src/SQLPlanner
.cache: &cache_profile
cache:
key: "${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHA}-profile"
paths:
- src/panorama
- src/planner
- src/SQLPlanner
#----------------------------------------------------------------------------
# Execution restrictions templates
.restrict_precommit: &restrict_precommit
except:
- master
- tags
.restrict_postcommit: &restrict_postcommit
only:
- master
- tags
.restrict_latest: &restrict_latest
except:
- tags
only:
- master
.restrict_release: &restrict_release
only:
- tags
#----------------------------------------------------------------------------
# Job templates
.test: &test
stage: Test
cache:
policy: pull
<<: *cache
<<: *restrict_precommit
.benchmark: &benchmark
stage: Benchmark
cache:
policy: pull
<<: *cache
#############################################################################
# Example jobs
#----------------------------------------------------------------------------
# Workaround until we replace the docker image
.configure-packages:
stage: Configure
script:
- echo "Configure... done"
<<: *cache
<<: *restrict_precommit
# Check-out environment
.check-out-submodules:
stage: Check Out
script:
- echo "Check Out... done"
<<: *cache
<<: *restrict_precommit
#----------------------------------------------------------------------------
# Setup build environment
build-tools:
stage: Build Tools
script:
- ccache_dir=$(pwd | sed "s/^\/builds/\/cache/g")/.ccache
- git config --global user.name "Pelago CI"
- git config --global user.email ""
- CCACHE_DIR=${ccache_dir} ccache --zero-stats
- CCACHE_DIR=${ccache_dir} CCACHE_NOHASHDIR=1 CCACHE_BASEDIR=$(pwd) [email protected] make llvm &> llvm_build_log.txt || (tail -c 512k llvm_build_log.txt && exit 1)
- CCACHE_DIR=${ccache_dir} ccache --show-stats
- echo "Building tools... done"
<<: *cache
<<: *restrict_precommit
package-build-tools-llvm:
stage: Package Build Tools
script:
- ccache_dir=$(pwd | sed "s/^\/builds/\/cache/g")/.ccache
- CCACHE_DIR=${ccache_dir} ccache --zero-stats
- CCACHE_DIR=${ccache_dir} CCACHE_NOHASHDIR=1 CCACHE_BASEDIR=$(pwd) [email protected] make do-package-llvm
- CCACHE_DIR=${ccache_dir} ccache --show-stats
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/llvm-stage2/LLVM-14.0.0-Linux.deb "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/LLVM/14.0.0/LLVM-14.0.0-Linux.deb"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/llvm-stage2/LLVM-14.0.0-Linux.tar.xz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/LLVM/14.0.0/LLVM-14.0.0-Linux.tar.xz"'
<<: *cache
<<: *restrict_precommit
package-build-tools-cmake:
stage: Package Build Tools
script:
- ccache_dir=$(pwd | sed "s/^\/builds/\/cache/g")/.ccache
- CCACHE_DIR=${ccache_dir} ccache --zero-stats
- CCACHE_DIR=${ccache_dir} CCACHE_NOHASHDIR=1 CCACHE_BASEDIR=$(pwd) [email protected] make do-package-cmake
- CCACHE_DIR=${ccache_dir} ccache --show-stats
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/cmake/cmake-3.23.0-Linux-x86_64.deb "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/cmake/3.23.0/cmake-3.23.0-Linux-x86_64.deb"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/cmake/cmake-3.23.0-Linux-x86_64.tar.xz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/cmake/3.23.0/cmake-3.23.0-Linux-x86_64.tar.xz"'
<<: *cache
<<: *restrict_precommit
build-dependencies-container:
image: docker:19.03.12
stage: Builder Build Container
script:
- cp build/llvm-stage2/LLVM-14.0.0-Linux.deb src/executor/tools/docker/proteus-build/
- cp build/cmake/cmake-3.23.0-Linux-x86_64.deb src/executor/tools/docker/proteus-build/
# localhost as we use the parent docker
- cd src/executor/tools/docker/proteus-build && docker build -t localhost:5055/proteus/pelago-build:latest --build-arg LLVM_VERSION=14.0.0 --build-arg CMAKE_VERSION=3.23.0 .
- docker push localhost:5055/proteus/pelago-build:latest
<<: *cache
<<: *restrict_precommit
build-libraries:
stage: Build Libraries
script:
- make external-libs &> external_libs_build_log.txt || (tail -c 512k external_libs_build_log.txt && exit 1)
- echo "Building external libs... done"
<<: *cache
<<: *restrict_precommit
#----------------------------------------------------------------------------
# Setup test environment
build:
stage: Build
script:
- make
- echo "Building... done"
<<: *cache
<<: *restrict_precommit
.install:
stage: Install
script:
- echo "Installing... done"
<<: *cache
<<: *restrict_precommit
#----------------------------------------------------------------------------
# Functional Tests
1/10 test - Threads:
<<: *test
script:
- make &> check_installed.txt || (tail -c 512k check_installed.txt && exit 1) # make sure that everything is compiled
- export CWD=$(pwd)
- cd opt/pelago && ./unit-tests-threads --gtest_output="xml:$CWD/report-threads.xml" &> thread_test_log.txt || (tail -c 512k thread_test_log.txt && exit 1)
artifacts:
paths:
- report-*.xml
reports:
junit: report-*.xml
2/10 test - Plan Parsing:
<<: *test
script:
- make &> check_installed.txt || (tail -c 512k check_installed.txt && exit 1) # make sure that everything is compiled
- export CWD=$(pwd)
- cd opt/pelago && ./unit-tests-plan-parsing --gtest_output="xml:$CWD/report-plan-parsing.xml" &> plan_parsing_test_log.txt || (tail -c 512k plan_parsing_test_log.txt && exit 1)
allow_failure: true
artifacts:
paths:
- report-*.xml
reports:
junit: report-*.xml
3/10 test - JSON:
<<: *test
script:
- make &> check_installed.txt || (tail -c 512k check_installed.txt && exit 1) # make sure that everything is compiled
- export CWD=$(pwd)
- cd opt/pelago && ./unit-tests-json --gtest_output="xml:$CWD/report-json.xml" &> json_test_log.txt || (tail -c 512k json_test_log.txt && exit 1)
allow_failure: true
artifacts:
paths:
- report-*.xml
reports:
junit: report-*.xml
4/10 test - Joins:
<<: *test
script:
- make &> check_installed.txt || (tail -c 512k check_installed.txt && exit 1) # make sure that everything is compiled
- export CWD=$(pwd)
- cd opt/pelago && ./unit-tests-joins --gtest_output="xml:$CWD/report-joins.xml" &> joins_test_log.txt || (tail -c 512k joins_test_log.txt && exit 1)
allow_failure: true
artifacts:
paths:
- report-*.xml
reports:
junit: report-*.xml
5/10 test - Output:
<<: *test
script:
- make &> check_installed.txt || (tail -c 512k check_installed.txt && exit 1) # make sure that everything is compiled
- export CWD=$(pwd)
- cd opt/pelago && ./unit-tests-output --gtest_output="xml:$CWD/report-output.xml" &> output_test_log.txt || (tail -c 512k output_test_log.txt && exit 1)
allow_failure: true
artifacts:
paths:
- report-*.xml
reports:
junit: report-*.xml
6/10 test - GPU SSB SF100:
<<: *test
script:
- make &> check_installed.txt || (tail -c 512k check_installed.txt && exit 1) # make sure that everything is compiled
- export CWD=$(pwd)
- cd opt/pelago && ./unit-tests-gpu-ssb --gtest_output="xml:$CWD/report-gpu.xml" &> gpu_ssb_test_log.txt || (tail -c 512k gpu_ssb_test_log.txt && exit 1)
artifacts:
paths:
- report-*.xml
reports:
junit: report-*.xml
7/10 test - CPU SSB SF100:
<<: *test
script:
- make &> check_installed.txt || (tail -c 512k check_installed.txt && exit 1) # make sure that everything is compiled
- export CWD=$(pwd)
- cd opt/pelago && ./unit-tests-cpu-ssb --gtest_output="xml:$CWD/report-cpu.xml" &> cpu_ssb_test_log.txt || (tail -c 512k cpu_ssb_test_log.txt && exit 1)
artifacts:
paths:
- report-*.xml
reports:
junit: report-*.xml
8/10 test - Hybrid SSB SF100:
<<: *test
script:
- make &> check_installed.txt || (tail -c 512k check_installed.txt && exit 1) # make sure that everything is compiled
- export CWD=$(pwd)
- cd opt/pelago && ./unit-tests-hyb-ssb --gtest_output="xml:$CWD/report-hyb.xml" &> hyb_ssb_test_log.txt || (tail -c 512k hyb_ssb_test_log.txt && exit 1)
artifacts:
paths:
- report-*.xml
reports:
junit: report-*.xml
9/10 test - COW:
<<: *test
script:
- make &> check_installed.txt || (tail -c 512k check_installed.txt && exit 1) # make sure that everything is compiled
- export CWD=$(pwd)
- cd opt/pelago && ./unit-tests-cow --gtest_output="xml:$CWD/report-cow.xml" &> cow_test_log.txt || (tail -c 512k cow_test_log.txt && exit 1)
artifacts:
paths:
- report-*.xml
reports:
junit: report-*.xml
10/10 test - Planner:
<<: *test
script:
- ln -s opt/pelago/inputs build/executor/core/planner/CMakeFiles/planner.dir/inputs
- export CWD=$(pwd)
- export OUTPUT=0
- cd build/executor/core/planner/CMakeFiles/planner.dir && sbt test || export OUTPUT=1
- mv build/executor/core/planner/CMakeFiles/planner.dir/target/test-reports/TEST-*.xml $CWD
- rm build/executor/core/planner/CMakeFiles/planner.dir/inputs || true
- exit $OUTPUT
allow_failure: true
artifacts:
reports:
junit: TEST-*.xml
#----------------------------------------------------------------------------
# Performance Tests
# unhide the jobs by removing the leading '.'
.bench:
stage: Benchmark
script:
- echo "Bench... done"
<<: *cache
<<: *restrict_precommit
.1/2 benchmark:
<<: *benchmark
script:
- echo "Benchmark 2... done"
.2/2 benchmark:
<<: *benchmark
script:
- echo "Benchmark 2... done"
#----------------------------------------------------------------------------
# Execution Profiling
# unhide the jobs by removing the leading '.'
.build profile:
stage: Build Profile
script:
- echo "Building Dependencies... done"
- echo "Building... done"
- echo "Installing... done"
when: manual
<<: *cache_profile
<<: *restrict_precommit
.1/2 profile:
stage: Profile
script:
- echo "Running workload 1... done"
- echo "Extracting profiling statistics"
when: manual
cache:
policy: pull
<<: *cache_profile
<<: *restrict_precommit
.2/2 profile:
stage: Profile
script:
- echo "Running workload 2... done"
- echo "Extracting profiling statistics"
when: manual
cache:
policy: pull
<<: *cache_profile
<<: *restrict_precommit
#----------------------------------------------------------------------------
# Packaging & distribution
.tar:
stage: Package
script:
- echo "Generating tar... done"
<<: *cache
<<: *restrict_postcommit
.tar:latest:
stage: Publish
script:
- echo "Publishing HEAD... done"
artifacts:
name: "$CI_PROJECT_NAME-g$CI_COMMIT_SHA"
paths:
- pkg/
cache:
policy: pull
<<: *cache
<<: *restrict_latest
.tar:release:
stage: Publish
script:
- echo "Publishing release... done"
artifacts:
name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG"
paths:
- pkg/
cache:
policy: pull
<<: *cache
<<: *restrict_release