forked from LLNL/UnifyFS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
137 lines (122 loc) · 5 KB
/
.gitlab-ci.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
# Both testing stages depend on the build stage. By using the "needs"
# keyword, we prevent the testing stages from blocking, in favor of a
# DAG.
stages:
- init
- build
- test-unit
- test-integ
##### System Templates #####
# Generic system templates used to contruct the final jobs on specific
# systems within their respective <system>.yml file. Currently
# these are LLNL specific, but can be adjusted or added to as new
# systems become available.
#
# The NNODES, WALL_TIME, and STORAGE_SIZE variables can be altered in
# Gitlab interface if/when the defaults need to be changed.
.base-template:
retry:
max: 1
when:
- unknown_failure
- stuck_or_timeout_failure
.slurm-single-node-template:
variables:
LLNL_SLURM_SCHEDULER_PARAMETERS: "-N 1 -p $QUEUE -t $UNIT_WALL_TIME -J unifyfs-unit-tests"
.slurm-multi-node-template:
variables:
LLNL_SLURM_SCHEDULER_PARAMETERS: "-N $NNODES -p $QUEUE -t $INTEG_WALL_TIME -J unifyfs-integ-tests"
.lsf-single-node-template:
variables:
LLNL_LSF_SCHEDULER_PARAMETERS: "-nnodes 1 -q $QUEUE -W $UNIT_WALL_TIME -J unifyfs-unit-tests"
SCHEDULER_PARAMETERS: "-nnodes 1 -P $PROJECT_ID -W $UNIT_WALL_TIME -J unifyfs-unit-tests"
.lsf-multi-node-template:
variables:
LLNL_LSF_SCHEDULER_PARAMETERS: "-nnodes $NNODES $STAGE_STORAGE -q $QUEUE -W $INTEG_WALL_TIME -J unifyfs-integ-tests"
SCHEDULER_PARAMETERS: "-nnodes $NNODES -P $PROJECT_ID -W $INTEG_WALL_TIME -J unifyfs-integ-tests"
##### Job Templates #####
# Only use this template in a pre-build job if needing to clone and
# run subsequent jobs from a non-default location.
# The WORKING_DIR envar needs to be defined in the job variables.
#
# The before_script section here overrides the default before_script
# for jobs using this template.
.init-template:
stage: init
before_script:
- mkdir -pv $WORKING_DIR
- cd $WORKING_DIR
script:
- git clone -b ${CI_COMMIT_BRANCH} --depth=1 ${CI_REPOSITORY_URL} $WORKING_DIR
# Build script used by each system. The CC and FC variables are set in
# the specific job scripts and evaluated in the before_script in order
# to customize which compiler will be used for each job.
# An artifact is created to pass on to the testing stages. The
# test-unit stage requires the unifyfs-build/ files and the test-integ
# stage requires the unifyfs-install/ files.
.build-template:
stage: build
script:
- CC_PATH=$($CC_COMMAND)
- FC_PATH=$($FC_COMMAND)
- GOTCHA_INSTALL=$(spack location -i gotcha %$SPACK_COMPILER arch=$SPACK_ARCH)
- SPATH_INSTALL=$(spack location -i spath %$SPACK_COMPILER arch=$SPACK_ARCH)
- ./autogen.sh
- mkdir -p unifyfs-build unifyfs-install && cd unifyfs-build
- ../configure CC=$CC_PATH FC=$FC_PATH --prefix=${WORKING_DIR}/unifyfs-install --with-gotcha=$GOTCHA_INSTALL --with-spath=$SPATH_INSTALL --enable-fortran --disable-silent-rules
- make V=1
- make V=1 install
needs: []
artifacts:
name: "${CI_JOB_NAME}-${CI_PIPELINE_ID}"
untracked: true
expire_in: 1 hour
paths:
- unifyfs-build/
- unifyfs-install/
.unit-test-template:
stage: test-unit
script:
- cd unifyfs-build/t && $JOB_LAUNCH_COMMAND make check
after_script:
- rm -rf /tmp/unify* /tmp/tmp.* /tmp/mdhim* /tmp/na_sm | true
# Variables here are used for the integration test suite and can be
# adjusted in the Gitlab interface. See our testing documentation for
# full details.
.integ-test-template:
stage: test-integ
script:
- cd t/ci && unbuffer prove -v RUN_CI_TESTS.sh
##### Jobs #####
# Since Gitlab currently runs in the user's home environment, the
# before_script is currently only set up to load the proper Spack
# modules, if they are available, to prevent changing the user's
# environment. Install any needed modules in the user's environment
# prior to running when new compilers or architectures need to be
# tested.
#
# For jobs running in the not-default location, change directories
# to the WORKING_DIR directory. Otherwise, set WORKING_DIR to be the
# CI_PROJECT_DIR for the build step.
#
# The COMPILER, CC_PATH, and FC_PATH variables are evaluated here. Set
# them in their specific job scripts.
# SPACK_COMPILER and SPACK_ARCH are then set to load the matching
# dependencies for the desired compiler.
before_script:
- which spack || ((cd $HOME/spack && git describe) && . $HOME/spack/share/spack/setup-env.sh)
- if [[ -d $WORKING_DIR ]]; then cd ${WORKING_DIR}; else export WORKING_DIR=${CI_PROJECT_DIR}; fi
- module load $COMPILER
- SPACK_COMPILER=${COMPILER//\//@}
- SPACK_ARCH="$(spack arch -p)-$(spack arch -o)-$(uname -m)"
- spack load [email protected] %$SPACK_COMPILER arch=$SPACK_ARCH
- spack load gotcha %$SPACK_COMPILER arch=$SPACK_ARCH
- spack load argobots %$SPACK_COMPILER arch=$SPACK_ARCH
- spack load mercury %$SPACK_COMPILER arch=$SPACK_ARCH
- spack load mochi-margo %$SPACK_COMPILER arch=$SPACK_ARCH
- spack load spath %$SPACK_COMPILER arch=$SPACK_ARCH
# System specific jobs
include:
- local: .gitlab/ascent.yml
- local: .gitlab/catalyst.yml
- local: .gitlab/lassen.yml