Skip to content

Commit 6bbb03b

Browse files
Merge pull request #734 from CamStan/test-main
Merge dev branch into main for 1.0 release
2 parents 70477d3 + d0ab1b9 commit 6bbb03b

File tree

201 files changed

+21419
-12548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+21419
-12548
lines changed
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
name: UnifyFS Build and Test
2+
3+
on:
4+
pull_request:
5+
branches: [ main, dev ]
6+
push:
7+
8+
jobs:
9+
checkpatch:
10+
runs-on: [ ubuntu-latest ]
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 2
16+
17+
- name: Checkpatch
18+
run: |
19+
eval $(git log HEAD^..HEAD | sed "s/^ *//g" | grep '^TEST_.*=')
20+
export TEST_CHECKPATCH_SKIP_FILES
21+
(git diff HEAD^..HEAD | ./scripts/checkpatch.sh origin/dev..HEAD) || test "$TEST_CHECKPATCH_ALLOW_FAILURE" = yes
22+
23+
build-and-test:
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
os: [ ubuntu-latest ]
28+
compiler: [ gcc ]
29+
gcc: [ 7, 8, 9, 10, 11 ]
30+
31+
name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.gcc }}
32+
33+
runs-on: ${{ matrix.os }}
34+
35+
env:
36+
CC: gcc-${{ matrix.gcc }}
37+
CXX: g++-${{ matrix.gcc }}
38+
39+
steps:
40+
- uses: actions/checkout@v2
41+
42+
- name: Set up GCC
43+
uses: egor-tensin/setup-gcc@v1
44+
with:
45+
version: ${{ matrix.gcc }}
46+
47+
- name: Install additional packages
48+
run: |
49+
sudo apt-get update
50+
sudo apt-get install libtool-bin
51+
sudo apt-get install openmpi-bin
52+
sudo apt-get install libopenmpi-dev
53+
54+
- name: Install Spack
55+
uses: kzscisoft/install-spack@v1
56+
57+
- name: Set up packages.yaml
58+
run: |
59+
test -f $GITHUB_WORKSPACE/.spack/etc/spack/packages.yaml || cat > $GITHUB_WORKSPACE/.spack/etc/spack/packages.yaml << 'EOF'
60+
packages:
61+
all:
62+
target: [x86_64]
63+
providers:
64+
mpi: [openmpi]
65+
autoconf:
66+
buildable: False
67+
externals:
68+
69+
prefix: /usr
70+
automake:
71+
buildable: False
72+
externals:
73+
74+
prefix: /usr
75+
cmake:
76+
buildable: False
77+
externals:
78+
79+
prefix: /usr
80+
libtool:
81+
buildable: False
82+
externals:
83+
84+
prefix: /usr
85+
m4:
86+
buildable: False
87+
externals:
88+
89+
prefix: /usr
90+
openmpi:
91+
buildable: False
92+
externals:
93+
94+
prefix: /usr
95+
pkg-config:
96+
buildable: False
97+
externals:
98+
99+
prefix: /usr
100+
EOF
101+
spack compiler find --scope=user
102+
if [[ $CC == 'gcc-7' ]]; then
103+
spack config add "packages:all:compiler:[[email protected]]"
104+
elif [[ $CC == 'gcc-8' ]]; then
105+
spack config add "packages:all:compiler:[[email protected]]"
106+
elif [[ $CC == 'gcc-9' ]]; then
107+
spack config add "packages:all:compiler:[[email protected]]"
108+
elif [[ $CC == 'gcc-11' ]]; then
109+
spack config add "packages:all:compiler:[[email protected]]"
110+
else
111+
spack config add "packages:all:compiler:[[email protected]]"
112+
fi
113+
114+
- name: Install UnifyFS dependencies
115+
run: |
116+
spack install gotcha@develop
117+
spack install [email protected] ^mercury~boostsys ^[email protected] fabrics=rxm,sockets,tcp
118+
spack install spath~mpi
119+
echo "GOTCHA_INSTALL=$(spack location -i gotcha)" >> $GITHUB_ENV
120+
echo "SPATH_INSTALL=$(spack location -i spath)" >> $GITHUB_ENV
121+
122+
- name: Configure and Build
123+
run: |
124+
source $GITHUB_WORKSPACE/.spack/share/spack/setup-env.sh
125+
spack load gotcha && spack load argobots && spack load mercury && spack load mochi-margo && spack load spath
126+
./autogen.sh
127+
./configure CC=$CC --with-gotcha=$GOTCHA_INSTALL --with-spath=$SPATH_INSTALL --enable-fortran
128+
make V=1
129+
130+
- name: Unit Tests
131+
run: |
132+
source $GITHUB_WORKSPACE/.spack/share/spack/setup-env.sh
133+
spack load gotcha && spack load argobots && spack load mercury && spack load mochi-margo && spack load spath
134+
cd t && make check
135+
136+
- name: After failure
137+
if: ${{ failure() }}
138+
run: |
139+
cat $GITHUB_WORKSPACE/config.log
140+
cat $GITHUB_WORKSPACE/t/test-suite.log

.gitlab-ci.yml

Lines changed: 81 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
# DAG.
44
stages:
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.
122148
before_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
136173
include:
137174
- local: .gitlab/ascent.yml
138175
- local: .gitlab/catalyst.yml
139176
- local: .gitlab/lassen.yml
177+
- local: .gitlab/quartz.yml

0 commit comments

Comments
 (0)