Newer
Older
###############################################################################
## Builds ##
###############################################################################
gcc_9_python:
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- _skbuild
- _skbuild/
- Python/venv
before_script:
- python3 -m venv --system-site-packages Python/venv
- source Python/venv/bin/activate
script:
- python3 setup.py install
###############################################################################
.gnu_build_template:
before_script:
- export CC=gcc
- export CXX=g++
- $CXX --version
- $CC --version
- cmake --version
- mpirun --version
- mkdir -p $CI_PROJECT_DIR/$BUILD_FOLDER
- cd $CI_PROJECT_DIR/$BUILD_FOLDER

Soeren Peters
committed
- cmake ..
-DBUILD_VF_CPU=ON
-DBUILD_VF_GPU=ON
###############################################################################
gcc_9:
extends: .gnu_build_template
###############################################################################
clang_10:
extends: .gnu_build_template
before_script:
- export CC=clang
- export CXX=clang++

Soeren Peters
committed
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
###############################################################################
gcc_9_rebuild:
stage: build
image: irmb/virtualfluids-deps-ubuntu20.04
tags:
- gpu
- linux
before_script:
- export CCACHE_BASEDIR=$CI_PROJECT_DIR
- export CCACHE_DIR=$CI_PROJECT_DIR/cache
- ccache -s
script:
- mkdir -p $CI_PROJECT_DIR/build
- cd $CI_PROJECT_DIR/build
- rm -r -f ./*
- cmake ..
-DBUILD_VF_CPU=ON
-DBUILD_VF_GPU=ON
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache
-DCMAKE_C_COMPILER_LAUNCHER=ccache
- make -j4 2>&1 | tee gcc_warnings.txt
- ccache -s
artifacts:
paths:
- build/gcc_warnings.txt
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- $CI_PROJECT_DIR/cache
###############################################################################
when: manual
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
tags:
- win
- gpu
variables:
CMAKE_GENERATOR: "Visual Studio 16 2019"
BUILD_CONFIGURATION: "Release"
BUILD_FOLDER: "build"
BUILD_VF_CPU: "ON"
BUILD_VF_GPU: "ON"
BUILD_VF_UNIT_TESTS: "ON"
# add cmake and MSBuild.exe to the path.
# This Needs to be adapted when moved to a new build machine.
before_script:
- git --version
- $env:Path += ";C:\Program Files\CMake\bin\"
- cmake --version
- $env:Path += ";C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"
- MSBuild.exe -version
script:
- cd $CI_PROJECT_DIR
- md -force $env:BUILD_FOLDER
- cd $env:BUILD_FOLDER
- cmake .. -DBUILD_VF_CPU=$env:BUILD_VF_CPU -DBUILD_VF_GPU=$env:BUILD_VF_GPU -DBUILD_VF_UNIT_TESTS=$env:BUILD_VF_UNIT_TESTS -G "$env:CMAKE_GENERATOR" ..
- MSBuild.exe VirtualFluids.sln /property:Configuration=$env:BUILD_CONFIGURATION /verbosity:minimal /maxcpucount:4
cache:

Soeren Peters
committed
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- $CI_PROJECT_DIR/$env:BUILD_FOLDER/
artifacts:
paths:
- $CI_PROJECT_DIR/$env:BUILD_FOLDER/
###############################################################################
build_singularity_image:
stage: build
rules:
- if: $CI_COMMIT_TAG
artifacts:
paths:
- Containers/VirtualFluidsOpenMPI.sif
script:
- singularity build Containers/VirtualFluidsOpenMPI.sif Containers/VirtualFluidsOpenMPI.def
- ls -sh Containers/VirtualFluidsOpenMPI.sif
###############################################################################
## Tests ##
###############################################################################
gcc_9_python_unit_tests:
- export VF_UNITTESTS=$(find _skbuild -name basicsTests)

Soeren Peters
committed
###############################################################################
before_script:
- cd $CI_PROJECT_DIR/build
script:

Soeren Peters
committed
###############################################################################
artifacts:
when: on_failure
paths:
- output/mq/mq10000/
- export PYTHONPATH="Python"
- source Python/venv/bin/activate
- python3 -m unittest discover -s Python -v
###############################################################################
## Benchmark ##
###############################################################################
nvidia_test:
stage: benchmark
needs: []
tags:
- gpu
- linux
script:
- echo NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES}
- nvidia-smi
gpu_numerical_tests:
stage: benchmark
image: irmb/virtualfluids-deps-ubuntu20.04
when: manual
needs: []
tags:
- gpu
- linux
before_script:
- mkdir /tmp && cd /tmp
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@git.rz.tu-bs.de/irmb/test_data.git
- ls -la test_data/
- export CCACHE_BASEDIR=$CI_PROJECT_DIR
- export CCACHE_DIR=$CI_PROJECT_DIR/cache
- ccache -s
- mkdir -p $CI_PROJECT_DIR/build
- cd $CI_PROJECT_DIR/build
- rm -r -f ./*
- cmake ..
-DPATH_NUMERICAL_TESTS=/tmp/test_data/numerical_tests_gpu/
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache
-DCMAKE_C_COMPILER_LAUNCHER=ccache
- make -j4
- ccache -s
script:
- cd $CI_PROJECT_DIR
- ls -la ./build/bin
- ./build/bin/NumericalTests $CI_PROJECT_DIR/apps/gpu/tests/NumericalTests/configK15_nu10tm2.txt 2>&1 | tee -a numerical_tests_gpu_results.txt
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- $CI_PROJECT_DIR/cache
artifacts:
paths:
- $CI_PROJECT_DIR/numerical_tests_gpu_results.txt
###############################################################################
###############################################################################
clang_build_analyzer_clang_10:
stage: analyze

Soeren Peters
committed
image: irmb/virtualfluids-deps-ubuntu20.04
before_script:
- export CC=clang
- export CXX=clang++
- $CXX --version
- cd /tmp
- git clone https://github.com/aras-p/ClangBuildAnalyzer.git
- cd ClangBuildAnalyzer
- cmake .
- make
- export PATH+=:$(pwd)
script:
- cd $CI_PROJECT_DIR/build

Soeren Peters
committed
- cmake ..
-DBUILD_VF_CPU=ON
-DBUILD_VF_GPU=ON
-DUSE_OPENMP=OFF
-DCMAKE_CXX_FLAGS=-ftime-trace
- ClangBuildAnalyzer --start .
- make
- ClangBuildAnalyzer --stop . CBA

Soeren Peters
committed
###############################################################################
include_what_you_use_clang_10:

Soeren Peters
committed
image: irmb/virtualfluids-deps-ubuntu20.04

Soeren Peters
committed
- export CC=clang
- export CXX=clang++
- $CXX --version
- cd /tmp
- git clone https://github.com/include-what-you-use/include-what-you-use.git
- cd include-what-you-use
- git checkout clang_10
- cmake . -DCMAKE_PREFIX_PATH=/usr/lib/llvm-10
- make
- export PATH+=:$(pwd)/bin
script:

Soeren Peters
committed
- cmake ..
-DBUILD_VF_CPU=ON
-DBUILD_VF_GPU=ON
-DUSE_OPENMP=OFF
-DBUILD_VF_INCLUDE_WHAT_YOU_USE=ON
- make

Soeren Peters
committed
###############################################################################

Soeren Peters
committed
image: irmb/virtualfluids-deps-ubuntu20.04
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
script:
- cd $CI_PROJECT_DIR
- cppcheck --version
- cppcheck src --enable=all --xml 2> cppcheck.xml
- cppcheck-htmlreport --file=cppcheck.xml --report-dir=html_report --source-dir=.

Soeren Peters
committed
###############################################################################
# lizard - Cyclomatic Complexity Analyzer
# Ignore warnings is manually set to 191. This job will fail when new warnings are added.

Soeren Peters
committed
image: irmb/virtualfluids-python-deps-ubuntu20.04
before_script:
- cd /tmp
- git clone https://github.com/terryyin/lizard.git
- cd lizard
- lizard --version
script:
- cd $CI_PROJECT_DIR
- lizard -l cpp src/ > lizard.txt --ignore_warnings 191

Soeren Peters
committed
###############################################################################

Soeren Peters
committed
image: irmb/virtualfluids-python-deps-ubuntu20.04
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
- pip3 install gcovr
- gcovr --version
script:

Soeren Peters
committed
- mkdir -p $CI_PROJECT_DIR/build
- cd $CI_PROJECT_DIR/build
- cmake ..
-DBUILD_VF_CPU=ON
-DBUILD_VF_GPU=ON
-DBUILD_VF_COVERAGE=ON
-DBUILD_VF_UNIT_TESTS=ON
- make -j4
- ./bin/basicsTests
- cd ..
- mkdir coverage

Soeren Peters
committed
- gcovr -r $CI_PROJECT_DIR -k build -f "src" --print-summary --html coverage/coverage.html --html-details --xml coverage/coverage.xml

Soeren Peters
committed
- build/

Soeren Peters
committed
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"

Soeren Peters
committed
- build

Soeren Peters
committed
###############################################################################

Soeren Peters
committed
# this job also produces a compile commands json file.

Soeren Peters
committed
image: irmb/virtualfluids-python-deps-ubuntu20.04
before_script:
- run-clang-tidy -h
script:

Soeren Peters
committed
- mkdir -p $CI_PROJECT_DIR/build
- cd $CI_PROJECT_DIR/build
- cmake ..
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DBUILD_VF_CPU=ON
-DBUILD_VF_GPU=OFF
- python3 ../utilities/filterCompileCommands.py compile_commands.json

Soeren Peters
committed
- build/clangtidy.txt
- build/compile_commands.json
###############################################################################
## Deploy ##
###############################################################################
stage: deploy
before_script:
- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
- apt-get install -y rsync
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- eval $(ssh-agent -s)
- echo "$SSH_KEY" | tr -d '\r' | ssh-add -
- echo $SSH_KEY >> ansible/private_key
- ssh-keyscan -t rsa $HOST >> ~/.ssh/known_hosts
variables:
SSH_KEY: ""
HOST: ""
###############################################################################
vf_to_phoenix:
extends: .deploy_template
stage: deploy
needs: ["gcc_9_python"]
when: manual
variables:
SSH_KEY: "$SSH_PRIVATE_KEY"
HOST: "phoenix.hlr.rz.tu-bs.de"
script:
- ansible-playbook -i ansible/hosts.cfg -u $REMOTE_USER ansible/playbook.yml
parallel:
matrix:
- ANSIBLE_MATRIX: 0
REMOTE_USER:
- y0054816

Soeren Peters
committed
###############################################################################
when: manual
variables:
SSH_KEY: "$SSH_PRIVATE_KEY_ELLADAN"
HOST: "elladan.irmb.bau.tu-bs.de"
- ansible-playbook -i ansible/hosts.cfg -u public_pages ansible/playbook_cppcheck.yml

Soeren Peters
committed
###############################################################################
when: manual
variables:
SSH_KEY: "$SSH_PRIVATE_KEY_ELLADAN"
HOST: "elladan.irmb.bau.tu-bs.de"
- ansible-playbook -i ansible/hosts.cfg -u public_pages ansible/playbook_gcov.yml

Soeren Peters
committed
###############################################################################
# the reports in this file needs to match the artifacts.
when: manual
SONAR_HOST_URL: "http://finrod.irmb.bau.tu-bs.de/sonarqube"
needs: ["cppcheck","clang-tidy","gcov_gcc_9","gcc_9_rebuild"]
before_script:
- cd /tmp
- apt-get install unzip
- wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.0.0.1744-linux.zip
- unzip sonar-scanner-cli-4.0.0.1744-linux.zip
- cd sonar-scanner-4.0.0.1744-linux/
- echo 'sonar.host.url=http://finrod.irmb.bau.tu-bs.de/sonarqube' >> conf/sonar-scanner.properties
- echo 'sonar.sourceEncoding=UTF-8' >> conf/sonar-scanner.properties
- cat conf/sonar-scanner.properties
- export PATH+=:$(pwd)/bin
- sonar-scanner -v
script:
- cd $CI_PROJECT_DIR
- sonar-scanner

Soeren Peters
committed
###############################################################################
## Release ##
###############################################################################
create_release:
image: registry.gitlab.com/gitlab-org/release-cli:latest
stage: release
needs: ["build_singularity_image"]
rules:
- if: $CI_COMMIT_TAG
script:
- echo "Creating release with tag $CI_COMMIT_TAG"
- release-cli create --name "VirtualFluids $CI_COMMIT_TAG" \
--description "VirtualFluids CFD Simulator" \
--tag-name "$CI_COMMIT_TAG" \
--ref "$CI_COMMIT_SHA" \
--job-token "$CI_JOB_TOKEN" \
--assets-link="{'name':'VirtualFluidsSingularityImage_OpenMPI','url':'','type':'other','filepath':'Containers/VirtualFluidsOpenMPI.sif'}"
- build/bin/basicsTests