-
Notifications
You must be signed in to change notification settings - Fork 47
/
.gitlab-ci.viz.yml
153 lines (136 loc) · 5.45 KB
/
.gitlab-ci.viz.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
stages:
- test
- publish
include:
- project: viz/ci/gitlabpipelines
file: index.yml
ubuntu-clangformat-check:
stage: test
image:
name: ubuntu:22.04
entrypoint: [""]
script:
- apt update && apt install -y git clang-format-15
- cd $CI_PROJECT_DIR
- CLANG_FORMAT_EXTENSIONS="\.[cmh]$|\.[chi]pp$"
- if [ -f .clang-format ]; then
- if find . | grep -E "$CLANG_FORMAT_EXTENSIONS" | xargs -n1 clang-format-15 -style=file -fallback-style=none -output-replacements-xml | grep "<replacement " >/dev/null ; then
- echo "clang-format check failed - commit does not match coding style"
- find . | grep -E "$CLANG_FORMAT_EXTENSIONS" | xargs -n1 clang-format-15 -i -style=file -fallback-style=none
- git diff
- exit 1
- else
- echo "clang-format check successful"
- fi
- fi
rules:
- if: $GITHUB_PULL_REQUEST_ID
.ubuntu-cpp-build:
extends: .cmake-ubuntu
stage: test
variables:
APT_PACKAGES: git libhdf5-serial-dev libtbb-dev pkg-config wget ca-certificates libssl-dev libwebsockets-dev libboost-all-dev zlib1g-dev libbz2-dev python3.9
CMAKE_ARGS: -DCMAKE_PREFIX_PATH=/app/dist -DBRAYNS_CIRCUITEXPLORER_ENABLED=ON -DBRAYNS_DTI_ENABLED=ON -DBRAYNS_ATLASEXPLORER_ENABLED=ON -DBRAYNS_CYLINDRICCAMERA_ENABLED=ON -DBRAYNS_MOLECULEEXPLORER_ENABLED=ON -DPython3_EXECUTABLE=/usr/bin/python3.9 -DISPC_EXECUTABLE=/app/ispc-v1.18.0-linux/bin/ispc
KUBERNETES_CPU_LIMIT: 5
KUBERNETES_CPU_REQUEST: 5
KUBERNETES_MEMORY_LIMIT: 8Gi
KUBERNETES_MEMORY_REQUEST: 8Gi
NUM_COMPILE_JOBS: 5
DIST_PATH: /app/dist
before_script:
- apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y $APT_BASE_PACKAGES $APT_PACKAGES
# Install ISPC
- ISPC_VERSION=1.18.0
- ISPC_DIR=ispc-v${ISPC_VERSION}-linux
- ISPC_PATH=/app/ispc-v1.18.0-linux
- export PATH=$PATH:${ISPC_PATH}
- mkdir -p ${ISPC_PATH}
- wget https://github.com/ispc/ispc/releases/download/v${ISPC_VERSION}/${ISPC_DIR}.tar.gz
- tar zxvf ${ISPC_DIR}.tar.gz -C ${ISPC_PATH} --strip-components=1
- rm -rf ${ISPC_PATH}/${ISPC_DIR}/examples
- mkdir -p ${DIST_PATH}
# Install One TBB
- ONETBB_VERSION=2021.5.0
- ONETBB_FILE=oneapi-tbb-${ONETBB_VERSION}-lin.tgz
- wget https://github.com/oneapi-src/oneTBB/releases/download/v${ONETBB_VERSION}/${ONETBB_FILE}
- tar zxvf ${ONETBB_FILE} -C ${DIST_PATH} --strip-components=1
# Install embree
# https://github.com/embree/embree/releases
- EMBREE_VERSION=3.13.3
- EMBREE_FILE=embree-${EMBREE_VERSION}.x86_64.linux.tar.gz
- wget https://github.com/embree/embree/releases/download/v${EMBREE_VERSION}/${EMBREE_FILE}
- tar zxvf ${EMBREE_FILE} -C ${DIST_PATH} --strip-components=1
- rm -rf ${DIST_PATH}/bin ${DIST_PATH}/doc
# Install rk common
- RKCOMMON_VERSION=v1.10.0
- git clone https://github.com/ospray/rkcommon
- pushd rkcommon
- git checkout ${RKCOMMON_VERSION}
- mkdir build
- pushd build
- cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${DIST_PATH} -DCMAKE_INSTALL_PREFIX=${DIST_PATH}
- ninja -j$NUM_COMPILE_JOBS install
- popd
- popd
# Install open vkl
- OPENVKL_VERSION=v1.3.0
- git clone https://github.com/openvkl/openvkl
- pushd openvkl
- git checkout ${OPENVKL_VERSION}
- mkdir build
- pushd build
- cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${DIST_PATH} -DCMAKE_INSTALL_PREFIX=${DIST_PATH} -DBUILD_EXAMPLES=OFF -DISPC_EXECUTABLE=${ISPC_PATH}/bin/ispc
- ninja -j$NUM_COMPILE_JOBS install
- popd
- popd
# Install OSPRay
# https://github.com/ospray/ospray/releases
- OSPRAY_TAG=v2.10.5
- OSPRAY_SRC=/app/ospray
- mkdir -p ${OSPRAY_SRC}
- git clone https://github.com/BlueBrain/ospray.git ${OSPRAY_SRC}
- pushd ${OSPRAY_SRC}
- git checkout ${OSPRAY_TAG}
- mkdir -p build
- pushd build
- CMAKE_PREFIX_PATH=${DIST_PATH} cmake .. -GNinja -DOSPRAY_ENABLE_APPS_TUTORIALS=OFF -DOSPRAY_ENABLE_APPS_BENCHMARK=OFF -DOSPRAY_ENABLE_APPS_EXAMPLES=OFF -DOSPRAY_ENABLE_APPS_TESTING=OFF -DOSPRAY_APPS_ENABLE_GLM=OFF -DOSPRAY_MODULE_DENOISER=OFF -DCMAKE_INSTALL_PREFIX=${DIST_PATH} -DISPC_EXECUTABLE=${ISPC_PATH}/bin/ispc
- ninja -j$NUM_COMPILE_JOBS install
- popd
- popd
- cd $CI_PROJECT_DIR
rules:
- if: $GITHUB_PULL_REQUEST_ID
ubuntu-cpp-release-build:
extends: .ubuntu-cpp-build
stage: test
variables:
CMAKE_BUILD_TYPE: Release
ubuntu-cpp-debug-build:
extends: .ubuntu-cpp-build
stage: test
variables:
CMAKE_BUILD_TYPE: Debug
docker-build:
variables:
KUBERNETES_CPU_LIMIT: 4
KUBERNETES_CPU_REQUEST: 4
KUBERNETES_MEMORY_LIMIT: 8Gi
KUBERNETES_MEMORY_REQUEST: 8Gi
extends: .build-image-using-kaniko
before_script:
# We need to overwrite CI_REGISTRY variable so it does not point to CI/CD variable:
# "https://index.docker.io/v1/". Otherwise we run into 401 Unauthorized as
# CI_REGISTRY_PASSWORD is a protected variable i.e. not available for regular CI jobs.
# And as per https://gitlab.com/gitlab-org/gitlab-runner/-/issues/3555:
# we cannot overwrite predefined CI/CD variables in "variables" section, hence the hack
- export CI_REGISTRY=""
rules:
- if: $GITHUB_PULL_REQUEST_ID
docker-publish-to-dockerhub:
variables:
KUBERNETES_CPU_LIMIT: 4
KUBERNETES_CPU_REQUEST: 4
KUBERNETES_MEMORY_LIMIT: 8Gi
KUBERNETES_MEMORY_REQUEST: 8Gi
CI_REGISTRY_IMAGE: bluebrain/brayns
extends: .publish-image-using-kaniko