-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CI cron jobs #1476
Merged
WalterKolczynski-NOAA
merged 125 commits into
NOAA-EMC:develop
from
TerrenceMcGuinness-NOAA:feature_1428_CI-cronjobs
Apr 21, 2023
Merged
Add CI cron jobs #1476
Changes from 123 commits
Commits
Show all changes
125 commits
Select commit
Hold shift + click to select a range
a2faebc
disambiguated env vars for HOMEgfs and GFS_CI_ROOT and removed re-ass…
TerryMcGuinness-NOAA 37b0c15
debugged updates to scripts (typos ect)
TerryMcGuinness-NOAA 37cfedb
Update create_experiment.py
TerrenceMcGuinness-NOAA 349a383
Update driver.sh
TerrenceMcGuinness-NOAA f111c47
Update clone-build_ci.sh
TerrenceMcGuinness-NOAA 619bdce
added another layer in file structure for experments where each exper…
TerryMcGuinness-NOAA 28a509b
Merge branch 'NOAA-EMC:develop' into feature_1428_CI-cronjobs
TerrenceMcGuinness-NOAA efd04aa
fixed bugs with tree restructure under ../PR/{PR#}/RUNTESTS
TerryMcGuinness-NOAA b7df0e7
spelling errors in create experiment
TerryMcGuinness-NOAA e2c211d
added run_ci.sh that is used in cron to run expirments
TerryMcGuinness-NOAA 07c81e7
removed --login from shabang in bash scripts
TerryMcGuinness-NOAA 7cca618
added environment for orion
b0fcb3d
fixed bug with needing updated git from module load on orion
801bbf3
added correct ICDIR to orion and module load module_ci for uniformall…
TerryMcGuinness-NOAA e76d66a
Merge branch 'NOAA-EMC:develop' into feature_1428_CI-cronjobs
TerrenceMcGuinness-NOAA def8455
Merge branch 'NOAA-EMC:develop' into feature_1428_CI-cronjobs
TerrenceMcGuinness-NOAA b067ed6
added old python compair GFS folders for development
TerryMcGuinness-NOAA 7343b27
added Execute class for nccnp to comparitor
TerryMcGuinness-NOAA 393d570
udpate logging level and fixed spelling errors
TerryMcGuinness-NOAA c2cb34d
added not none over len 0 for support Null return on Execute on nccmp
TerryMcGuinness-NOAA b7e51db
cleaned up and and made outout human readable for the comaritor code
TerryMcGuinness-NOAA 96d8498
update GitHub labels to all start with CI
TerryMcGuinness-NOAA b905ef3
format output dropped f and added nccmp to orion env modufile
TerryMcGuinness-NOAA 4abb87f
added grib file checker with corrlation checks in compare folders script
TerryMcGuinness-NOAA 1d75a06
got wgrib2 checker to work
TerryMcGuinness-NOAA 2eee604
added wgrib2 to ci module file for Hera
TerryMcGuinness-NOAA 72a4bfd
had to add hpc 1.1.0 to module file to get wgrib2
TerryMcGuinness-NOAA a3324a6
fixed module load order for virtutal python environment
TerryMcGuinness-NOAA 88a9185
started code cleanup, removed job switches for storing a yaml file of…
TerryMcGuinness-NOAA 4fa9e3a
removed import collections
TerryMcGuinness-NOAA 888a400
test git edit
TerrenceMcGuinness-NOAA 3ecca64
pcode edits
TerrenceMcGuinness-NOAA 3882cac
more pycode edits
TerrenceMcGuinness-NOAA 227dad8
more pycode edits
TerrenceMcGuinness-NOAA a26d4af
more pycode edits
TerrenceMcGuinness-NOAA 5f3535f
more pycode edits
TerrenceMcGuinness-NOAA bf3f5cc
more pycode edits
TerrenceMcGuinness-NOAA 2f9b0a5
few more pycode edits
TerrenceMcGuinness-NOAA 2f72f48
pycode edits
TerrenceMcGuinness-NOAA dd81b6e
two more pycode edits
TerrenceMcGuinness-NOAA 2773f09
bash lint edit
TerrenceMcGuinness-NOAA 44226f2
fixed some formatting issues from pycode updates
TerryMcGuinness-NOAA e127ed2
some more cleaning up format
TerryMcGuinness-NOAA ce362ea
moved module load in driver
TerryMcGuinness-NOAA eb7471b
added ignore list for wild cards
TerryMcGuinness-NOAA ec71918
removed module load in driver and added rm pr_list at the end if used…
TerryMcGuinness-NOAA 1bc444f
fix syntax error with echo at end of clone-build
TerryMcGuinness-NOAA 2ee5051
need to remove set -e from driver and build scripts to that CI system…
TerryMcGuinness-NOAA 522aa27
added checks and output results for checkout in clone-build script
TerryMcGuinness-NOAA 59c3226
moved message sent to GitHub on the status of each PR on pass or fail…
TerryMcGuinness-NOAA 06f902e
added two seperate module loads for workflow and CI, fixed some messa…
TerryMcGuinness-NOAA aadb132
added gwci and gwsetup module files for orion
TerryMcGuinness-NOAA 909a31b
update machine gwsetup module load in run_ci script
TerryMcGuinness-NOAA cb0ed72
Merge branch 'NOAA-EMC:develop' into feature_1428_CI-cronjobs
TerrenceMcGuinness-NOAA 7333130
Merge branch 'NOAA-EMC:develop' into feature_1428_CI-cronjobs
TerrenceMcGuinness-NOAA adf6809
udpated gwci on orion for threaded version of nccmp, updated reportin…
TerryMcGuinness-NOAA 1da08ab
Merge branch 'feature_1428_CI-cronjobs' of github.com:TerrenceMcGuinn…
TerryMcGuinness-NOAA 8486d1d
cleaned up path reporting in compare folders and fixed dependacies in…
TerryMcGuinness-NOAA 0a83799
updated verbose output and added ignore list in file count conformity…
TerryMcGuinness-NOAA 8698f71
few pythoncode lint updates
TerryMcGuinness-NOAA ee50f86
more pycode linting (spaces and commas)
TerryMcGuinness-NOAA b0ad92c
Merge branch 'NOAA-EMC:develop' into feature_1428_CI-cronjobs
TerrenceMcGuinness-NOAA 535721f
added || exit on cd (change directory) in clone-build BASH script
TerryMcGuinness-NOAA aae6072
Merge branch 'feature_1428_CI-cronjobs' of github.com:TerrenceMcGuinn…
TerryMcGuinness-NOAA 2fc7b44
indentation for visual effect PIP8
TerryMcGuinness-NOAA 126d435
indentation for visual effect PIP8 E127, again
TerryMcGuinness-NOAA 74415b3
PIP8 E127 wanted alignment after continuation line to be a regular in…
TerryMcGuinness-NOAA a71a916
PEP8 black line had spaces
TerryMcGuinness-NOAA a3f05bb
type spelling error of directories
TerryMcGuinness-NOAA 6d421e4
Merge branch 'NOAA-EMC:develop' into feature_1428_CI-cronjobs
TerrenceMcGuinness-NOAA c0287ba
Update ci/scripts/clone-build_ci.sh
TerrenceMcGuinness-NOAA 8009fb2
Update ci/scripts/run_ci.sh
TerrenceMcGuinness-NOAA 94f8c8a
Update ci/experiments/C96_atm3DVar.yaml
TerrenceMcGuinness-NOAA e6ffad4
Update ci/scripts/clone-build_ci.sh
TerrenceMcGuinness-NOAA 5080370
Update ci/scripts/run_ci.sh
TerrenceMcGuinness-NOAA 0b8f38d
Apply suggestions from code review
TerrenceMcGuinness-NOAA 3e4e921
Update ci/scripts/clone-build_ci.sh
TerrenceMcGuinness-NOAA 22a9073
Update ci/scripts/driver.sh
TerrenceMcGuinness-NOAA 8f04d79
Update ci/scripts/run_ci.sh
TerrenceMcGuinness-NOAA 6889ee9
Update ci/scripts/run_ci.sh
TerrenceMcGuinness-NOAA 856bb2b
Update ci/scripts/run_ci.sh
TerrenceMcGuinness-NOAA bb34e9c
added module-setup.sh in place of module purge
TerryMcGuinness-NOAA f990c9c
couple more suggestions, fix build_status off of link and more build …
TerryMcGuinness-NOAA 86d6104
just moved an export to where it is more approprate
TerryMcGuinness-NOAA 530882a
improved symantics by replacing environments with platform and experm…
TerryMcGuinness-NOAA 969877b
Update diff_grib_files.py
TerrenceMcGuinness-NOAA dffadd3
Delete C96_atm3DVar_also.yaml
TerrenceMcGuinness-NOAA aa21ef7
added second case C96C48-hyb-ATM-DA
TerryMcGuinness-NOAA e68fa99
Update run_ci.sh
TerrenceMcGuinness-NOAA 51a55d4
fixed fail logic in driver for setupexpt and bug with path in yaml fo…
TerryMcGuinness-NOAA 5818dcb
Merge branch 'feature_1428_CI-cronjobs' of github.com:TerrenceMcGuinn…
TerryMcGuinness-NOAA 1f27cd9
Merge branch 'NOAA-EMC:develop' into feature_1428_CI-cronjobs
TerrenceMcGuinness-NOAA e9036cf
fixed updated path to EXPDIR for staged test cases in run_ci script
TerryMcGuinness-NOAA c0ad448
Added additional script to check to see if experments have completed …
TerryMcGuinness-NOAA 8afa313
added new label stage to include CI--Building before Running
TerryMcGuinness-NOAA 5bec286
moved check for open PR after it is cloned
TerryMcGuinness-NOAA 16a82f6
updated old repo_url varible name in check script
TerryMcGuinness-NOAA 51700d4
added comment to GitHub when case completes
TerryMcGuinness-NOAA 482fc31
added cool SHELLCHECK suggestiongs (amazing tool)
TerryMcGuinness-NOAA c1d677f
Merge branch 'feature_1428_CI-cronjobs' of github.com:TerrenceMcGuinn…
TerryMcGuinness-NOAA e850d6d
Update check_ci.sh
TerrenceMcGuinness-NOAA 32396e7
Update check_ci.sh
TerrenceMcGuinness-NOAA 54e9ebe
added a could of shellcheck suggestions for || true
TerryMcGuinness-NOAA 3d0c07b
Merge branch 'feature_1428_CI-cronjobs' of github.com:TerrenceMcGuinn…
TerryMcGuinness-NOAA a51661c
Update module_gwci.orion.lua
TerrenceMcGuinness-NOAA 9865a74
Update modulefiles/module_gwci.orion.lua
TerrenceMcGuinness-NOAA 3404bff
Update modulefiles/module_gwci.orion.lua
TerrenceMcGuinness-NOAA 3e7a9af
Update modulefiles/module_gwci.hera.lua
TerrenceMcGuinness-NOAA 2d36572
Merge branch 'NOAA-EMC:develop' into feature_1428_CI-cronjobs
TerrenceMcGuinness-NOAA 9851300
added set -e at top of BASH scripts and then only disabled it when we…
TerryMcGuinness-NOAA cdc57ce
fixed login of label update in check_ci script and added parallel ver…
TerryMcGuinness-NOAA 07ddb49
improved login for success of PR with check_ci script
TerryMcGuinness-NOAA 737483f
forgot to add removing of PR from list on successfully completing all…
TerryMcGuinness-NOAA 8c6d13d
forgot to add removing of PR from list on successfully completing all…
TerryMcGuinness-NOAA a64d1ab
fixed bug with counting remaining cases
TerryMcGuinness-NOAA 0423bb9
added || true to BASH command for shellnorms in check ci script
TerryMcGuinness-NOAA e6f4550
fixed race condition for check_ci script thinking success before expe…
TerryMcGuinness-NOAA daebe97
Upates to final success check with multiple cases in check_ci ie num_…
TerryMcGuinness-NOAA 4b7a73a
Update check_ci.sh
TerrenceMcGuinness-NOAA 458c5ea
Merge branch 'NOAA-EMC:develop' into feature_1428_CI-cronjobs
TerrenceMcGuinness-NOAA dc87c92
Update clone-build_ci.sh
TerrenceMcGuinness-NOAA 0779ff6
couple of bug updates for check script when deleting successfull PRs,…
TerryMcGuinness-NOAA 0140a17
Merge branch 'feature_1428_CI-cronjobs' of github.com:TerrenceMcGuinn…
TerryMcGuinness-NOAA ff73987
Update check_ci.sh
TerrenceMcGuinness-NOAA c183221
updated nccmp 1.8.7.0 and fixed a shellnorm typo to close quote
TerryMcGuinness-NOAA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
experiment: | ||
mode: cycled | ||
|
||
arguments: | ||
app: ATM | ||
resdet: 96 | ||
resens: 48 | ||
comrot: ${RUNTESTS}/${pslot}/COMROT | ||
expdir: ${RUNTESTS}/${pslot}/EXPDIR | ||
icsdir: ${ICSDIR_ROOT}/C96C48 | ||
idate: 2021122018 | ||
edate: 2021122200 | ||
nens: 2 | ||
gfs_cyc: 1 | ||
start: cold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
experiment: | ||
mode: cycled | ||
|
||
arguments: | ||
app: ATM | ||
resdet: 96 | ||
comrot: ${RUNTESTS}/${pslot}/COMROT | ||
expdir: ${RUNTESTS}/${pslot}/EXPDIR | ||
icsdir: ${ICSDIR_ROOT}/C96C48 | ||
idate: 2021122018 | ||
edate: 2021122100 | ||
nens: 0 | ||
gfs_cyc: 1 | ||
start: cold |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
#!/usr/bin/bash | ||
export GFS_CI_ROOT=/scratch1/NCEPDEV/global/Terry.McGuinness/GFS_CI_ROOT | ||
export GFS_MODULE_USE="${GFS_CI_ROOT}/global-workflow/modulefiles" | ||
export SLURM_ACCOUNT=fv3-cpu | ||
export SALLOC_ACCOUNT="${SLURM_ACCOUNT}" | ||
export SBATCH_ACCOUNT="${SLURM_ACCOUNT}" | ||
export SLURM_QOS=debug | ||
export repo_url="https://github.com/NOAA-EMC/global-workflow.git" | ||
#export repo_url="https://github.com/TerrenceMcGuinness-NOAA/global-workflow.git" | ||
export ICSDIR_ROOT="/scratch1/NCEPDEV/global/glopara/data/ICSDIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
#!/bin/bash | ||
set -eux | ||
##################################################################################### | ||
# | ||
# Script description: BASH script for checking for cases in a given PR and | ||
# running rocotostat on each to determine if the experiment has | ||
# succeeded or faild. This script is intended | ||
# to run from within a cron job in the CI Managers account | ||
# Abstract TODO | ||
##################################################################################### | ||
|
||
HOMEgfs="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null 2>&1 && pwd )" | ||
scriptname=$(basename "${BASH_SOURCE[0]}") | ||
echo "Begin ${scriptname} at $(date -u)" || true | ||
export PS4='+ $(basename ${BASH_SOURCE})[${LINENO}]' | ||
|
||
GH=${HOME}/bin/gh | ||
REPO_URL=${REPO_URL:-"https://github.com/NOAA-EMC/global-workflow.git"} | ||
|
||
######################################################################### | ||
# Set up runtime environment varibles for accounts on supproted machines | ||
######################################################################### | ||
|
||
source "${HOMEgfs}/ush/detect_machine.sh" | ||
case ${MACHINE_ID} in | ||
hera | orion) | ||
echo "Running Automated Testing on ${MACHINE_ID}" | ||
source "${HOMEgfs}/ci/platforms/${MACHINE_ID}.sh" | ||
;; | ||
*) | ||
echo "Unsupported platform. Exiting with error." | ||
exit 1 | ||
;; | ||
esac | ||
set +x | ||
source "${HOMEgfs}/ush/module-setup.sh" | ||
module use "${HOMEgfs}/modulefiles" | ||
module load "module_gwsetup.${MACHINE_ID}" | ||
module list | ||
set -x | ||
rocotostat=$(which rocotostat) | ||
if [[ -z ${rocotostat+x} ]]; then | ||
echo "rocotostat not found on system" | ||
exit 1 | ||
else | ||
echo "rocotostat being used from ${rocotostat}" | ||
fi | ||
|
||
pr_list_file="open_pr_list" | ||
|
||
if [[ -s "${GFS_CI_ROOT}/${pr_list_file}" ]]; then | ||
pr_list=$(cat "${GFS_CI_ROOT}/${pr_list_file}") | ||
else | ||
echo "no PRs to process .. exit" | ||
exit 0 | ||
fi | ||
|
||
############################################################# | ||
# Loop throu all PRs in PR List and look for expirments in | ||
# the RUNTESTS dir and for each one run runcotorun on them | ||
############################################################# | ||
|
||
for pr in ${pr_list}; do | ||
id=$("${GH}" pr view "${pr}" --repo "${REPO_URL}" --json id --jq '.id') | ||
echo "Processing Pull Request #${pr} and looking for cases" | ||
pr_dir="${GFS_CI_ROOT}/PR/${pr}" | ||
|
||
# If there is no RUNTESTS dir for this PR then cases have not been made yet | ||
if [[ ! -d "${pr_dir}/RUNTESTS" ]]; then | ||
continue | ||
fi | ||
num_cases=$(find "${pr_dir}/RUNTESTS" -mindepth 1 -maxdepth 1 -type d | wc -l) || true | ||
|
||
#Check for PR success when ${pr_dir}/RUNTESTS is void of subfolders | ||
# since all successfull ones where previously removed | ||
if [[ "${num_cases}" -eq 0 ]] && [[ -d "${pr_dir}/RUNTESTS" ]]; then | ||
"${GH}" pr edit --repo "${REPO_URL}" "${pr}" --remove-label "CI-${MACHINE_ID^}-Running" --add-label "CI-${MACHINE_ID^}-Passed" | ||
sed -i "/${pr}/d" "${GFS_CI_ROOT}/${pr_list_file}" | ||
# Completely remove the PR and its cloned repo on sucess of all cases | ||
rm -Rf ${pr_dir} | ||
|
||
continue | ||
fi | ||
|
||
for cases in "${pr_dir}/RUNTESTS/"*; do | ||
pslot=$(basename "${cases}") | ||
xml="${pr_dir}/RUNTESTS/${pslot}/EXPDIR/${pslot}/${pslot}.xml" | ||
db="${pr_dir}/RUNTESTS/${pslot}/EXPDIR/${pslot}/${pslot}.db" | ||
rocoto_stat_output=$("${rocotostat}" -w "${xml}" -d "${db}" -s | grep -v CYCLE) || true | ||
num_cycles=$(echo "${rocoto_stat_output}" | wc -l) || true | ||
num_done=$(echo "${rocoto_stat_output}" | grep -c Done) || true | ||
num_succeeded=$("${rocotostat}" -w "${xml}" -d "${db}" -a | grep -c SUCCEEDED) || true | ||
echo "${pslot} Total Cycles: ${num_cycles} number done: ${num_done}" || true | ||
num_failed=$("${rocotostat}" -w "${xml}" -d "${db}" -a | grep -c -E 'FAIL|DEAD') || true | ||
if [[ ${num_failed} -ne 0 ]]; then | ||
{ | ||
echo "Experiment ${pslot} Terminated: *FAILED*" | ||
echo "Experiment ${pslot} Terminated with ${num_failed} tasks failed at $(date)" || true | ||
} >> "${GFS_CI_ROOT}/PR/${pr}/output_${id}" | ||
"${GH}" pr edit --repo "${REPO_URL}" "${pr}" --remove-label "CI-${MACHINE_ID^}-Running" --add-label "CI-${MACHINE_ID^}-Failed" | ||
"${GH}" pr comment "${pr}" --repo "${REPO_URL}" --body-file "${GFS_CI_ROOT}/PR/${pr}/output_${id}" | ||
sed -i "/${pr}/d" "${GFS_CI_ROOT}/${pr_list_file}" | ||
fi | ||
if [[ "${num_done}" -eq "${num_cycles}" ]]; then | ||
{ | ||
echo "Experiment ${pslot} completed: *SUCCESS*" | ||
echo "Experiment ${pslot} Completed at $(date)" || true | ||
echo -n "with ${num_succeeded} successfully completed jobs" || true | ||
} >> "${GFS_CI_ROOT}/PR/${pr}/output_${id}" | ||
"${GH}" pr comment "${pr}" --repo "${REPO_URL}" --body-file "${GFS_CI_ROOT}/PR/${pr}/output_${id}" | ||
#Remove Experment cases that completed successfully | ||
rm -Rf "${pr_dir}/RUNTESTS/${pslot}" | ||
fi | ||
done | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / shellcheck
Double quote to prevent globbing and word splitting.