33# DAG.
44stages :
55 - init
6+ - install-deps
67 - build
78 - test-unit
89 - test-integ
10+ - clean
911
1012# #### System Templates #####
1113
@@ -14,10 +16,12 @@ stages:
1416# these are LLNL specific, but can be adjusted or added to as new
1517# systems become available.
1618#
17- # The NNODES, WALL_TIME, and STORAGE_SIZE variables can be altered in
18- # Gitlab interface if/when the defaults need to be changed.
19+ # The NNODES, WALL_TIME, QUEUE, and STORAGE_SIZE variables can be altered in
20+ # Gitlab web interface if/when the defaults need to be changed.
1921
2022.base-template :
23+ variables :
24+ LLNL_SERVICE_USER : unifysrv
2125 retry :
2226 max : 1
2327 when :
@@ -26,23 +30,21 @@ stages:
2630
2731.slurm-single-node-template :
2832 variables :
29- JOB_LAUNCH_COMMAND : " srun -N1 -n1"
30- LLNL_SLURM_SCHEDULER_PARAMETERS : " -N 1 -p $QUEUE -t $UNIT_WALL_TIME -J unifyfs-unit-tests"
33+ LLNL_SLURM_SCHEDULER_PARAMETERS : " -N 1 -p $QUEUE -t $UNIT_WALL_TIME"
3134
3235.slurm-multi-node-template :
3336 variables :
34- LLNL_SLURM_SCHEDULER_PARAMETERS : " -N $NNODES -p $QUEUE -t $INTEG_WALL_TIME -J unifyfs-integ-tests "
37+ LLNL_SLURM_SCHEDULER_PARAMETERS : " -N $NNODES -p $QUEUE -t $INTEG_WALL_TIME"
3538
3639.lsf-single-node-template :
3740 variables :
38- JOB_LAUNCH_COMMAND : " jsrun -r1 -n1"
39- LLNL_LSF_SCHEDULER_PARAMETERS : " -nnodes 1 -q $QUEUE -W $UNIT_WALL_TIME -J unifyfs-unit-tests"
40- SCHEDULER_PARAMETERS : " -nnodes 1 -P $PROJECT_ID -W $UNIT_WALL_TIME -J unifyfs-unit-tests"
41+ LLNL_LSF_SCHEDULER_PARAMETERS : " -nnodes 1 -q $QUEUE -W $UNIT_WALL_TIME"
42+ SCHEDULER_PARAMETERS : " -nnodes 1 -P $PROJECT_ID -W $UNIT_WALL_TIME"
4143
4244.lsf-multi-node-template :
4345 variables :
44- LLNL_LSF_SCHEDULER_PARAMETERS : " -nnodes $NNODES $STAGE_STORAGE -q $QUEUE -W $INTEG_WALL_TIME -J unifyfs-integ-tests "
45- SCHEDULER_PARAMETERS : " -nnodes $NNODES -P $PROJECT_ID -W $INTEG_WALL_TIME -J unifyfs-integ-tests "
46+ LLNL_LSF_SCHEDULER_PARAMETERS : " -nnodes $NNODES $STAGE_STORAGE -q $QUEUE -W $INTEG_WALL_TIME"
47+ SCHEDULER_PARAMETERS : " -nnodes $NNODES -P $PROJECT_ID -W $INTEG_WALL_TIME"
4648
4749# #### Job Templates #####
4850
@@ -60,9 +62,23 @@ stages:
6062 script :
6163 - git clone -b ${CI_COMMIT_BRANCH} --depth=1 ${CI_REPOSITORY_URL} $WORKING_DIR
6264
63- # Build script used by each system. The CC and FC variables are set in
64- # the specific job scripts and evaluated in the before_script in order
65- # to customize which compiler will be used for each job.
65+ # Check if Spack is installed, but don't install if not. Doing so may create
66+ # issues with the user's/service user's Spack installation.
67+ # Check if the SPACK_ENV_NAME set in the job already exists. If so, this does
68+ # nothing. If not, create and install the Spack Environment for subsequent jobs
69+ # to use.
70+ .install-deps-template :
71+ stage : install-deps
72+ before_script :
73+ - which spack || ((cd $HOME/spack && git describe) && . $HOME/spack/share/spack/setup-env.sh)
74+ - module load $COMPILER
75+ script :
76+ - spack env list | grep $SPACK_ENV_NAME || (spack env create $SPACK_ENV_NAME .spack-env/${SPACK_ENV_NAME}/spack.yaml && spack env activate $SPACK_ENV_NAME && spack install --fail-fast)
77+ needs : []
78+
79+ # Build script used by each system to build UnifyFS. The CC and FC variables are
80+ # set in the specific job scripts and evaluated here in order to customize which
81+ # compiler will be used for each job.
6682# An artifact is created to pass on to the testing stages. The
6783# test-unit stage requires the unifyfs-build/ files and the test-integ
6884# stage requires the unifyfs-install/ files.
@@ -71,18 +87,17 @@ stages:
7187 script :
7288 - CC_PATH=$($CC_COMMAND)
7389 - FC_PATH=$($FC_COMMAND)
74- - GOTCHA_INSTALL=$(spack location -i gotcha %$SPACK_COMPILER arch=$SPACK_ARCH )
75- - SPATH_INSTALL=$(spack location -i spath %$SPACK_COMPILER arch=$SPACK_ARCH )
90+ - GOTCHA_INSTALL=$(spack location -i gotcha)
91+ - SPATH_INSTALL=$(spack location -i spath)
7692 - ./autogen.sh
7793 - mkdir -p unifyfs-build unifyfs-install && cd unifyfs-build
7894 - ../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
7995 - make V=1
8096 - make V=1 install
81- needs : []
8297 artifacts :
8398 name : " ${CI_JOB_NAME}-${CI_PIPELINE_ID}"
8499 untracked : true
85- expire_in : 1 hour
100+ expire_in : 6 hour
86101 paths :
87102 - unifyfs-build/
88103 - unifyfs-install/
@@ -94,46 +109,69 @@ stages:
94109 after_script :
95110 - rm -rf /tmp/unify* /tmp/tmp.* /tmp/mdhim* /tmp/na_sm | true
96111
97- # Variables here are used for the integration test suite and can be
98- # adjusted in the Gitlab interface. See our testing documentation for
99- # full details.
112+ # Run the integration test suite with the options provided from the specific
113+ # job.
114+ # Variables used in the integration test suite can be adjusted in the Gitlab web
115+ # interface. See our testing documentation for full details.
116+ # If the job was successful, clean up the build directory in the after_script.
100117.integ-test-template :
101118 stage : test-integ
102119 script :
103- - cd t/ci && unbuffer prove -v RUN_CI_TESTS.sh
120+ - cd t/ci && unbuffer prove -v RUN_CI_TESTS.sh $CI_TEST_OPTIONS
121+ after_script :
122+ - >
123+ echo "CI_JOB_STATUS: $CI_JOB_STATUS";
124+ if [[ $CI_JOB_STATUS == 'success' ]]; then
125+ echo "Cleaning CI_BUILDS_DIR: $CI_BUILDS_DIR"
126+ rm -rf $CI_BUILDS_DIR
127+ elif [[ $CI_JOB_STATUS == 'failed' ]]; then
128+ echo "Logs for debugging available in:"
129+ echo "CI_BUILDS_DIR: $CI_BUILDS_DIR"
130+ else
131+ echo "Job status unknown"
132+ fi
104133
105134# #### Jobs #####
106135
107- # Since Gitlab currently runs in the user's home environment, the
108- # before_script is currently only set up to load the proper Spack
109- # modules, if they are available, to prevent changing the user's
110- # environment. Install any needed modules in the user's environment
111- # prior to running when new compilers or architectures need to be
112- # tested.
136+ # Default before_script for each job. Use an alternative working directory (if
137+ # necessary), module load the compiler associated with this job, and activate
138+ # the Spack Environment associated with this job.
139+ #
140+ # For jobs running in the not-default location, change directories to the
141+ # WORKING_DIR directory. Otherwise, set WORKING_DIR to be the CI_PROJECT_DIR for
142+ # the build step.
143+ # TODO: Look into CUSTOM_CI_BUILDS_DIR as an alternative (must work on ascent).
113144#
114- # For jobs running in the not-default location, change directories
115- # to the WORKING_DIR directory. Otherwise, set WORKING_DIR to be the
116- # CI_PROJECT_DIR for the build step.
145+ # The COMPILER variable (evaluated here) is set in the specific job scripts.
117146#
118- # The COMPILER, CC_PATH, and FC_PATH variables are evaluated here. Set
119- # them in their specific job scripts.
120- # SPACK_COMPILER and SPACK_ARCH are then set to load the matching
121- # dependencies for the desired compiler.
147+ # Activate the Spack Environment created in the install-deps job.
122148before_script :
123- - which spack || ((cd $HOME/spack && git describe) && . $HOME/spack/share/spack/setup-env.sh)
124149 - if [[ -d $WORKING_DIR ]]; then cd ${WORKING_DIR}; else export WORKING_DIR=${CI_PROJECT_DIR}; fi
125150 - module load $COMPILER
126- - SPACK_COMPILER=${COMPILER//\//@}
127- - SPACK_ARCH="$(spack arch -p)-$(spack arch -o)-$(uname -m)"
128- -
spack load [email protected] %$SPACK_COMPILER arch=$SPACK_ARCH 129- - spack load gotcha %$SPACK_COMPILER arch=$SPACK_ARCH
130- - spack load argobots %$SPACK_COMPILER arch=$SPACK_ARCH
131- - spack load mercury %$SPACK_COMPILER arch=$SPACK_ARCH
132- - spack load mochi-margo %$SPACK_COMPILER arch=$SPACK_ARCH
133- - spack load spath %$SPACK_COMPILER arch=$SPACK_ARCH
151+ - spack env activate $SPACK_ENV_NAME && spack env status && spack find
152+
153+ # Scheduled job to fully clean the runner directory to avoid space issues that
154+ # may accumulate over time.
155+ #
156+ # Running with lsf tag here, but this may be too vague as the job may attempt to
157+ # use a runner on a system the service user doesn't have permission to access.
158+ # If so, move this job to a specific system.
159+ full_clean :
160+ stage : clean
161+ extends : .base-template
162+ variables :
163+ GIT_STRATEGY : none
164+ rules :
165+ - if : $FULL_CLEAN == "YES" && $CI_PIPELINE_SOURCE == "schedule"
166+ tags :
167+ - shell
168+ before_script : []
169+ script : rm -rf ${HOME}/.jacamar-ci/*
170+ needs : []
134171
135172# System specific jobs
136173include :
137174 - local : .gitlab/ascent.yml
138175 - local : .gitlab/catalyst.yml
139176 - local : .gitlab/lassen.yml
177+ - local : .gitlab/quartz.yml
0 commit comments