Skip to content

Commit

Permalink
Fix error log parsing in compute build CI (#3301)
Browse files Browse the repository at this point in the history
This PR adds a new feature to capture and report which compute builds
failed when running CI.

Resolves #3296
  • Loading branch information
DavidHuber-NOAA authored Feb 10, 2025
1 parent f0f9917 commit 989948c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
26 changes: 21 additions & 5 deletions sorc/build_compute.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,29 @@ while [[ "${finished}" == "false" ]]; do
finished=true
elif [[ "${state}" == "RUNNING" ]]; then
finished=false
elif [[ "${state}" == "DEAD" ]]; then
echo "FATAL ERROR: ${BASH_SOURCE[0]} one or more builds failed!"
# TODO add capability to determine which build(s) failed
exit 2
else
echo "FATAL ERROR: ${BASH_SOURCE[0]} rocoto failed with state '${state}'"
exit 3
rm -f logs/error.logs
# Determine which build(s) failed
stat_out="$(rocotostat -w "${build_xml}" -d "${build_db}")"
echo "${stat_out}" > rocotostat.out
line_number=0
while read -r line; do
(( line_number += 1 ))
# Skip the first two lines (header)
if [[ ${line_number} -lt 3 ]]; then
continue
fi

if [[ "${line}" =~ "DEAD" || "${line}" =~ "UNKNOWN" ||
"${line}" =~ "UNAVAILABLE" || "${line}" =~ "FAIL" ]]; then
job=$(echo "${line}" | awk '{ print $2 }')
log_file="logs/${job}.log"
echo "${log_file}" >> logs/error.logs
echo "Rocoto reported that the build failed for ${job}"
fi
done < rocotostat.out
exit 2
fi
done

Expand Down
12 changes: 0 additions & 12 deletions workflow/build_opts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,72 +23,60 @@ systems:
build:
gfs_model:
command: "./build_ufs.sh -e gfs_model.x -j 12"
log: "build_ufs_gfs.log"
cores: 12
walltime: "00:30:00"

gfs_ww3prepost:
command: "./build_ww3prepost.sh -j 4"
log: "build_ww3prepost_gfs.log"
cores: 4
walltime: "00:10:00"

gefs_model:
command: "./build_ufs.sh -w -e gefs_model.x -j 12"
log: "build_ufs_gefs.log"
cores: 12
walltime: "00:30:00"

gefs_ww3_prepost:
command: "./build_ww3prepost.sh -w -j 4"
log: "build_ww3prepost_gefs.log"
cores: 4
walltime: "00:10:00"

sfs_model:
command: "./build_ufs.sh -y -e sfs_model.x -j 12"
log: "build_ufs_sfs.log"
cores: 12
walltime: "00:30:00"

upp:
command: "./build_upp.sh -j 8"
log: "build_upp.log"
cores: 8
walltime: "00:10:00"

gsi_enkf:
command: "./build_gsi_enkf.sh -j 8"
log: "build_gsi_enkf.log"
cores: 8
walltime: "00:15:00"

gsi_monitor:
command: "./build_gsi_monitor.sh -j 4"
log: "build_gsi_monitor.log"
cores: 4
walltime: "00:10:00"

gsi_utils:
command: "./build_gsi_utils.sh -j 6"
log: "build_gsi_utils.log"
cores: 6
walltime: "00:10:00"

ufs_utils:
command: "./build_ufs_utils.sh -j 8"
log: "build_ufs_utils.log"
cores: 8
walltime: "00:10:00"

gfs_utils:
command: "./build_gfs_utils.sh -j 6"
log: "build_gfs_utils.log"
cores: 6
walltime: "00:10:00"

gdas:
command: "./build_gdas.sh -j 24"
log: "build_gdas.log"
cores: 24
walltime: "01:30:00"

0 comments on commit 989948c

Please sign in to comment.