1+ # Both testing stages depend on the build stage. By using the "needs"
2+ # keyword, we prevent the testing stages from blocking, in favor of a
3+ # DAG.
14stages :
5+ - init
26 - build
37 - test-unit
48 - test-integ
59
6- cache :
7- paths :
8- - spack_ci/
10+ # #### System Templates #####
911
10- # #### Templates #####
12+ # Generic system templates used to contruct the final jobs on specific
13+ # systems within their respective <system>.yml file. Currently
14+ # these are LLNL specific, but can be adjusted or added to as new
15+ # systems become available.
16+ #
17+ # The NNODES, WALL_TIME, and STORAGE_SIZE variables can be altered in
18+ # Gitlab interface if/when the defaults need to be changed.
1119
12- .quartz-template : &quartz_template
13- tags :
14- - quartz
15- - shell
16- variables :
17- LLNL_SERVICE_USER : " unifysrv"
20+ .base-template :
1821 retry :
1922 max : 1
2023 when :
2124 - unknown_failure
2225 - stuck_or_timeout_failure
2326
24- .butte-template : &butte_template
25- tags :
26- - butte
27- - shell
27+ .slurm-single-node-template :
2828 variables :
29- LLNL_SERVICE_USER : " unifysrv"
30- retry :
31- max : 1
32- when :
33- - unknown_failure
34- - stuck_or_timeout_failure
29+ JOB_LAUNCH_COMMAND : " srun -N1 -n1"
30+ LLNL_SLURM_SCHEDULER_PARAMETERS : " -N 1 -p $QUEUE -t $UNIT_WALL_TIME -J unifyfs-unit-tests"
3531
36- .build-template : &build_template
32+ .slurm-multi-node-template :
33+ variables :
34+ LLNL_SLURM_SCHEDULER_PARAMETERS : " -N $NNODES -p $QUEUE -t $INTEG_WALL_TIME -J unifyfs-integ-tests"
35+
36+ .lsf-single-node-template :
37+ 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+
42+ .lsf-multi-node-template :
43+ 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+
47+ # #### Job Templates #####
48+
49+ # Only use this template in a pre-build job if needing to clone and
50+ # run subsequent jobs from a non-default location.
51+ # The WORKING_DIR envar needs to be defined in the job variables.
52+ #
53+ # The before_script section here overrides the default before_script
54+ # for jobs using this template.
55+ .init-template :
56+ stage : init
57+ before_script :
58+ - mkdir -pv $WORKING_DIR
59+ - cd $WORKING_DIR
60+ script :
61+ - git clone -b ${CI_COMMIT_BRANCH} --depth=1 ${CI_REPOSITORY_URL} $WORKING_DIR
62+
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.
66+ # An artifact is created to pass on to the testing stages. The
67+ # test-unit stage requires the unifyfs-build/ files and the test-integ
68+ # stage requires the unifyfs-install/ files.
69+ .build-template :
3770 stage : build
3871 script :
3972 - ./autogen.sh
4073 - mkdir -p unifyfs-build unifyfs-install && cd unifyfs-build
41- - ../configure --prefix=$CI_PROJECT_DIR /unifyfs-install --enable-fortran --disable-silent-rules
74+ - ../configure CC=$CC_PATH FC=$FC_PATH --prefix=${WORKING_DIR} /unifyfs-install --enable-fortran --disable-silent-rules
4275 - make V=1
4376 - make V=1 install
77+ needs : []
4478 artifacts :
4579 name : " ${CI_JOB_NAME}-${CI_PIPELINE_ID}"
4680 untracked : true
@@ -49,84 +83,54 @@ cache:
4983 - unifyfs-build/
5084 - unifyfs-install/
5185
52- .unit-test-template : &unit_test_template
86+ .unit-test-template :
5387 stage : test-unit
5488 script :
55- - cd unifyfs-build/t && make check
89+ - cd unifyfs-build/t && $JOB_LAUNCH_COMMAND make check
5690 after_script :
57- - rm -rf /tmp/unify* /tmp/tmp.* /tmp/mdhim* /tmp/na_sm
58-
59- .quartz-batch-variables :
60- variables : &quartz_batch_variables
61- LLNL_SLURM_SCHEDULER_PARAMETERS : " -N $NNODES -p pbatch -t $WALL_TIME"
62- LLNL_SERVICE_USER : " unifysrv"
63- CI_PROJDIR : " $CI_PROJECT_DIR"
64- UNIFYFS_INSTALL : " $CI_PROJECT_DIR/unifyfs-install"
65- CI_NPROCS : " $NPROCS"
91+ - rm -rf /tmp/unify* /tmp/tmp.* /tmp/mdhim* /tmp/na_sm | true
6692
67- .butte-batch-variables :
68- variables : &butte_batch_variables
69- LLNL_LSF_SCHEDULER_PARAMETERS : " -nnodes $NNODES -q pbatch -W $WALL_TIME "
70- LLNL_SERVICE_USER : " unifysrv "
71- CI_PROJDIR : " $CI_PROJECT_DIR "
72- UNIFYFS_INSTALL : " $CI_PROJECT_DIR/unifyfs-install "
73- CI_NPROCS : " $NPROCS "
93+ # Variables here are used for the integration test suite and can be
94+ # adjusted in the Gitlab interface. See our testing documentation for
95+ # full details.
96+ .integ-test-template :
97+ stage : test-integ
98+ script :
99+ - cd t/ci && prove -v RUN_CI_TESTS.sh
74100
75101# #### Jobs #####
76102
103+ # Since Gitlab currently runs in the user's home environment, the
104+ # before_script is currently only set up to load the proper Spack
105+ # modules, if they are available, to prevent changing the user's
106+ # environment. Install any needed modules in the user's environment
107+ # prior to running when new compilers or architectures need to be
108+ # tested.
109+ #
110+ # For jobs running in the not-default location, change directories
111+ # to the WORKING_DIR directory. Otherwise, set WORKING_DIR to be the
112+ # CI_PROJECT_DIR for the build step.
113+ #
114+ # The COMPILER, CC_PATH, and FC_PATH variables are evaluated here. Set
115+ # them in their specific job scripts.
116+ # SPACK_COMPILER and SPACK_ARCH are then set to load the matching
117+ # dependencies for the desired compiler.
77118before_script :
78- # HERE BE DRAGONS!: Since on HPC and running as user, Spack might already
79- # exist and can get complicated if we install it again.
80- #
81- # check for sourced spack || check for unsourced spack in $HOME/spack and
82- # source it || check for cached spack, clone if none, and source it
83- - which spack || ((cd $HOME/spack && git describe) && . $HOME/spack/share/spack/setup-env.sh) || (((cd spack_ci && git describe) || git clone https://github.com/CamStan/spack spack_ci) && . spack_ci/share/spack/setup-env.sh)
84- - SPACK_ARCH=$(spack arch)
85- - spack install leveldb && spack load leveldb arch=$SPACK_ARCH
86- -
spack install [email protected] && spack load [email protected] arch=$SPACK_ARCH 87- - spack install flatcc && spack load flatcc arch=$SPACK_ARCH
88- - spack install margo^mercury+bmi~boostsys && spack load argobots arch=$SPACK_ARCH && spack load mercury arch=$SPACK_ARCH && spack load margo arch=$SPACK_ARCH
89-
90- build-quartz :
91- << : *quartz_template
92- << : *build_template
93-
94- build-butte :
95- << : *butte_template
96- << : *build_template
97-
98- unit-test-quartz :
99- << : *quartz_template
100- << : *unit_test_template
101- dependencies :
102- - build-quartz
103-
104- unit-test-butte :
105- << : *butte_template
106- << : *unit_test_template
107- dependencies :
108- - build-butte
109-
110- # integ-test-quartz:
111- # <<: *quartz_template
112- # stage: test-integ
113- # tags:
114- # - quartz
115- # - batch
116- # variables: *quartz_batch_variables
117- # script:
118- # - cd t/ci && prove -v RUN_CI_TESTS.sh
119- # dependencies:
120- # - build-quartz
121-
122- integ-test-butte :
123- << : *butte_template
124- stage : test-integ
125- tags :
126- - butte
127- - batch
128- variables : *butte_batch_variables
129- script :
130- - cd t/ci && prove -v RUN_CI_TESTS.sh
131- dependencies :
132- - build-butte
119+ - which spack || ((cd $HOME/spack && git describe) && . $HOME/spack/share/spack/setup-env.sh)
120+ - if [[ -d $WORKING_DIR ]]; then cd ${WORKING_DIR}; else export WORKING_DIR=${CI_PROJECT_DIR}; fi
121+ - module load $COMPILER
122+ - CC_PATH=$($CC_COMMAND)
123+ - FC_PATH=$($FC_COMMAND)
124+ - SPACK_COMPILER=${COMPILER//\//@}
125+ - SPACK_ARCH="$(spack arch -p)-$(spack arch -o)-$(uname -m)"
126+ - spack load gotcha %$SPACK_COMPILER arch=$SPACK_ARCH
127+ - spack load argobots %$SPACK_COMPILER arch=$SPACK_ARCH
128+ - spack load mercury %$SPACK_COMPILER arch=$SPACK_ARCH
129+ - spack load margo %$SPACK_COMPILER arch=$SPACK_ARCH
130+ - spack load spath %$SPACK_COMPILER arch=$SPACK_ARCH
131+
132+ # System specific jobs
133+ include :
134+ - local : .gitlab/ascent.yml
135+ - local : .gitlab/catalyst.yml
136+ - local : .gitlab/lassen.yml
0 commit comments