-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yml
419 lines (402 loc) · 15.1 KB
/
docker-compose.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
#
# Usage:
# ------
#
# This docker compose file parameterizes build configurations using environment
# variables from the host. The default values for the build configuration
# variables are set in `.env`.
#
# Variables:
# ARCH={amd64, arm64v8, ...}
# COMPILER_TYPE={gnu, clang, intel, nvidia}
# COMPILER={gcc-8, gcc-9, gcc-10,
# clang-8, clang-9, clang-10,
# icpc, icpx,
# nvcc-11, nvcc-11.2}
# REPO=lifflander1/vt
# UBUNTU={18.04, 20.04, 22.04}
# ULIMIT_CORE=0
#
# DARMA/vt Configuration Variables:
# VT_LB=1 # Enable load balancing
# VT_TRACE=0 # Enable tracing
# VT_MIMALLOC=0 # Enable mimalloc memory allocator
# VT_DOCS=0 # Enable doxygen build
# VT_TRACE_RT=0 # Enable tracing at runtime (for testing)
# VT_ASAN=0 # Enable address sanitizer
# VT_UBSAN=0 # Enable undefined behavior sanitizer
# VT_WERROR=1 # Treat all warnings as errors
# VT_EXTENDED_TESTS=1 # Build all the extended testing
# VT_ZOLTAN=0 # Build with Zoltan enabled
# VT_UNITY_BUILD=0 # Build with Unity/Jumbo mode enabled
# VT_PRODUCTION_BUILD=0 # Disable assertions and debug prints
# VT_FCONTEXT=0 # Force use of fcontext for threading
# VT_DIAGNOSTICS=1 # Build with diagnostics enabled
# VT_DIAGNOSTICS_RUNTIME=0 # Enable diagnostics collection at runtime by default
# BUILD_TYPE=release # CMake build type
# VT_CODE_COVERAGE=0 # Enable generation of code coverage reports
# VT_DEBUG_VERBOSE=0 # Enable verbose debug prints at compile-time
# VT_NO_COLOR_ENABLED=0 # Set --vt_no_color flag to true by default
# VT_BUILD_SHARED_LIBS=0 # Build VT as shared library
#
# In order to run in the container, there are two stages. First, one must build
# or pull the base container with the variables exported (or using the defaults
# in `vt/.env` that configure it:
#
# For instance, if you want an interactive intel build with icpx that enables
# VT tracing, run the following commands:
#
# $ export COMPILER_TYPE=intel
# $ export COMPILER=icpx
# $ export HOST_COMPILER=icpx
# $ export VT_TRACE=1
# $ docker compose pull ubuntu-cpp-interactive
# $ docker compose run ubuntu-cpp-interactive
# # /vt/ci/build_cpp.sh /vt /build
#
# For a non-interactive build with gcc-8, since gnu is the default compiler
# type, one may do the following:
#
# $ COMPILER=gcc-8 docker compose pull ubuntu-cpp
# $ COMPILER=gcc-8 docker compose run ubuntu-cpp
#
# Volume will be created automatically for each combination of parameters.
volumes:
ubuntu-cpp:
name: "${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-cache"
alpine-cpp:
name: "${ARCH}-alpine-${HOST_COMPILER}-${COMPILER}-cache"
# Define basic rules for ccache used across multiple services. The beauty of
# docker compose with cached volumes is that similarly configured builds will
# reuse a ccache volume making build speeds much faster than a fresh build each
# time.
x-ccache: &ccache
CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: 1
CCACHE_COMPRESSLEVEL: 5
CCACHE_MAXSIZE: 700M
CCACHE_DIR: /build/ccache
# Define rules for VT configuration options across various services
x-vtopts: &vtopts
VT_LB_ENABLED: ${VT_LB:-1}
VT_TRACE_ENABLED: ${VT_TRACE:-0}
VT_MIMALLOC_ENABLED: ${VT_MIMALLOC:-0}
VT_DOXYGEN_ENABLED: ${VT_DOCS:-0}
VT_TRACE_RUNTIME_ENABLED: ${VT_TRACE_RT:-0}
VT_BUILD_TRACE_ONLY: ${VT_TRACE_ONLY:-0}
VT_ASAN_ENABLED: ${VT_ASAN:-0}
VT_UBSAN_ENABLED: ${VT_UBSAN:-0}
VT_WERROR_ENABLED: ${VT_WERROR:-1}
VT_POOL_ENABLED: ${VT_POOL:-1}
VT_ZOLTAN_ENABLED: ${VT_ZOLTAN:-0}
VT_UNITY_BUILD_ENABLED: ${VT_UNITY_BUILD:-0}
VT_PRODUCTION_BUILD_ENABLED: ${VT_PRODUCTION_BUILD:-0}
VT_FCONTEXT_ENABLED: ${VT_FCONTEXT:-0}
VT_DIAGNOSTICS_ENABLED: ${VT_DIAGNOSTICS:-1}
VT_DIAGNOSTICS_RUNTIME_ENABLED: ${VT_DIAGNOSTICS_RUNTIME:-0}
CMAKE_BUILD_TYPE: ${BUILD_TYPE:-release}
VT_MPI_GUARD_ENABLED: ${VT_MPI_GUARD:-1}
VT_EXTENDED_TESTS_ENABLED: ${VT_EXTENDED_TESTS:-1}
VT_CODE_COVERAGE: ${VT_CODE_COVERAGE:-0}
VT_KOKKOS_ENABLED: ${VT_KOKKOS_ENABLED:-0}
https_proxy: ${PROXY-}
http_proxy: ${PROXY-}
LSAN_OPTIONS: ${LSAN_OPTIONS-}
UBSAN_OPTIONS: ${UBSAN_OPTIONS-}
VT_CI_BUILD: ${VT_CI_BUILD:-0}
VT_DEBUG_VERBOSE: ${VT_DEBUG_VERBOSE:-0}
VT_TESTS_NUM_NODES: ${VT_TESTS_NUM_NODES:-}
VT_EXTERNAL_FMT: ${VT_EXTERNAL_FMT:-0}
VT_NO_COLOR_ENABLED: ${VT_NO_COLOR:-0}
BUILD_SHARED_LIBS: ${VT_BUILD_SHARED_LIBS:-0}
VT_INCLUSION_TYPE: ${VT_INCLUSION:-TPL}
CODECOV_TOKEN: ${CODECOV_TOKEN:-}
VT_CI_TEST_LB_SCHEMA: ${VT_CI_TEST_LB_SCHEMA:-0}
CMAKE_CXX_STANDARD: ${CMAKE_CXX_STANDARD:-17}
VT_TV_ENABLED: ${VT_TV_ENABLED:-0}
services:
##############################################################################
# C++ builds of VT on ubuntu/alpine platform from container baseline
# Ubuntu gcc-12 debug build:
# docker compose run -e CMAKE_BUILD_TYPE=debug ubuntu-cpp
ubuntu-cpp:
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-cpp
build:
context: .
target: base
dockerfile: ci/docker/ubuntu-${COMPILER_TYPE}-cpp.dockerfile
args: &default-args
arch: ${ARCH}
proxy: ${PROXY}
compiler: ${COMPILER}
host_compiler: ${HOST_COMPILER}
ubuntu: ${UBUNTU}
ubsan_enabled: ${VT_UBSAN:-0}
vt_tv_enabled: ${VT_TV_ENABLED:-0}
zoltan_enabled: ${VT_ZOLTAN:-0}
external_fmt: ${VT_EXTERNAL_FMT:-0}
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-cpp
ulimits: &ulimits
core: ${ULIMIT_CORE}
environment:
<<: [*ccache, *vtopts]
volumes: &ubuntu-volumes
- .:/vt:delegated
- ${BUILD_ROOT}ubuntu-cpp:/build:delegated
command: &vt-cpp-command >
/bin/bash -c "
/vt/ci/build_cpp.sh /vt /build &&
/vt/ci/test_cpp.sh /vt /build &&
/vt/ci/build_vt_sample.sh /vt /build"
##############################################################################
# C++ builds of VTK and VT on ubuntu/alpine platform from container baseline
# Ubuntu gcc-12 debug build:
# docker compose run -e CMAKE_BUILD_TYPE=debug ubuntu-vtk-cpp
ubuntu-cpp-vtk:
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-vtk-cpp
build:
context: .
target: base
dockerfile: ci/docker/ubuntu-${COMPILER_TYPE}-vtk-cpp.dockerfile
args: *default-args
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-vtk-cpp
ulimits: *ulimits
environment:
<<: [*ccache, *vtopts]
volumes: *ubuntu-volumes
command: *vt-cpp-command
##############################################################################
# C++ build/test/clean target for VT on ubuntu platform from container
# baseline.
#
# Example:
# docker compose run ubuntu-cpp-clean
ubuntu-cpp-clean:
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-cpp
build:
context: .
target: base
dockerfile: ci/docker/ubuntu-${COMPILER_TYPE}-cpp.dockerfile
args: *default-args
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-cpp
ulimits: *ulimits
environment:
<<: [*ccache, *vtopts]
volumes: *ubuntu-volumes
command: &vt-build-test-clean-cpp-command >
/bin/bash -c "
/vt/ci/build_cpp.sh /vt /build &&
/vt/ci/test_cpp.sh /vt /build &&
/vt/ci/build_vt_sample.sh /vt /build &&
/vt/ci/clean_cpp.sh /vt /build"
##############################################################################
# C++ build/test/clean target for VT on ubuntu platform from container
# baseline without installing.
#
# Example:
# docker compose run ubuntu-cpp-clean-noinstall
ubuntu-cpp-clean-noinstall:
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-cpp
build:
context: .
target: base
dockerfile: ci/docker/ubuntu-${COMPILER_TYPE}-cpp.dockerfile
args: *default-args
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-cpp
ulimits: *ulimits
environment:
<<: [*ccache, *vtopts]
volumes: *ubuntu-volumes
command: &vt-build-test-clean-noinstall-cpp-command >
/bin/bash -c "
/vt/ci/build_cpp.sh /vt /build all &&
/vt/ci/test_cpp.sh /vt /build &&
/vt/ci/clean_cpp.sh /vt /build"
##############################################################################
# Interactive C++ setup of VT on ubuntu platform from container baseline.
#
# After running:
# docker compose run ubuntu-cpp-interactive
#
# You will get a command line where you can run the build command:
# $ /vt/ci/build_cpp.sh /vt /build
# $ /vt/ci/test_cpp.sh /vt /build
# $ /vt/ci/build_vt_sample.sh /vt /build
ubuntu-cpp-interactive:
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-cpp
build:
context: .
target: base
dockerfile: ci/docker/ubuntu-${COMPILER_TYPE}-cpp.dockerfile
args: *default-args
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-cpp
ulimits: *ulimits
environment:
<<: [*ccache, *vtopts]
volumes: *ubuntu-volumes
##############################################################################
# C++ build/test/clean target for VT using OpenMPI instead of the default
# mpich.
#
# Note: This is a separate target because it requires a different image and
# modifying all the other container/image names to be parameterized over
# MPI requires a lot of changes.
ubuntu-cpp-clean-openmpi:
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-openmpi-cpp
build:
context: .
target: base
dockerfile: ci/docker/ubuntu-${UBUNTU}-${COMPILER_TYPE}-openmpi-cpp.dockerfile
args: *default-args
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-openmpi-cpp
ulimits: *ulimits
environment:
<<: [*ccache, *vtopts]
OMPI_MCA_btl: "^vader"
volumes: *ubuntu-volumes
command: *vt-build-test-clean-cpp-command
##############################################################################
# Interactive C++ setup of VT on ubuntu platform from container baseline for
# OpenMPI.
ubuntu-cpp-interactive-openmpi:
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-openmpi-cpp
build:
context: .
target: base
dockerfile: ci/docker/ubuntu-${UBUNTU}-${COMPILER_TYPE}-openmpi-cpp.dockerfile
args: *default-args
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-openmpi-cpp
ulimits: *ulimits
environment:
<<: [*ccache, *vtopts]
OMPI_MCA_btl: "^vader"
volumes: *ubuntu-volumes
##############################################################################
# Build C++ container with VT installed in the container on ubuntu platform
# from container baseline.
ubuntu-vt:
image: ${REPO}:vt-${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-cpp
build:
context: .
target: build
dockerfile: ci/docker/ubuntu-${COMPILER_TYPE}-cpp.dockerfile
args:
<<: [*default-args, *vtopts]
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-cpp
ulimits: *ulimits
environment:
<<: [*ccache, *vtopts]
volumes: *ubuntu-volumes
command: &cpp-command >
/bin/bash -c "
/vt/ci/test_cpp.sh /vt /build"
##############################################################################
# Build documentation for VT in the container on ubuntu platform from
# container baseline.
ubuntu-docs:
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-docs
build:
context: .
target: base
dockerfile: ci/docker/ubuntu-${COMPILER_TYPE}-docs.dockerfile
args:
<<: *default-args
token: ${TOKEN}
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-cpp
ulimits: *ulimits
environment:
<<: *ccache
VT_LB_ENABLED: ${VT_LB:-1}
VT_TRACE_ENABLED: ${VT_TRACE:-1}
VT_DIAGNOSTICS_ENABLED: 1
VT_DOXYGEN_ENABLED: 1
CMAKE_BUILD_TYPE: ${BUILD_TYPE:-release}
volumes: *ubuntu-volumes
command: &docs-cpp-command >
/bin/bash -c "
/vt/ci/build_cpp.sh /vt /build ${TOKEN}"
##############################################################################
# Build vt sample project using DARMA-vt installed from spack package.
ubuntu-spack:
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-openmpi-cpp
build:
context: .
target: base
dockerfile: ci/docker/ubuntu-${UBUNTU}-${COMPILER_TYPE}-openmpi-cpp.dockerfile
args: *default-args
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-openmpi-cpp
ulimits: *ulimits
environment:
<<: *vtopts
volumes: *ubuntu-volumes
command:
/bin/bash -c "
/vt/ci/test_spack_package.sh"
##############################################################################
# Interactive build documentation for VT in the container on ubuntu platform
# from container baseline.
ubuntu-docs-interactive:
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-docs
build:
context: .
target: base
dockerfile: ci/docker/ubuntu-${UBUNTU}-${COMPILER_TYPE}-docs.dockerfile
args:
<<: *default-args
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${HOST_COMPILER}-${COMPILER}-cpp
ulimits: *ulimits
environment:
<<: *ccache
VT_LB_ENABLED: ${VT_LB:-1}
VT_TRACE_ENABLED: ${VT_TRACE:-1}
VT_DIAGNOSTICS_ENABLED: 1
VT_DOXYGEN_ENABLED: 1
CMAKE_BUILD_TYPE: ${BUILD_TYPE:-release}
volumes: *ubuntu-volumes
##############################################################################
# C++ build of VT within an alpine linux container (limited to clang
# compilers)
alpine-cpp:
image: ${REPO}:${ARCH}-alpine-${HOST_COMPILER}-${COMPILER}-cpp
build:
context: .
target: base
dockerfile: ci/docker/alpine-cpp.dockerfile
args: *default-args
cache_from:
- ${REPO}:${ARCH}-alpine-${HOST_COMPILER}-${COMPILER}-cpp
ulimits: *ulimits
environment:
<<: [*ccache, *vtopts]
volumes: &alpine-volumes
- .:/vt:delegated
- ${BUILD_ROOT}alpine-cpp:/build:delegated
command: *vt-cpp-command
##############################################################################
# C++ build/test/clean target for VT on alpine platform from container
# baseline.
alpine-cpp-clean:
image: ${REPO}:${ARCH}-alpine-${HOST_COMPILER}-${COMPILER}-cpp
build:
context: .
target: base
dockerfile: ci/docker/alpine-cpp.dockerfile
args: *default-args
cache_from:
- ${REPO}:${ARCH}-alpine-${HOST_COMPILER}-${COMPILER}-cpp
ulimits: *ulimits
environment:
<<: [*ccache, *vtopts]
volumes: *alpine-volumes
command: *vt-build-test-clean-cpp-command