Skip to content

Commit 989948c

Browse files
Fix error log parsing in compute build CI (#3301)
This PR adds a new feature to capture and report which compute builds failed when running CI. Resolves #3296
1 parent f0f9917 commit 989948c

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

sorc/build_compute.sh

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,29 @@ while [[ "${finished}" == "false" ]]; do
100100
finished=true
101101
elif [[ "${state}" == "RUNNING" ]]; then
102102
finished=false
103-
elif [[ "${state}" == "DEAD" ]]; then
104-
echo "FATAL ERROR: ${BASH_SOURCE[0]} one or more builds failed!"
105-
# TODO add capability to determine which build(s) failed
106-
exit 2
107103
else
108104
echo "FATAL ERROR: ${BASH_SOURCE[0]} rocoto failed with state '${state}'"
109-
exit 3
105+
rm -f logs/error.logs
106+
# Determine which build(s) failed
107+
stat_out="$(rocotostat -w "${build_xml}" -d "${build_db}")"
108+
echo "${stat_out}" > rocotostat.out
109+
line_number=0
110+
while read -r line; do
111+
(( line_number += 1 ))
112+
# Skip the first two lines (header)
113+
if [[ ${line_number} -lt 3 ]]; then
114+
continue
115+
fi
116+
117+
if [[ "${line}" =~ "DEAD" || "${line}" =~ "UNKNOWN" ||
118+
"${line}" =~ "UNAVAILABLE" || "${line}" =~ "FAIL" ]]; then
119+
job=$(echo "${line}" | awk '{ print $2 }')
120+
log_file="logs/${job}.log"
121+
echo "${log_file}" >> logs/error.logs
122+
echo "Rocoto reported that the build failed for ${job}"
123+
fi
124+
done < rocotostat.out
125+
exit 2
110126
fi
111127
done
112128

workflow/build_opts.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,72 +23,60 @@ systems:
2323
build:
2424
gfs_model:
2525
command: "./build_ufs.sh -e gfs_model.x -j 12"
26-
log: "build_ufs_gfs.log"
2726
cores: 12
2827
walltime: "00:30:00"
2928

3029
gfs_ww3prepost:
3130
command: "./build_ww3prepost.sh -j 4"
32-
log: "build_ww3prepost_gfs.log"
3331
cores: 4
3432
walltime: "00:10:00"
3533

3634
gefs_model:
3735
command: "./build_ufs.sh -w -e gefs_model.x -j 12"
38-
log: "build_ufs_gefs.log"
3936
cores: 12
4037
walltime: "00:30:00"
4138

4239
gefs_ww3_prepost:
4340
command: "./build_ww3prepost.sh -w -j 4"
44-
log: "build_ww3prepost_gefs.log"
4541
cores: 4
4642
walltime: "00:10:00"
4743

4844
sfs_model:
4945
command: "./build_ufs.sh -y -e sfs_model.x -j 12"
50-
log: "build_ufs_sfs.log"
5146
cores: 12
5247
walltime: "00:30:00"
5348

5449
upp:
5550
command: "./build_upp.sh -j 8"
56-
log: "build_upp.log"
5751
cores: 8
5852
walltime: "00:10:00"
5953

6054
gsi_enkf:
6155
command: "./build_gsi_enkf.sh -j 8"
62-
log: "build_gsi_enkf.log"
6356
cores: 8
6457
walltime: "00:15:00"
6558

6659
gsi_monitor:
6760
command: "./build_gsi_monitor.sh -j 4"
68-
log: "build_gsi_monitor.log"
6961
cores: 4
7062
walltime: "00:10:00"
7163

7264
gsi_utils:
7365
command: "./build_gsi_utils.sh -j 6"
74-
log: "build_gsi_utils.log"
7566
cores: 6
7667
walltime: "00:10:00"
7768

7869
ufs_utils:
7970
command: "./build_ufs_utils.sh -j 8"
80-
log: "build_ufs_utils.log"
8171
cores: 8
8272
walltime: "00:10:00"
8373

8474
gfs_utils:
8575
command: "./build_gfs_utils.sh -j 6"
86-
log: "build_gfs_utils.log"
8776
cores: 6
8877
walltime: "00:10:00"
8978

9079
gdas:
9180
command: "./build_gdas.sh -j 24"
92-
log: "build_gdas.log"
9381
cores: 24
9482
walltime: "01:30:00"

0 commit comments

Comments
 (0)