forked from LLNL/hiop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
143 lines (130 loc) · 3.37 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
138
139
140
141
142
143
# Environment variables shared between scripts for all ORNL CI stages
.ornl_environment_template: &ornl_environment_variables
variables:
SCHEDULER_PARAMETERS: "-P CSC359 -nnodes 1 -W 30"
WORKDIR: /gpfs/wolf/proj-shared/csc359/ci/${CI_PIPELINE_ID}
.ornl_test_script_template: &ornl_test_script_definition
script:
- |
set -xv
cd "$WORKDIR"
MY_CLUSTER="ascent" ./BUILD.sh --test-only
res=$?
exit $res
after_script:
- |
cd "$WORKDIR/.."
rm -rf "$WORKDIR"
.ornl_script_template: &ornl_script_definition
script:
- |
# Don't clean up this working directory - we need some of these files for
# testing
set -xv
mkdir -p "$WORKDIR"
cp -R ./* "$WORKDIR"
cd "$WORKDIR"
MY_CLUSTER="ascent" ./BUILD.sh --build-only || exit 1
.pnnl_script_template: &pnnl_script_definition
script:
- |
#
# NOTES: WORKDIR is on constance/marianas/newell
# ./ is only on the Kubernetes instance
#
set -xv
export WORKDIR="$HOME/gitlab/$CI_JOB_ID/"
mkdir -p "$WORKDIR"
cp -R ./* "$WORKDIR"
cd "$WORKDIR"
touch output
tail -f output &
tailpid=$!
if [[ $MY_CLUSTER == "marianas" ]]; then
export SLURM_Q=`perl $WORKDIR/scripts/findIdleDLNodes.pl`
fi
sbatch -A EXASGD --exclusive -N 1 -n 8 -p $SLURM_Q -t $TIMELIMIT $SLURM_ARGS -o output -e output $WORKDIR/BUILD.sh $BUILD_SCRIPT_ARGS
res=1
set +xv
while :;
do
if [[ "$(awk 'BEGIN{i=0}/BUILD_STATUS/{i++}END{print i}' output)" != "0" ]]; then
kill $tailpid
res=$(grep BUILD_STATUS output | tail -n 1 | cut -f2 -d':')
break
fi
sleep 10
done
echo "finished batch job: $res"
exit $res
after_script:
- |
set -xv
export WORKDIR="$HOME/gitlab/$CI_JOB_ID/"
rm -rf "$WORKDIR"
.pnnl_tags_template: &pnnl_tags_definition
tags:
- k8s
- ikp
- exasgd
- marianas
stages:
- build
- default_build
- test
# For PNNL CI
build_on_marianas:
stage: default_build
variables:
SLURM_Q: "dl"
MY_CLUSTER: "marianas"
TIMELIMIT: '1:30:00'
SLURM_ARGS: --gres=gpu:1 --exclusive
<<: *pnnl_tags_definition
<<: *pnnl_script_definition
rules:
- if: '$CI_PROJECT_ROOT_NAMESPACE == "exasgd"'
build_on_newell:
stage: default_build
variables:
SLURM_Q: "newell_shared"
MY_CLUSTER: "newell"
TIMELIMIT: '1:00:00'
SLURM_ARGS: --gres=gpu:1 --exclusive
<<: *pnnl_tags_definition
<<: *pnnl_script_definition
rules:
- if: '$CI_PROJECT_ROOT_NAMESPACE == "exasgd"'
build_on_incline:
allow_failure: true
stage: default_build
variables:
SLURM_Q: incline
MY_CLUSTER: incline
TIMELIMIT: '1:00:00'
SLURM_ARGS: --exclusive
BUILD_SCRIPT_ARGS: --build-only
<<: *pnnl_tags_definition
<<: *pnnl_script_definition
rules:
- if: '$CI_PROJECT_ROOT_NAMESPACE == "exasgd"'
# For Ascent CI
build_on_login_node:
stage: build
tags:
- nobatch
rules:
- if: '$CI_PROJECT_PATH == "ecpcitest/exasgd/hiop"'
<<: *ornl_script_definition
<<: *ornl_environment_variables
test_on_compute_node:
stage: test
dependencies:
- build_on_login_node
tags:
- batch
rules:
- if: '$CI_PROJECT_PATH == "ecpcitest/exasgd/hiop"'
<<: *ornl_test_script_definition
<<: *ornl_environment_variables
# ---