.gitlab-ci.yml 16.8 KB
Newer Older
1
variables:
Markus Mirz's avatar
Markus Mirz committed
2
3
  GIT_STRATEGY: fetch
  GIT_SUBMODULE_STRATEGY: recursive
4
  RSYNC_OPTS: --recursive --ignore-missing-args --chown ${DEPLOY_USER}:${DEPLOY_USER}
5
6
7
  DOCKER_TAG: ${CI_COMMIT_REF_NAME}
  DOCKER_IMAGE: rwthacs/dpsim
  DOCKER_IMAGE_DEV: rwthacs/dpsim-dev
8

9

10
11
12
stages:
  - prepare
  - build
Markus Mirz's avatar
Markus Mirz committed
13
  - compile
Steffen Vogel's avatar
Steffen Vogel committed
14
  - test
Markus Mirz's avatar
fix ci    
Markus Mirz committed
15
  - generate
Markus Mirz's avatar
Markus Mirz committed
16
  - deploy
17

Markus Mirz's avatar
Markus Mirz committed
18
.docker-fedora-template: &docker-fedora-template
19
  stage: prepare
Markus Mirz's avatar
Markus Mirz committed
20
  image: docker:20.10
21
  needs: []
22
  script:
23
    - docker build
24
        --file Packaging/Docker/Dockerfile.dev
Markus Mirz's avatar
Markus Mirz committed
25
26
        ${TAGS}
        ${BUILD_ARGS} .
27
  tags:
Markus Mirz's avatar
Markus Mirz committed
28
    - docker
29

Markus Mirz's avatar
Markus Mirz committed
30
docker:fedora-cim:
Markus Mirz's avatar
Markus Mirz committed
31
32
  <<: *docker-fedora-template
  variables:
Markus Mirz's avatar
Markus Mirz committed
33
34
    TAGS:       --tag ${DOCKER_IMAGE_DEV}:${CI_COMMIT_REF_NAME}-cim
    BUILD_ARGS: --build-arg CIM_VERSION=IEC61970_16v29a
Markus Mirz's avatar
Markus Mirz committed
35
36
37
38

docker:fedora-cgmes:
  <<: *docker-fedora-template
  variables:
Markus Mirz's avatar
Markus Mirz committed
39
    TAGS:        --tag ${DOCKER_IMAGE_DEV}:${CI_COMMIT_REF_NAME}-cgmes --tag ${DOCKER_IMAGE_DEV}:latest
Markus Mirz's avatar
Markus Mirz committed
40
41
    BUILD_ARGS:  --build-arg CIM_VERSION=CGMES_2.4.15_16FEB2016

42
43
44
45
46
47
48
49
50
docker:centos:
  stage: prepare
  needs: []
  script:
    - docker build
        --file Packaging/Docker/Dockerfile.dev-centos
        --tag ${DOCKER_IMAGE_DEV}-centos:${DOCKER_TAG}
        --tag ${DOCKER_IMAGE_DEV}-centos:latest .
  tags:
Markus Mirz's avatar
Markus Mirz committed
51
    - docker
52

Markus Mirz's avatar
Markus Mirz committed
53
build:linux-cim:
54
  stage: build
Markus Mirz's avatar
Markus Mirz committed
55
  needs: ["docker:fedora-cim"]
56
57
58
  script:
    - mkdir -p build
    - cd build
Markus Mirz's avatar
Markus Mirz committed
59
    - cmake -DCIM_VERSION=IEC61970_16v29a ..
60
    - make -j 32
Markus Mirz's avatar
Markus Mirz committed
61
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}-cim
62
63
64
65
66
67
68
69
70
71
  cache:
    paths:
      - build
    key: build-linux
  artifacts:
    paths:
      - build
  tags:
    - docker

Markus Mirz's avatar
Markus Mirz committed
72
73
74
75
76
77
78
79
build:linux-cgmes:
  stage: build
  needs: ["docker:fedora-cgmes"]
  script:
    - mkdir -p build
    - cd build
    - cmake -DCIM_VERSION=CGMES_2.4.15_16FEB2016 ..
    - make -j 32
Markus Mirz's avatar
Markus Mirz committed
80
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}-cgmes
Markus Mirz's avatar
Markus Mirz committed
81
82
83
84
85
86
87
88
89
90
  cache:
    paths:
      - build
    key: build-linux-cgmes
  artifacts:
    paths:
      - build
  tags:
    - docker

Niklas Eiling's avatar
Niklas Eiling committed
91
92
93
94
95
96
build:linux-profiling:
  stage: build
  needs: ["docker:centos"]
  script:
    - mkdir -p build
    - cd build
Markus Mirz's avatar
Markus Mirz committed
97
    - cmake -DWITH_PROFILING=ON -DWITH_ASAN=ON -DWITH_CUDA=OFF -DWITH_SPDLOG_SUBMODULE=ON ..
Niklas Eiling's avatar
Niklas Eiling committed
98
99
    - make -j 32
  image: ${DOCKER_IMAGE_DEV}-centos:${DOCKER_TAG}
100
101
102
103
  cache:
       paths:
        - build
       key: build-linux-profiling
Niklas Eiling's avatar
Niklas Eiling committed
104
105
106
107
108
109
  artifacts:
    paths:
      - build
  tags:
    - docker

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
.build-solver-benchmark-template:
  stage: build
  needs: ["docker:centos"]
  image: ${DOCKER_IMAGE_DEV}-centos:${DOCKER_TAG}
  artifacts:
    paths:
      - build
  tags:
    - docker

build:solver-benchmark 1/3:
  extends: .build-solver-benchmark-template
  script:
    - mkdir -p build
    - cd build
    - cmake -DWITH_CUDA=OFF -DWITH_SPARSE=OFF -DWITH_SPDLOG_SUBMODULE=ON ..
    - make -j $(nproc) WSCC_9bus_mult_coupled
  cache:
    paths:
      - build
    key: build-solver-benchmark-dense-cpu

build:solver-benchmark 2/3:
  extends: .build-solver-benchmark-template
  script:
    - mkdir -p build
    - cd build
    - cmake -DWITH_CUDA=ON -DWITH_SPARSE=OFF -DWITH_SPDLOG_SUBMODULE=ON ..
    - make -j $(nproc) WSCC_9bus_mult_coupled
  cache:
    paths:
      - build
    key: build-solver-benchmark-dense-gpu
  
build:solver-benchmark 3/3:
  extends: .build-solver-benchmark-template
  script:
    - mkdir -p build
    - cd build
    - cmake -DWITH_CUDA=OFF -DWITH_SPARSE=ON -DWITH_SPDLOG_SUBMODULE=ON ..
    - make -j $(nproc) WSCC_9bus_mult_coupled
  cache:
    paths:
      - build
    key: build-solver-benchmark-sparse-cpu

156
build:linux-cuda:
Markus Mirz's avatar
Markus Mirz committed
157
  stage: build
158
  needs: ["docker:centos"]
159
  script:
160
    - mkdir -p build
Markus Mirz's avatar
Markus Mirz committed
161
    - cd build
162
    - cmake -DWITH_SPDLOG_SUBMODULE=ON ..
Steffen Vogel's avatar
Steffen Vogel committed
163
    - make -j 32
164
165
166
167
168
  image: ${DOCKER_IMAGE_DEV}-centos:${DOCKER_TAG}
  cache:
    paths:
      - build
    key: build-linux-cuda
169
170
  artifacts:
    paths:
171
     - build
172
  tags:
Georg Martin Reinke's avatar
Georg Martin Reinke committed
173
174
    - docker

Markus Mirz's avatar
Markus Mirz committed
175
176
177
178
179
180
181
182
183
184
185
186
187
188
#build:windows:
#  stage: build
#  needs: []
#  script:
#    - New-Item -ItemType Directory -Force -Path build
#    - Set-Location -Path build
#    - cmake ..
#    - cmake --build . -j 24
#  tags:
#    - win10
#  cache:
#    paths:
#      - build
#    key: build-win10
Steffen Vogel's avatar
Steffen Vogel committed
189

Markus Mirz's avatar
Markus Mirz committed
190
191
192
193
194
195
196
197
198
199
200
201
202
203
build:docker:
  stage: build
  needs: []
  script:
    - docker build
        --file Packaging/Docker/Dockerfile
        --build-arg DOCKER_TAG=${DOCKER_TAG}
        --build-arg CI=1
        --build-arg CI_COMMIT_SHA=${CI_COMMIT_SHA}
        --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME}
        --build-arg CI_COMMIT_TAG=${CI_COMMIT_TAG}
        --tag ${DOCKER_IMAGE}:${DOCKER_TAG}
        --tag ${DOCKER_IMAGE}:latest .
  tags:
Markus Mirz's avatar
Markus Mirz committed
204
    - docker
Markus Mirz's avatar
Markus Mirz committed
205
206
207
  only:
    - tags

Markus Mirz's avatar
Markus Mirz committed
208
209
210
211
212
213
214
#build:macos:
#  stage: build
#  script:
#    - mkdir -p build
#    - cd build
#    - cmake -DCMAKE_C_COMPILER=/usr/local/bin/gcc-9
#            -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-9
Markus Mirz's avatar
Markus Mirz committed
215
#            -DWITH_CIM_SUBMODULE=ON
Markus Mirz's avatar
Markus Mirz committed
216
217
218
219
220
221
222
223
224
225
226
#            -DWITH_SUNDIALS=OFF ..
#    - make -j $(sysctl -n hw.ncpu)
#  cache:
#    paths:
#      - build
#    key: build-macos
#  artifacts:
#    paths:
#      - build
#  tags:
#    - mac
Steffen Vogel's avatar
Steffen Vogel committed
227

Markus Mirz's avatar
Markus Mirz committed
228
229
230
231
232
233
234
235
236
237
238
239
240
#test:pytest:
#  stage: test
#  variables:
#    PYTHONPATH: "build/Source/Python:Source/Python"
#  script:
#    - pytest -v Examples/CIM/test_CIM.yml
#    - pytest -v Examples/Cxx/test_Circuits.yml
#    - pytest -v Examples/Cxx/test_RealTime.yml
#    #- pytest -v Examples/Cxx/test_Shmem.yml
#    - pytest -v Examples/Python/Base
#    - pytest -v Examples/Python/Circuits
#    - pytest -v Examples/Python/RealTime
#    #- pytest -v Examples/Python/Shmem
Markus Mirz's avatar
Markus Mirz committed
241
#  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
Markus Mirz's avatar
Markus Mirz committed
242
243
244
245
#  dependencies:
#    - build:linux
#  tags:
#    - docker
Steffen Vogel's avatar
Steffen Vogel committed
246

247
248
249
##############################################################################
# Stage test
##############################################################################
Steffen Vogel's avatar
Steffen Vogel committed
250

251
test:jupyter:
252
  stage: test
Markus Mirz's avatar
Markus Mirz committed
253
  needs: ["build:linux-cim"]
254
255
256
257
258
  variables:
    PYTHONPATH: "build/Source/Python:Source/Python"
  script:
    - pytest -v Examples/Notebooks
  dependencies:
Markus Mirz's avatar
Markus Mirz committed
259
260
    - build:linux-cim
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}-cim
Markus Mirz's avatar
Markus Mirz committed
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
  tags:
    - docker
  artifacts:
    paths:
      - outputs/Examples/Notebooks/

test:jupyter-cgmes:
  stage: test
  needs: ["build:linux-cgmes"]
  variables:
    PYTHONPATH: "build/Source/Python:Source/Python"
  script:
    - pytest -v Examples/Notebooks
  dependencies:
    - build:linux-cgmes
Markus Mirz's avatar
Markus Mirz committed
276
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}-cgmes
277
278
279
280
281
  tags:
    - docker
  artifacts:
    paths:
      - outputs/Examples/Notebooks/
Steffen Vogel's avatar
Steffen Vogel committed
282

Niklas Eiling's avatar
Niklas Eiling committed
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
test:cppcheck 1/2:
  stage: test
  needs: ["docker:centos"]
  script:
    - cppcheck --max-configs=32 -j 32 --error-exitcode=1 -q --std=c++11 -I Include/ -I models/Include/ Source/ Examples/ models/Source/ | tee cppcheck-error.log
  image: ${DOCKER_IMAGE_DEV}-centos:${DOCKER_TAG}
  dependencies:
    - docker:centos
  tags:
    - docker
  artifacts:
    when: on_failure
    paths:
      - cppcheck-error.log
    expose_as: 'cppcheck-error'

test:cppcheck 2/2:
  stage: test
  needs: ["docker:centos"]
  allow_failure: true
  script:
    - cppcheck --max-configs=32 -j 32 --error-exitcode=1 -q --enable=warning,performance,portability,information,missingInclude --std=c++11 -I Include/ -I models/Include/ Source/ Examples/ models/Source/ | tee cppcheck-warn.log
  image: ${DOCKER_IMAGE_DEV}-centos:${DOCKER_TAG}
  dependencies:
    - docker:centos
  tags:
    - docker
  artifacts:
    when: on_failure
    paths:
      - cppcheck-warn.log
    expose_as: 'cppcheck-warn'

.test-examples:
  stage: test
  needs: ["build:linux-profiling"]
  script:
    - $TEST_BINARY_PATH/$TEST_BINARY $TEST_PARAM 2>&1 | tee output.log
    - cat output.log |
      sed -n -E -e 's/^.*Average step time. ([0-9]+\.[0-9]+)$/step-time \1/p' |
      tee -a metrics.txt
    - gprof $TEST_BINARY_PATH/$TEST_BINARY | gprof2dot -s | dot -Tpng -o profiling.png || true
  image: ${DOCKER_IMAGE_DEV}-centos:${DOCKER_TAG}
  dependencies:
    - build:linux-profiling
  tags:
    - docker
  artifacts:
    reports:
        metrics: metrics.txt
    paths:
      - profiling.png
    expose_as: 'test-examples'

337
test:examples 1/2:
Niklas Eiling's avatar
Niklas Eiling committed
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
    extends: .test-examples
    variables:
# Name of the test binary
      TEST_BINARY: 'WSCC_9bus_mult_decoupled'
# Path where the test binary is located
      TEST_BINARY_PATH: 'build/Examples/Cxx'
# Command line parameters for the test binary
      TEST_PARAM: ''

test:examples 2/2:
    extends: .test-examples
    variables:
# Name of the test binary
      TEST_BINARY: 'WSCC_9bus_mult_coupled'
# Path where the test binary is located
      TEST_BINARY_PATH: 'build/Examples/Cxx'
# Command line parameters for the test binary
      TEST_PARAM: ''

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
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465

.benchmark-script: &benchmark-script |
    for ((copies=0;copies<=$TEST_NUM_COPIES;copies++))
    do
      echo "Running with $copies copies"
      $TEST_BINARY_PATH/$TEST_BINARY $TEST_PARAM -o copies=$copies 2>&1 | tee output.log
      cat output.log |
      sed -n -E -e 's/^.*Average step time. ([0-9]+\.[0-9]+)$/\1/p' |
      tee -a ${METRICS_ID}-metrics.txt
    done

.benchmark-step-times:
  stage: test
  script:
    - *benchmark-script
  image: ${DOCKER_IMAGE_DEV}-centos:${DOCKER_TAG}
  tags:
    - docker

test:solver-benchmark 1/3:
    extends: .benchmark-step-times
    needs: ["build:solver-benchmark 1/3"]
    dependencies:
      - build:solver-benchmark 1/3
    variables:
# Metrics-filename
      METRICS_ID: 'cpu-dense'
# Name of the test binary
      TEST_BINARY: 'WSCC_9bus_mult_coupled'
# Path where the test binary is located
      TEST_BINARY_PATH: 'build/Examples/Cxx'
# Up to how many copies should be benchmarked (WSCC_9bus - Example)
      TEST_NUM_COPIES: 6
    artifacts:
      reports:
          metrics: cpu-dense-metrics.txt
      paths:
        - cpu-dense-metrics.txt
      expose_as: 'step-times-benchmark'

test:solver-benchmark 2/3:
    extends: .remote-gpu
    needs: ["build:solver-benchmark 2/3"]
    dependencies:
      - build:solver-benchmark 2/3
    variables:
# Metrics-filename
      METRICS_ID: 'gpu-dense'
# Name of the test binary
      TEST_BINARY: 'WSCC_9bus_mult_coupled'
# Path where the test binary is located
      TEST_BINARY_PATH: 'build/Examples/Cxx'
# Up to how many copies should be benchmarked (WSCC_9bus - Example)
      TEST_NUM_COPIES: 6
    artifacts:
      reports:
          metrics: gpu-dense-metrics.txt
      paths:
        - gpu-dense-metrics.txt
      expose_as: 'step-times-benchmark'

test:solver-benchmark 3/3:
    extends: .benchmark-step-times
    needs: ["build:solver-benchmark 3/3"]
    dependencies:
      - build:solver-benchmark 3/3
    variables:
# Metrics-filename
      METRICS_ID: 'cpu-sparse'
# Name of the test binary
      TEST_BINARY: 'WSCC_9bus_mult_coupled'
# Path where the test binary is located
      TEST_BINARY_PATH: 'build/Examples/Cxx'
# Up to how many copies should be benchmarked (WSCC_9bus - Example)
      TEST_NUM_COPIES: 6
    artifacts:
      reports:
          metrics: cpu-sparse-metrics.txt
      paths:
        - cpu-sparse-metrics.txt
      expose_as: 'step-times-benchmark'

.gpu-init-script: &gpu-init-script |
    mkdir ~/.ssh &&
      echo "-----BEGIN OPENSSH PRIVATE KEY-----" > ~/.ssh/id_rsa &&
      echo $SSH_PRIVATE | sed "s/\S\{64\}/&\n/g" >> ~/.ssh/id_rsa &&
      echo "-----END OPENSSH PRIVATE KEY-----" >> ~/.ssh/id_rsa &&
      echo $SSH_PUBLIC > ~/.ssh/id_rsa.pub &&
      echo $KNOWN_HOSTS > ~/.ssh/known_hosts && chmod 600 ~/.ssh/id_rsa
    echo "$TEST_BINARY_PATH/$TEST_BINARY $TEST_FILES" | tr -d '\n' | xargs -r -d " " -I % cp % $LDIR
    ldd $LDIR/$TEST_BINARY |
      sed -n -E -e 's/^\s+\S+ => (\S+) \S+$/\1/p' |
      grep -Ev "$(echo $REMOTE_LIBS | tr ' ' '|')|not" |
      xargs -I % cp % $LDIR/
    ssh $GPU_TARGET mkdir -p $RDIR
    scp -r $LDIR/* $GPU_TARGET:$RDIR/

.gpu-run-script: &gpu-run-script |
    for ((copies=0;copies<=$TEST_NUM_COPIES;copies++))
    do
      ssh $GPU_TARGET "LD_LIBRARY_PATH=$RDIR:${LD_LIBRARY_PATH} LD_PRELOAD=$RDIR/cricket-server.so $RDIR/$TEST_BINARY" &
      sleep 2
      echo "Running with $copies copies"
      PATH=$LDIR:${PATH} LD_PRELOAD=$LDIR/cricket-client.so $TEST_BINARY_PATH/$TEST_BINARY $TEST_PARAM -o copies=$copies 2>&1 | tee output.log
      cat output.log |
      sed -n -E -e 's/^.*Average step time. ([0-9]+\.[0-9]+)$/\1/p' |
      tee -a ${METRICS_ID}-metrics.txt
    done

466
467
468
469
470
471
472
473
.remote-gpu:
  stage: test
  variables:
    GPU_TARGET: 'gitlab-runner@ghost'
    RDIR: '/tmp/gitlab-jobs/$CI_PROJECT_NAME/$CI_JOB_ID'
    CI_DIR: '$CI_BUILDS_DIR/$CI_PROJECT_PATH'
    LDIR: '/cricket/bin'
    TEST_FILES: ''
474
475
476
477
478
479
480
481
482
483
484
485
486
    TEST_PARAM: ''
    REMOTE_LIBS: 'linux-vdso.so.1
                  librt.so.1
                  libdl.so.2
                  libcudart.so.10.2
                  libcusolver.so.10
                  libstdc\+\+.so.6
                  libm.so.6
                  libgcc_s.so.1
                  libc.so.6
                  /lib64/ld-linux-x86-64.so.2
                  libutil.so.1
                  libpthread.so.0'
487
  script:
488
489
    - *gpu-init-script
    - *gpu-run-script
490
  after_script:
491
    - ssh $GPU_TARGET rm -rf $RDIR
492
    - ssh $GPU_TARGET pkill -fe -2 $RDIR/$TEST_BINARY
493
  image: ${DOCKER_IMAGE_DEV}-centos:${DOCKER_TAG}
494
495
496
  tags:
    - docker

Niklas Eiling's avatar
Niklas Eiling committed
497
test:cuda 1/2:
498
    extends: .remote-gpu
499
500
501
    needs: ["build:linux-cuda"]
    dependencies:
    - build:linux-cuda
502
    allow_failure: true
503
    variables:
504
505
# Metrics-filename
      METRICS_ID: 'cuda'
506
# Name of the test binary
507
      TEST_BINARY: 'WSCC_9bus_mult_decoupled'
508
# Path where the test binary is located
509
      TEST_BINARY_PATH: 'build/Examples/Cxx'
510
511
512
513
# Additional files that are necessary to run the application on the GPU node
      TEST_FILE: ''
# Command line parameters for the test binary
      TEST_PARAM: ''
514
515
516
517
518
519
520
521
# Up to how many copies should be benchmarked (WSCC_9bus - Example)
      TEST_NUM_COPIES: 0
    artifacts:
      reports:
          metrics: cuda-metrics.txt
      paths:
        - cuda-metrics.txt
      expose_as: 'step-times-benchmark'
522

Niklas Eiling's avatar
Niklas Eiling committed
523
524
test:cuda 2/2:
    extends: .remote-gpu
525
526
527
    needs: ["build:linux-cuda"]
    dependencies:
    - build:linux-cuda
Niklas Eiling's avatar
Niklas Eiling committed
528
529
    allow_failure: true
    variables:
530
531
# Metrics-filename
      METRICS_ID: 'cuda'
Niklas Eiling's avatar
Niklas Eiling committed
532
533
534
535
536
537
538
539
# Name of the test binary
      TEST_BINARY: 'WSCC_9bus_mult_coupled'
# Path where the test binary is located
      TEST_BINARY_PATH: 'build/Examples/Cxx'
# Additional files that are necessary to run the application on the GPU node
      TEST_FILE: ''
# Command line parameters for the test binary
      TEST_PARAM: ''
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
# Up to how many copies should be benchmarked (WSCC_9bus - Example)
      TEST_NUM_COPIES: 0
    artifacts:
      reports:
          metrics: cuda-metrics.txt
      paths:
        - cuda-metrics.txt
      expose_as: 'step-times-benchmark'


##############################################################################
# Stage generate
##############################################################################

generate:docs:
  stage: generate
Markus Mirz's avatar
Markus Mirz committed
556
  needs: ["build:linux-cgmes"]
557
558
559
  script:
    - make -j$(nproc) -C build docs
    - make -j$(nproc) -C build docs_cxx
Markus Mirz's avatar
Markus Mirz committed
560
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}-cgmes
561
  dependencies:
Markus Mirz's avatar
Markus Mirz committed
562
    - build:linux-cgmes
563
564
565
566
567
568
569
570
571
  artifacts:
    paths:
      - build/docs/sphinx/html
      - build/docs/doxygen/html
  tags:
    - docker

generate:packages:
  stage: generate
Markus Mirz's avatar
Markus Mirz committed
572
  needs: ["build:linux-cgmes"]
573
574
575
576
577
578
  script:
    - make -j$(nproc) -C build package
  only:
    - tags
  tags:
    - docker
Markus Mirz's avatar
Markus Mirz committed
579
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}-cgmes
580
  dependencies:
Markus Mirz's avatar
Markus Mirz committed
581
    - build:linux-cgmes
582
583
584
585
  artifacts:
    paths:
      - build/*.rpm
      - build/*.tar.gz
Niklas Eiling's avatar
Niklas Eiling committed
586

587
588
589
590
591
592
generate:metrics:
  stage: generate
  needs: ["test:solver-benchmark 1/3", "test:solver-benchmark 2/3", "test:solver-benchmark 3/3"]
  script:
    - echo "set terminal svg size 800, 500; set output 'metrics.svg'; set title 'Speed of different Solver-Configurations'; set style data lines; set key outside; set xlabel \"Copies (WSCC-9bus Example)\"; set ylabel \"Average steptime (µs)\"; set xtics 1; set xtics nomirror; set ytics nomirror; set grid; plot \"cpu-dense-metrics.txt\" using (\$1 * 1000000) title \"Solving with CPU and dense matrices\", \"gpu-dense-metrics.txt\" using (\$1 * 1000000) title \"Solving with GPU and dense matrices\", \"cpu-sparse-metrics.txt\" using (\$1 * 1000000) title \"Solving with CPU and sparse matrices\"" > script.p
    - gnuplot script.p
593
  image: ${DOCKER_IMAGE_DEV}-centos:${DOCKER_TAG}
594
595
596
597
598
599
600
601
602
603
604
  artifacts:
    reports:
      metrics: metrics.svg
    paths:
      - metrics.svg
    expose_as: 'WSCC-9bus-benchmark'
  tags:
    - docker


##############################################################################
Markus Mirz's avatar
Markus Mirz committed
605
606
# Stage deploy
##############################################################################
607

608
pages:
Markus Mirz's avatar
Markus Mirz committed
609
  stage: deploy
610
  needs: ["generate:docs"]
Markus Mirz's avatar
Markus Mirz committed
611
  script:
Markus Mirz's avatar
Markus Mirz committed
612
613
    - cp -r build/docs/sphinx/html/. public/sphinx
    - cp -r build/docs/doxygen/html/. public/doxygen
Markus Mirz's avatar
Markus Mirz committed
614
615
616
617
618
619
  artifacts:
    paths:
      - public
  dependencies:
    - generate:docs
  only:
620
    - deploy
Markus Mirz's avatar
Markus Mirz committed
621
  tags:
Markus Mirz's avatar
Markus Mirz committed
622
    - docker
Markus Mirz's avatar
Markus Mirz committed
623

624
deploy:docker:
625
626
  stage: deploy
  script:
Markus Mirz's avatar
Markus Mirz committed
627
    - docker push ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}-cgmes
628
    - docker push ${DOCKER_IMAGE_DEV}:latest
Markus Mirz's avatar
Markus Mirz committed
629
    - docker push ${DOCKER_IMAGE}:${DOCKER_TAG}-cgmes
630
    - docker push ${DOCKER_IMAGE}:latest
631
632
633
  dependencies:
    - build:docker
  tags:
Markus Mirz's avatar
Markus Mirz committed
634
    - docker
Steffen Vogel's avatar
Steffen Vogel committed
635
  only:
636
    - tags