-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
322 lines (280 loc) · 8.28 KB
/
.gitlab-ci.yml
File metadata and controls
322 lines (280 loc) · 8.28 KB
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
# ----------------------------------------------------------------------
# LALSuite: Gitlab-CI configuration
#
# If you have any questions, please email lal-discuss@ligo.org, or open
# a question ticket at https://git.ligo.org/lscsoft/lalsuite/-/issues/
# ----------------------------------------------------------------------
# -- setup --------------------------------------
stages:
# pipeline errors
- pipeline error
# make tarballs for each subpackage
- tarballs
# build packages for each subpackage
- LAL
- LALFrame
- LALMetaIO
- LALSimulation
- LALBurst
- LALInspiral
- LALInference
- LALPulsar
- LALApps
- wheels
# end-to-end tests
- integration tests
- compiler tests
- platform tests
- upgrade tests
# build containers
- docker
# quality checks
- coverage
- lint
# documentation
- documentation
# deploy packages
- deploy
include:
# retry() macro
- local: '/.gitlab/ci/retry.yml'
# CI rules
- local: '/.gitlab/ci/rules.yml'
# make tarballs for each subpackage
- local: '/.gitlab/ci/tarballs.yml'
# build packages for each subpackage
- local: '/.gitlab/ci/conda.yml'
- local: '/.gitlab/ci/deb.yml'
- local: '/.gitlab/ci/pkg.yml'
- local: '/.gitlab/ci/rpm.yml'
- local: '/.gitlab/ci/wheels.yml'
# end-to-end tests
- local: '/.gitlab/ci/integration.yml'
- local: '/.gitlab/ci/compilers.yml'
- local: '/.gitlab/ci/platform.yml'
- local: '/.gitlab/ci/upgrade.yml'
# build containers
- local: '/.gitlab/ci/containers.yml'
# quality checks
- local: '/.gitlab/ci/coverage.yml'
- local: '/.gitlab/ci/lint.yml'
# documentation
- local: '/.gitlab/ci/docs.yml'
# deploy packages
# - wheels: see .gitlab/ci/wheels.yml
# -- global settings ----------------------------
# by default cache everything in the .cache directory
cache:
key: "${CI_JOB_NAME}"
paths:
- .cache
variables:
PIPELINE_NAME: "LALSuite CI/CD"
# job stage attempts
ARTIFACT_DOWNLOAD_ATTEMPTS: 2
EXECUTOR_JOB_SECTION_ATTEMPTS: 2
GET_SOURCES_ATTEMPTS: 2
RESTORE_CACHE_ATTEMPTS: 2
# run autoreconf in pedantic and loud mode
AUTORECONF: "autoreconf --verbose --warnings=error"
# enable nightly build
ENABLE_NIGHTLY: ""
# version of python to use for builds
LALSUITE_PYTHON_VERSION: "3.12"
# gitlab runners have 4 cores per job
CPU_COUNT: 4
# don't need git history
GIT_DEPTH: 1
# global build helpers
VERBOSE: "true"
# where to store files, ideally everything that is 'cache'
# should go under ${CI_PROJECT_DIR}/.cache to match the
# cache key setting above
XDG_CONFIG_HOME: "${CI_PROJECT_DIR}/.config"
XDG_CACHE_HOME: "${CI_PROJECT_DIR}/.cache"
CCACHE_DIR: "${CI_PROJECT_DIR}/.cache/ccache"
CONDA_PKGS_DIRS: "${CI_PROJECT_DIR}/.cache/conda/pkgs"
PIP_CACHE_DIR: "${CI_PROJECT_DIR}/.cache/pipe"
# where to build conda environments (i.e. not in ~/.conda)
CONDA_ENVS_PATH: "${CI_PROJECT_DIR}/envs"
# what file to use for conda configuration
CONDARC: "${CI_PROJECT_DIR}/.condarc"
# tell Debian-based installers to run non-interactively
DEBIAN_FRONTEND: noninteractive
# canonical list of LALSuite packages
LALSUITE_PACKAGES: >-
lal
lalframe lalmetaio lalsimulation
lalburst lalinspiral lalinference lalpulsar
lalapps
# default parameters for jobs
default:
# retry running jobs on abnormal failures
retry:
max: 2
when:
- unknown_failure
- stuck_or_timeout_failure
- runner_system_failure
- stale_schedule
- archived_failure
- scheduler_failure
exit_codes:
# exit code of retry() macro after all attempts
- 111
# cancel job when a newer pipeline starts
interruptible: true
# -- helper fragments ----------------------------------
# to use:
# - !reference [.name-of-fragment]
# basic steps for a job that compiles stuff
.build-init:
# use retry()
- !reference [.retry]
# do not save coredumps
- ulimit -S -c 0
# set up ccache
- export PATH=/usr/lib/ccache:/opt/local/libexec/ccache:$PATH
# print environment for debugging
- |
declare -x | cut -c 12- | sed 's/^/ENV: /'
# ensure Git-LFS files are checked out
- |
test "X${GIT_STRATEGY}" = Xnone || ( git lfs ls-files | sed 's/^/LFS: /' )
# set up Python virtual environment for pip installing local packages, etc.
.python-venv:
- !reference [.retry]
- |
rm -rf .venv/
${PYTHON:-python3} -m venv --system-site-packages .venv/
source .venv/bin/activate
for n in python python3 pip; do
if [ "X`type -p ${n}`" != "X${VIRTUAL_ENV}/bin/${n}" ]; then
echo "ERROR: virtual environment in '${VIRTUAL_ENV}' is missing ${n}" >&2
exit 1
fi
done
retry python -m pip install --upgrade pip
# -- base templates ----------------------------------
# basic before_script template for a compiling job
.build-job:
timeout: 3 hours
before_script:
- !reference [.build-init]
# helper template for jobs running on macOS
.macos-job:
variables:
# use the clone strategy so permissions are correctly reset on any failed jobs
# see: https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/3726
GIT_STRATEGY: clone
# Clang has weird bugs when compiling with CFLAGS=-O3
CFLAGS: "-O2"
# stop Clang generating profile files
LLVM_PROFILE_FILE: "/dev/null"
# tag for macOS x86_64 architecture jobs
.macos-x86_64:
extends:
- .macos-job
tags:
- macos_x86_64
# tag for macOS arm64 architecture jobs
.macos-arm64:
extends:
- .macos-job
tags:
- macos_arm64
# deploy outputs to various locations
.deploy:
stage: deploy
variables:
GIT_STRATEGY: none
retry: 0
interruptible: false
# -- CI job templates ----------------------------------
# a top-level build runs the standard boot/configure/make
# cycle with some sensible defaults
.make-distcheck:
extends:
- .build-job
variables:
# default configure flags (can be overridden from dependents)
CONFIGURE_FLAGS: "--enable-doxygen --enable-python --enable-swig-python"
# default C flags (can be overridden from dependents)
CFLAGS: "-O3"
# target to actually run (distcheck is the most thorough)
MAKE_TARGET: "distcheck"
needs: []
script:
- ./00boot
# we use xargs here in case CONFIGURE_FLAGS contains
# variables with spaces, etc etc
- xargs ./configure
--enable-strict-defs
${ENABLE_NIGHTLY}
CFLAGS="${CFLAGS}"
LALSUITE_LIBTOOL_NO_SUPPRESS=1
<<< ${CONFIGURE_FLAGS}
# install build dependencies, if requested
- |
if test "X$(declare -F install_build_deps)" != X; then
echo "Installing build dependencies ..."
install_build_deps
else
echo "Not installing build dependencies"
fi
# build
- make -j${CPU_COUNT} VERBOSE=1 ${MAKE_TARGET:-distcheck}
artifacts:
# upload some files to debug failures
paths:
- config.log
- Makefile
- lal*/config.log
- lal*/libtool
- lal*/Makefile
- lal*/**/test-suite.log
when: on_failure
# install deb dependencies for top-level builds
.make-distcheck-deb:
extends:
- .make-distcheck
before_script:
- !reference [.make-distcheck, before_script]
- |
install_build_deps() {
retry apt-get update -y -q
local subdir
for subdir in ${LALSUITE_PACKAGES}; do
if test -f ${subdir}/config.log; then
pushd ${subdir}
awk '
/^Build-Depends:/ { bd=1; print; next }
bd==1 && ( / lal/ || / liblal/ || / python.*-lal/ ) { next }
/^[^ ]/ { bd=0 }
{ print }
' debian/control > debian/control.tmp
mv -f debian/control.tmp debian/control
retry apt-get build-dep -y -q .
popd
fi
done
}
# install rpm dependencies for top-level builds
.make-distcheck-rpm:
extends:
- .make-distcheck
before_script:
- !reference [.make-distcheck, before_script]
- |
install_build_deps() {
local specs
local subdir
for subdir in ${LALSUITE_PACKAGES}; do
if test -f ${subdir}/config.log; then
local spec="${subdir}/${subdir}.spec"
sed -i -e '/BuildRequires: *\(lal\|liblal\|python.*-lal\)/d' ${spec}
specs="${specs} ${spec}"
fi
done
retry yum-builddep -y -q ${specs}
}