From 860830233201186361b204ffea368f6df22087cb Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 13 Oct 2023 14:32:54 -0400 Subject: [PATCH 1/9] add a soca test --- ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml | 18 ++++++++++++++++++ ci/cases/{pr => pr_disable}/C48_ATM.yaml | 2 +- ci/cases/{pr => pr_disable}/C48_S2SA_gefs.yaml | 0 ci/cases/{pr => pr_disable}/C48_S2SW.yaml | 2 +- .../{pr => pr_disable}/C96C48_hybatmDA.yaml | 2 +- ci/cases/{pr => pr_disable}/C96_atm3DVar.yaml | 2 +- ...ts_ci-updates.yaml => gfs_defaults_ci.yaml} | 0 ci/platforms/soca_gfs_defaults_ci.yaml | 6 ++++++ parm/config/gefs/config.base.emc.dyn | 6 +++--- parm/config/gfs/config.base.emc.dyn | 10 +++++----- parm/config/gfs/config.ocnanal | 9 ++++----- parm/config/gfs/yaml/defaults.yaml | 18 ++++++++++-------- workflow/setup_expt.py | 4 ---- 13 files changed, 50 insertions(+), 29 deletions(-) create mode 100644 ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml rename ci/cases/{pr => pr_disable}/C48_ATM.yaml (75%) rename ci/cases/{pr => pr_disable}/C48_S2SA_gefs.yaml (100%) rename ci/cases/{pr => pr_disable}/C48_S2SW.yaml (75%) rename ci/cases/{pr => pr_disable}/C96C48_hybatmDA.yaml (81%) rename ci/cases/{pr => pr_disable}/C96_atm3DVar.yaml (80%) rename ci/platforms/{gfs_defaults_ci-updates.yaml => gfs_defaults_ci.yaml} (100%) create mode 100644 ci/platforms/soca_gfs_defaults_ci.yaml diff --git a/ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml b/ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml new file mode 100644 index 0000000000..95f45b10a2 --- /dev/null +++ b/ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml @@ -0,0 +1,18 @@ +experiment: + type: gfs + mode: cycled + +arguments: + pslot: ${pslot} + app: S2S + resdet: 48 + comrot: ${RUNTESTS}/COMROT + expdir: ${RUNTESTS}/EXPDIR + # icsdir: ${ICSDIR_ROOT}/C48cpldDA + icsdir: "/scratch2/NCEPDEV/ocean/Guillaume.Vernieres/data/ICSDIR/C48O500" + idate: 2021032312 + edate: 2021032400 + nens: 0 + gfs_cyc: 0 + start: warm + yaml: ${HOMEgfs_PR}/ci/platforms/soca_gfs_defaults_ci.yaml diff --git a/ci/cases/pr/C48_ATM.yaml b/ci/cases/pr_disable/C48_ATM.yaml similarity index 75% rename from ci/cases/pr/C48_ATM.yaml rename to ci/cases/pr_disable/C48_ATM.yaml index ccb001d296..1a6aef5e9d 100644 --- a/ci/cases/pr/C48_ATM.yaml +++ b/ci/cases/pr_disable/C48_ATM.yaml @@ -10,4 +10,4 @@ arguments: expdir: ${RUNTESTS}/EXPDIR idate: 2021032312 edate: 2021032312 - yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci-updates.yaml + yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/cases/pr/C48_S2SA_gefs.yaml b/ci/cases/pr_disable/C48_S2SA_gefs.yaml similarity index 100% rename from ci/cases/pr/C48_S2SA_gefs.yaml rename to ci/cases/pr_disable/C48_S2SA_gefs.yaml diff --git a/ci/cases/pr/C48_S2SW.yaml b/ci/cases/pr_disable/C48_S2SW.yaml similarity index 75% rename from ci/cases/pr/C48_S2SW.yaml rename to ci/cases/pr_disable/C48_S2SW.yaml index aba66cb4f3..865d97469d 100644 --- a/ci/cases/pr/C48_S2SW.yaml +++ b/ci/cases/pr_disable/C48_S2SW.yaml @@ -10,4 +10,4 @@ arguments: expdir: ${RUNTESTS}/EXPDIR idate: 2021032312 edate: 2021032312 - yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci-updates.yaml + yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/cases/pr/C96C48_hybatmDA.yaml b/ci/cases/pr_disable/C96C48_hybatmDA.yaml similarity index 81% rename from ci/cases/pr/C96C48_hybatmDA.yaml rename to ci/cases/pr_disable/C96C48_hybatmDA.yaml index 660291a3be..25abe81384 100644 --- a/ci/cases/pr/C96C48_hybatmDA.yaml +++ b/ci/cases/pr_disable/C96C48_hybatmDA.yaml @@ -15,4 +15,4 @@ arguments: nens: 2 gfs_cyc: 1 start: cold - yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci-updates.yaml + yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/cases/pr/C96_atm3DVar.yaml b/ci/cases/pr_disable/C96_atm3DVar.yaml similarity index 80% rename from ci/cases/pr/C96_atm3DVar.yaml rename to ci/cases/pr_disable/C96_atm3DVar.yaml index f103f08d1f..e90ff53aaf 100644 --- a/ci/cases/pr/C96_atm3DVar.yaml +++ b/ci/cases/pr_disable/C96_atm3DVar.yaml @@ -14,4 +14,4 @@ arguments: nens: 0 gfs_cyc: 1 start: cold - yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci-updates.yaml + yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/platforms/gfs_defaults_ci-updates.yaml b/ci/platforms/gfs_defaults_ci.yaml similarity index 100% rename from ci/platforms/gfs_defaults_ci-updates.yaml rename to ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/platforms/soca_gfs_defaults_ci.yaml b/ci/platforms/soca_gfs_defaults_ci.yaml new file mode 100644 index 0000000000..244c235860 --- /dev/null +++ b/ci/platforms/soca_gfs_defaults_ci.yaml @@ -0,0 +1,6 @@ +defaults: + !INC {{ HOMEgfs }}/parm/config/gfs/yaml/defaults.yaml +base: + ACCOUNT: ${SLURM_ACCOUNT} + DOIAU: "NO" + DO_JEDIOCNVAR: "YES" diff --git a/parm/config/gefs/config.base.emc.dyn b/parm/config/gefs/config.base.emc.dyn index 7140ef477b..ed4efc2910 100644 --- a/parm/config/gefs/config.base.emc.dyn +++ b/parm/config/gefs/config.base.emc.dyn @@ -138,7 +138,7 @@ export DO_WAVE="NO" export DO_OCN="NO" export DO_ICE="NO" export DO_AERO="NO" -export CCPP_SUITE="@CCPP_SUITE@" +export CCPP_SUITE="FV3_GFS_v17_p8" export WAVE_CDUMP="" # When to include wave suite: gdas, gfs, or both export DOBNDPNT_WAVE="NO" export cplwav2atm=".false." @@ -204,7 +204,7 @@ case "${APP}" in export DO_COUPLED="YES" export DO_OCN="YES" export DO_ICE="YES" - export CCPP_SUITE="FV3_GFS_v17_coupled_p8" + export CCPP_SUITE="FV3_GFS_v17_coupled_p8" # TODO: Does this include FV3_GFS_v17_p8? Can this be used instead of FV3_GFS_v17_p8 on L141 export confignamevarfornems="cpld" if [[ "${APP}" =~ A$ ]]; then @@ -264,7 +264,7 @@ export FLTFILEGFS="${PARMgfs}/post/postxconfig-NT-GEFS.txt" export FLTFILEGFSF00="${PARMgfs}/post/postxconfig-NT-GEFS-F00.txt" # Microphysics Options: 99-ZhaoCarr, 8-Thompson; 6-WSM6, 10-MG, 11-GFDL -export imp_physics=@IMP_PHYSICS@ +export imp_physics=8 # Shared parameters # DA engine diff --git a/parm/config/gfs/config.base.emc.dyn b/parm/config/gfs/config.base.emc.dyn index db4cd22e7f..713370d71e 100644 --- a/parm/config/gfs/config.base.emc.dyn +++ b/parm/config/gfs/config.base.emc.dyn @@ -146,14 +146,14 @@ export DO_WAVE="NO" export DO_OCN="NO" export DO_ICE="NO" export DO_AERO="NO" -export CCPP_SUITE="@CCPP_SUITE@" +export CCPP_SUITE="FV3_GFS_v17_p8" export WAVE_CDUMP="" # When to include wave suite: gdas, gfs, or both export DOBNDPNT_WAVE="NO" export cplwav2atm=".false." export FRAC_GRID=".true." # Set operational resolution -export OPS_RES="C768" # Do not change +export OPS_RES="C768" # Do not change # TODO: Why is this needed and where is it used? # Resolution specific parameters export LEVS=128 @@ -212,7 +212,7 @@ case "${APP}" in export DO_COUPLED="YES" export DO_OCN="YES" export DO_ICE="YES" - export CCPP_SUITE="FV3_GFS_v17_coupled_p8" + export CCPP_SUITE="FV3_GFS_v17_coupled_p8" # TODO: Does this include FV3_GFS_v17_p8? Can this be used instead of FV3_GFS_v17_p8 on L149 export confignamevarfornems="cpld" if [[ "${APP}" =~ A$ ]]; then @@ -284,7 +284,7 @@ export WRITE_DOPOST=".true." # WRITE_DOPOST=true, use inline POST export WRITE_NSFLIP=".true." # IAU related parameters -export DOIAU="YES" # Enable 4DIAU for control with 3 increments +export DOIAU="@DOIAU@" # Enable 4DIAU for control with 3 increments export IAUFHRS="3,6,9" export IAU_FHROT=${IAUFHRS%%,*} export IAU_DELTHRS=6 @@ -302,7 +302,7 @@ export lobsdiag_forenkf=".true." # fi # Microphysics Options: 99-ZhaoCarr, 8-Thompson; 6-WSM6, 10-MG, 11-GFDL -export imp_physics=@IMP_PHYSICS@ +export imp_physics=8 # Shared parameters # DA engine diff --git a/parm/config/gfs/config.ocnanal b/parm/config/gfs/config.ocnanal index 36519c7f35..ec45ddd288 100644 --- a/parm/config/gfs/config.ocnanal +++ b/parm/config/gfs/config.ocnanal @@ -5,17 +5,16 @@ echo "BEGIN: config.ocnanal" -export OBS_YAML_DIR=${HOMEgfs}/sorc/gdas.cd/parm/soca/obs/config +export OBS_YAML_DIR="${HOMEgfs}/sorc/gdas.cd/parm/soca/obs/config" export OBS_LIST=@SOCA_OBS_LIST@ -[[ -n "${OBS_LIST}" ]] || export OBS_LIST=${HOMEgfs}/sorc/gdas.cd/parm/soca/obs/obs_list.yaml -export OBS_YAML=${OBS_LIST} -export FV3JEDI_STAGE_YAML=${HOMEgfs}/sorc/gdas.cd/test/soca/testinput/dumy.yaml +export OBS_YAML="${OBS_LIST}" +export FV3JEDI_STAGE_YAML="${HOMEgfs}/sorc/gdas.cd/test/soca/testinput/dumy.yaml" export SOCA_INPUT_FIX_DIR=@SOCA_INPUT_FIX_DIR@ export SOCA_VARS=tocn,socn,ssh export SABER_BLOCKS_YAML=@SABER_BLOCKS_YAML@ export SOCA_NINNER=@SOCA_NINNER@ export CASE_ANL=@CASE_ANL@ -export DOMAIN_STACK_SIZE=116640000 #TODO: Make the stack size reolution dependent +export DOMAIN_STACK_SIZE=116640000 #TODO: Make the stack size resolution dependent export JEDI_BIN=${HOMEgfs}/sorc/gdas.cd/build/bin # R2D2 diff --git a/parm/config/gfs/yaml/defaults.yaml b/parm/config/gfs/yaml/defaults.yaml index 202efc2270..112087bcbd 100644 --- a/parm/config/gfs/yaml/defaults.yaml +++ b/parm/config/gfs/yaml/defaults.yaml @@ -1,9 +1,11 @@ base: + DOIAU: "YES" DO_JEDIATMVAR: "NO" DO_JEDIATMENS: "NO" DO_JEDIOCNVAR: "NO" DO_JEDILANDDA: "NO" DO_MERGENSST: "NO" + aeroanl: IO_LAYOUT_X: 1 IO_LAYOUT_Y: 1 @@ -13,13 +15,13 @@ landanl: IO_LAYOUT_Y: 1 ocnanal: - SOCA_INPUT_FIX_DIR: '/scratch2/NCEPDEV/ocean/Guillaume.Vernieres/data/static/72x35x25' - CASE_ANL: 'C48' - SOCA_OBS_LIST: '' - COMIN_OBS: '/scratch2/NCEPDEV/marineda/r2d2' - SABER_BLOCKS_YAML: '' - SOCA_NINNER: 50 - R2D2_OBS_SRC: 'gdas_marine' - R2D2_OBS_DUMP: 's2s_v1' + SOCA_INPUT_FIX_DIR: "/scratch2/NCEPDEV/ocean/Guillaume.Vernieres/data/static/72x35x25/soca" + CASE_ANL: "C48" + COMIN_OBS: "/scratch2/NCEPDEV/marineda/r2d2-v2-v3" + SOCA_OBS_LIST: "{{ HOMEgfs }}/sorc/gdas.cd/parm/soca/obs/obs_list.yaml" + SOCA_NINNER: 100 + R2D2_OBS_SRC: "gdas_marine" + R2D2_OBS_DUMP: "s2s_v1" + SABER_BLOCKS_YAML: "" NICAS_RESOL: 1 NICAS_GRID_SIZE: 15000 diff --git a/workflow/setup_expt.py b/workflow/setup_expt.py index c9aa9188f6..a9810ec3f2 100755 --- a/workflow/setup_expt.py +++ b/workflow/setup_expt.py @@ -343,10 +343,6 @@ def edit_baseconfig(host, inputs, yaml_dict): } tmpl_dict = dict(tmpl_dict, **extend_dict) - # All apps and modes now use the same physics and CCPP suite by default - extend_dict = {"@CCPP_SUITE@": "FV3_GFS_v17_p8", "@IMP_PHYSICS@": 8} - tmpl_dict = dict(tmpl_dict, **extend_dict) - try: tmpl_dict = dict(tmpl_dict, **get_template_dict(yaml_dict['base'])) except KeyError: From eced3f4ade3ce9e7a6d7f5f686087582aa321f54 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 13 Oct 2023 15:31:30 -0400 Subject: [PATCH 2/9] replace HOMEgfs_PR with HOMEgfs, and HOMEgfs with ROOT_DIR. ROOT_DIR is the location where the ci scripts live --- ci/cases/{pr_disable => pr}/C48_ATM.yaml | 2 +- ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml | 4 +- ci/cases/pr_disable/C48_S2SA_gefs.yaml | 2 +- ci/cases/pr_disable/C48_S2SW.yaml | 2 +- ci/cases/pr_disable/C96C48_hybatmDA.yaml | 2 +- ci/cases/pr_disable/C96_atm3DVar.yaml | 2 +- ci/scripts/check_ci.sh | 24 ++++----- ci/scripts/clone-build_ci.sh | 4 +- ci/scripts/create_experiment.py | 2 +- ci/scripts/driver.sh | 68 ++++++++++++------------ ci/scripts/driver_weekly.sh | 16 +++--- ci/scripts/run_ci.sh | 14 ++--- parm/config/gfs/yaml/defaults.yaml | 4 +- 13 files changed, 72 insertions(+), 74 deletions(-) rename ci/cases/{pr_disable => pr}/C48_ATM.yaml (77%) diff --git a/ci/cases/pr_disable/C48_ATM.yaml b/ci/cases/pr/C48_ATM.yaml similarity index 77% rename from ci/cases/pr_disable/C48_ATM.yaml rename to ci/cases/pr/C48_ATM.yaml index 1a6aef5e9d..d563c6fba9 100644 --- a/ci/cases/pr_disable/C48_ATM.yaml +++ b/ci/cases/pr/C48_ATM.yaml @@ -10,4 +10,4 @@ arguments: expdir: ${RUNTESTS}/EXPDIR idate: 2021032312 edate: 2021032312 - yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci.yaml + yaml: ${HOMEgfs}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml b/ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml index 95f45b10a2..245a6a066d 100644 --- a/ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml +++ b/ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml @@ -9,10 +9,10 @@ arguments: comrot: ${RUNTESTS}/COMROT expdir: ${RUNTESTS}/EXPDIR # icsdir: ${ICSDIR_ROOT}/C48cpldDA - icsdir: "/scratch2/NCEPDEV/ocean/Guillaume.Vernieres/data/ICSDIR/C48O500" + icsdir: "/scratch2/NCEPDEV/ocean/Guillaume.Vernieres/data/ICSDIR/C48O500" # TODO: make platform agnostic idate: 2021032312 edate: 2021032400 nens: 0 gfs_cyc: 0 start: warm - yaml: ${HOMEgfs_PR}/ci/platforms/soca_gfs_defaults_ci.yaml + yaml: ${HOMEgfs}/ci/platforms/soca_gfs_defaults_ci.yaml diff --git a/ci/cases/pr_disable/C48_S2SA_gefs.yaml b/ci/cases/pr_disable/C48_S2SA_gefs.yaml index 4d5f066858..50f8df1d55 100644 --- a/ci/cases/pr_disable/C48_S2SA_gefs.yaml +++ b/ci/cases/pr_disable/C48_S2SA_gefs.yaml @@ -14,4 +14,4 @@ arguments: icsdir: ${ICSDIR_ROOT}/C48C48mx500 idate: 2021032312 edate: 2021032312 - yaml: ${HOMEgfs_PR}/ci/platforms/gefs_ci_defaults.yaml + yaml: ${HOMEgfs}/ci/platforms/gefs_ci_defaults.yaml diff --git a/ci/cases/pr_disable/C48_S2SW.yaml b/ci/cases/pr_disable/C48_S2SW.yaml index 865d97469d..63e175de80 100644 --- a/ci/cases/pr_disable/C48_S2SW.yaml +++ b/ci/cases/pr_disable/C48_S2SW.yaml @@ -10,4 +10,4 @@ arguments: expdir: ${RUNTESTS}/EXPDIR idate: 2021032312 edate: 2021032312 - yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci.yaml + yaml: ${HOMEgfs}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/cases/pr_disable/C96C48_hybatmDA.yaml b/ci/cases/pr_disable/C96C48_hybatmDA.yaml index 25abe81384..bd4810ebd1 100644 --- a/ci/cases/pr_disable/C96C48_hybatmDA.yaml +++ b/ci/cases/pr_disable/C96C48_hybatmDA.yaml @@ -15,4 +15,4 @@ arguments: nens: 2 gfs_cyc: 1 start: cold - yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci.yaml + yaml: ${HOMEgfs}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/cases/pr_disable/C96_atm3DVar.yaml b/ci/cases/pr_disable/C96_atm3DVar.yaml index e90ff53aaf..acd1a18690 100644 --- a/ci/cases/pr_disable/C96_atm3DVar.yaml +++ b/ci/cases/pr_disable/C96_atm3DVar.yaml @@ -14,4 +14,4 @@ arguments: nens: 0 gfs_cyc: 1 start: cold - yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci.yaml + yaml: ${HOMEgfs}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/scripts/check_ci.sh b/ci/scripts/check_ci.sh index b2c8129d32..d5cf6a20bd 100755 --- a/ci/scripts/check_ci.sh +++ b/ci/scripts/check_ci.sh @@ -2,13 +2,13 @@ set -eux ##################################################################################### # -# Script description: BASH script for checking for cases in a given PR and +# 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 ##################################################################################### -HOMEgfs="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null 2>&1 && pwd )" +ROOT_DIR="$(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}]' @@ -20,11 +20,11 @@ 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" +source "${ROOT_DIR}/ush/detect_machine.sh" case ${MACHINE_ID} in hera | orion) echo "Running Automated Testing on ${MACHINE_ID}" - source "${HOMEgfs}/ci/platforms/config.${MACHINE_ID}" + source "${ROOT_DIR}/ci/platforms/config.${MACHINE_ID}" ;; *) echo "Unsupported platform. Exiting with error." @@ -32,8 +32,8 @@ case ${MACHINE_ID} in ;; esac set +x -source "${HOMEgfs}/ush/module-setup.sh" -module use "${HOMEgfs}/modulefiles" +source "${ROOT_DIR}/ush/module-setup.sh" +module use "${ROOT_DIR}/modulefiles" module load "module_gwsetup.${MACHINE_ID}" module list set -x @@ -56,7 +56,7 @@ pr_list_dbfile="${GFS_CI_ROOT}/open_pr_list.db" pr_list="" if [[ -f "${pr_list_dbfile}" ]]; then - pr_list=$("${HOMEgfs}/ci/scripts/pr_list_database.py" --dbfile "${pr_list_dbfile}" --display | grep -v Failed | grep Running | awk '{print $1}') || true + pr_list=$("${ROOT_DIR}/ci/scripts/pr_list_database.py" --dbfile "${pr_list_dbfile}" --display | grep -v Failed | grep Running | awk '{print $1}') || true fi if [[ -z "${pr_list+x}" ]]; then echo "no PRs open and ready to run cases on .. exiting" @@ -85,7 +85,7 @@ for pr in ${pr_list}; do "${GH}" pr edit --repo "${REPO_URL}" "${pr}" --remove-label "CI-${MACHINE_ID^}-Running" --add-label "CI-${MACHINE_ID^}-Passed" sed -i "s/\`\`\`//2g" "${GFS_CI_ROOT}/PR/${pr}/output_${id}" "${GH}" pr comment "${pr}" --repo "${REPO_URL}" --body-file "${GFS_CI_ROOT}/PR/${pr}/output_${id}" - "${HOMEgfs}/ci/scripts/pr_list_database.py" --remove_pr "${pr}" --dbfile "${pr_list_dbfile}" + "${ROOT_DIR}/ci/scripts/pr_list_database.py" --remove_pr "${pr}" --dbfile "${pr_list_dbfile}" # Check to see if this PR that was opened by the weekly tests and if so close it if it passed on all platforms weekly_labels=$(${GH} pr view "${pr}" --repo "${REPO_URL}" --json headRefName,labels,author --jq 'select(.author.login | contains("emcbot")) | select(.headRefName | contains("weekly_ci")) | .labels[].name ') || true if [[ -n "${weekly_labels}" ]]; then @@ -103,8 +103,8 @@ for pr in ${pr_list}; do fi # Completely remove the PR and its cloned repo on sucess # of all cases on this platform - rm -Rf "${pr_dir}" - continue + rm -Rf "${pr_dir}" + continue fi for pslot_dir in "${pr_dir}/RUNTESTS/EXPDIR/"*; do @@ -134,10 +134,10 @@ for pr in ${pr_list}; do { echo "Error logs:" echo "${error_logs}" - } >> "${GFS_CI_ROOT}/PR/${pr}/output_${id}" + } >> "${GFS_CI_ROOT}/PR/${pr}/output_${id}" sed -i "s/\`\`\`//2g" "${GFS_CI_ROOT}/PR/${pr}/output_${id}" "${GH}" pr comment "${pr}" --repo "${REPO_URL}" --body-file "${GFS_CI_ROOT}/PR/${pr}/output_${id}" - "${HOMEgfs}/ci/scripts/pr_list_database.py" --remove_pr "${pr}" --dbfile "${pr_list_dbfile}" + "${ROOT_DIR}/ci/scripts/pr_list_database.py" --remove_pr "${pr}" --dbfile "${pr_list_dbfile}" for kill_cases in "${pr_dir}/RUNTESTS/"*; do pslot=$(basename "${kill_cases}") sacct --format=jobid,jobname%35,WorkDir%100,stat | grep "${pslot}" | grep "PR\/${pr}\/RUNTESTS" | awk '{print $1}' | xargs scancel || true diff --git a/ci/scripts/clone-build_ci.sh b/ci/scripts/clone-build_ci.sh index 83f43ef54b..796e4b7014 100755 --- a/ci/scripts/clone-build_ci.sh +++ b/ci/scripts/clone-build_ci.sh @@ -9,8 +9,8 @@ usage() { echo echo "Usage: $0 -p -d -o -h" echo - echo " -p PR nunber to clone and build" - echo " -d Full path of of were to clone and build PR" + echo " -p PR number to clone and build" + echo " -d Full path of of where to clone and build PR" echo " -o Full path to output message file detailing results of CI tests" echo " -h display this message and quit" echo diff --git a/ci/scripts/create_experiment.py b/ci/scripts/create_experiment.py index 3c5096e875..47c1e1429f 100755 --- a/ci/scripts/create_experiment.py +++ b/ci/scripts/create_experiment.py @@ -62,7 +62,7 @@ def input_args(): formatter_class=ArgumentDefaultsHelpFormatter) parser.add_argument('--yaml', help='full path to yaml file describing the experiment configuration', type=str, required=True) - parser.add_argument('--dir', help='full path to global-workflow build', type=str, required=True) + parser.add_argument('--dir', help='full path to global-workflow', type=str, required=True) return parser.parse_args() diff --git a/ci/scripts/driver.sh b/ci/scripts/driver.sh index 0267d88e03..d2bffdd93a 100755 --- a/ci/scripts/driver.sh +++ b/ci/scripts/driver.sh @@ -10,9 +10,8 @@ set -eux # # This script uses GitHub CLI to check for Pull Requests with CI-Ready-${machine} tags on the # development branch for the global-workflow repo. It then stages tests directories per -# PR number and calls clone-build_ci.sh to perform a clone and full build from $(HOMEgfs)/sorc -# of the PR. It then is ready to run a suite of regression tests with various -# configurations with run_tests.py. +# PR number and calls clone-build_ci.sh to perform a clone and full build from the PR. +# It then is ready to run a suite of regression tests with various configurations ####################################################################################### ################################################################# @@ -22,9 +21,9 @@ export GH=${HOME}/bin/gh export REPO_URL=${REPO_URL:-"https://github.com/NOAA-EMC/global-workflow.git"} ################################################################ -# Setup the reletive paths to scripts and PS4 for better logging +# Setup the reletive paths to scripts and PS4 for better logging ################################################################ -HOMEgfs="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null 2>&1 && pwd )" +ROOT_DIR="$(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}]' @@ -33,11 +32,11 @@ export PS4='+ $(basename ${BASH_SOURCE})[${LINENO}]' # Set up runtime environment varibles for accounts on supproted machines ######################################################################### -source "${HOMEgfs}/ush/detect_machine.sh" +source "${ROOT_DIR}/ush/detect_machine.sh" case ${MACHINE_ID} in hera | orion) echo "Running Automated Testing on ${MACHINE_ID}" - source "${HOMEgfs}/ci/platforms/config.${MACHINE_ID}" + source "${ROOT_DIR}/ci/platforms/config.${MACHINE_ID}" ;; *) echo "Unsupported platform. Exiting with error." @@ -49,8 +48,8 @@ esac # setup runtime env for correct python install and git ###################################################### set +x -source "${HOMEgfs}/ush/module-setup.sh" -module use "${HOMEgfs}/modulefiles" +source "${ROOT_DIR}/ush/module-setup.sh" +module use "${ROOT_DIR}/modulefiles" module load "module_gwsetup.${MACHINE_ID}" set -x @@ -61,45 +60,45 @@ set -x pr_list_dbfile="${GFS_CI_ROOT}/open_pr_list.db" if [[ ! -f "${pr_list_dbfile}" ]]; then - "${HOMEgfs}/ci/scripts/pr_list_database.py" --create --dbfile "${pr_list_dbfile}" + "${ROOT_DIR}/ci/scripts/pr_list_database.py" --create --dbfile "${pr_list_dbfile}" fi pr_list=$(${GH} pr list --repo "${REPO_URL}" --label "CI-${MACHINE_ID^}-Ready" --state "open" | awk '{print $1}') || true for pr in ${pr_list}; do pr_dir="${GFS_CI_ROOT}/PR/${pr}" - db_list=$("${HOMEgfs}/ci/scripts/pr_list_database.py" --add_pr "${pr}" --dbfile "${pr_list_dbfile}") + db_list=$("${ROOT_DIR}/ci/scripts/pr_list_database.py" --add_pr "${pr}" --dbfile "${pr_list_dbfile}") pr_id=0 ############################################################# - # Check if a Ready labeled PR has changed back from once set + # Check if a Ready labeled PR has changed back from once set # and in that case remove all previous jobs in scheduler and # and remove PR from filesystem to start clean ############################################################# if [[ "${db_list}" == *"already is in list"* ]]; then - pr_id=$("${HOMEgfs}/ci/scripts/pr_list_database.py" --dbfile "${pr_list_dbfile}" --display "${pr}" | awk '{print $4}') || true + pr_id=$("${ROOT_DIR}/ci/scripts/pr_list_database.py" --dbfile "${pr_list_dbfile}" --display "${pr}" | awk '{print $4}') || true pr_id=$((pr_id+1)) - "${HOMEgfs}/ci/scripts/pr_list_database.py" --dbfile "${pr_list_dbfile}" --update_pr "${pr}" Open Ready "${pr_id}" + "${ROOT_DIR}/ci/scripts/pr_list_database.py" --dbfile "${pr_list_dbfile}" --update_pr "${pr}" Open Ready "${pr_id}" for cases in "${pr_dir}/RUNTESTS/"*; do if [[ -z "${cases+x}" ]]; then break - fi + fi pslot=$(basename "${cases}") sacct --format=jobid,jobname%35,WorkDir%100,stat | grep "${pslot}" | grep "PR\/${pr}\/RUNTESTS" | awk '{print $1}' | xargs scancel || true done rm -Rf "${pr_dir}" - fi + fi done pr_list="" if [[ -f "${pr_list_dbfile}" ]]; then - pr_list=$("${HOMEgfs}/ci/scripts/pr_list_database.py" --display --dbfile "${pr_list_dbfile}" | grep -v Failed | grep Open | grep Ready | awk '{print $1}') || true + pr_list=$("${ROOT_DIR}/ci/scripts/pr_list_database.py" --display --dbfile "${pr_list_dbfile}" | grep -v Failed | grep Open | grep Ready | awk '{print $1}') || true fi if [[ -z "${pr_list+x}" ]]; then echo "no PRs open and ready for checkout/build .. exiting" exit 0 fi - + ############################################################# # Loop throu all open PRs # Clone, checkout, build, creat set of cases, for each @@ -107,12 +106,12 @@ fi for pr in ${pr_list}; do # Skip pr's that are currently Building for when overlapping driver scripts are being called from within cron - pr_building=$("${HOMEgfs}/ci/scripts/pr_list_database.py" --display "${pr}" --dbfile "${pr_list_dbfile}" | grep Building) || true + pr_building=$("${ROOT_DIR}/ci/scripts/pr_list_database.py" --display "${pr}" --dbfile "${pr_list_dbfile}" | grep Building) || true if [[ -z "${pr_building+x}" ]]; then continue fi "${GH}" pr edit --repo "${REPO_URL}" "${pr}" --remove-label "CI-${MACHINE_ID^}-Ready" --add-label "CI-${MACHINE_ID^}-Building" - "${HOMEgfs}/ci/scripts/pr_list_database.py" --dbfile "${pr_list_dbfile}" --update_pr "${pr}" Open Building + "${ROOT_DIR}/ci/scripts/pr_list_database.py" --dbfile "${pr_list_dbfile}" --update_pr "${pr}" Open Building echo "Processing Pull Request #${pr}" pr_dir="${GFS_CI_ROOT}/PR/${pr}" rm -Rf "${pr_dir}" @@ -120,7 +119,7 @@ for pr in ${pr_list}; do # call clone-build_ci to clone and build PR id=$("${GH}" pr view "${pr}" --repo "${REPO_URL}" --json id --jq '.id') set +e - "${HOMEgfs}/ci/scripts/clone-build_ci.sh" -p "${pr}" -d "${pr_dir}" -o "${pr_dir}/output_${id}" + "${ROOT_DIR}/ci/scripts/clone-build_ci.sh" -p "${pr}" -d "${pr_dir}" -o "${pr_dir}/output_${id}" ci_status=$? ################################################################## # Checking for special case when Ready label was updated @@ -128,14 +127,14 @@ for pr in ${pr_list}; do # building so we force and exit 0 instead to does not get relabled ################################################################# if [[ ${ci_status} -ne 0 ]]; then - pr_id_check=$("${HOMEgfs}/ci/scripts/pr_list_database.py" --display "{pr}" --dbfile "${pr_list_dbfile}" | awk '{print $4}') || true + pr_id_check=$("${ROOT_DIR}/ci/scripts/pr_list_database.py" --display "{pr}" --dbfile "${pr_list_dbfile}" | awk '{print $4}') || true if [[ "${pr_id}" -ne "${pr_id_check}" ]]; then exit 0 - fi + fi fi set -e if [[ ${ci_status} -eq 0 ]]; then - "${HOMEgfs}/ci/scripts/pr_list_database.py" --dbfile "${pr_list_dbfile}" --update_pr "${pr}" Open Built + "${ROOT_DIR}/ci/scripts/pr_list_database.py" --dbfile "${pr_list_dbfile}" --update_pr "${pr}" Open Built #setup space to put an experiment # export RUNTESTS for yaml case files to pickup export RUNTESTS="${pr_dir}/RUNTESTS" @@ -145,18 +144,17 @@ for pr in ${pr_list}; do # loop over every yaml file in the PR's ci/cases # and create an run directory for each one for this PR loop ############################################################# - HOMEgfs_PR="${pr_dir}/global-workflow" - export HOMEgfs_PR - cd "${HOMEgfs_PR}" + export HOMEgfs="${pr_dir}/global-workflow" + cd "${HOMEgfs}" pr_sha=$(git rev-parse --short HEAD) - for yaml_config in "${HOMEgfs_PR}/ci/cases/pr/"*.yaml; do + for yaml_config in "${HOMEgfs}/ci/cases/pr/"*.yaml; do case=$(basename "${yaml_config}" .yaml) || true pslot="${case}_${pr_sha}" rm -Rf "${STMP}/RUNDIRS/${pslot}" export pslot set +e - "${HOMEgfs_PR}/ci/scripts/create_experiment.py" --yaml "${HOMEgfs_PR}/ci/cases/pr/${case}.yaml" --dir "${HOMEgfs_PR}" + "${HOMEgfs}/ci/scripts/create_experiment.py" --yaml "${HOMEgfs}/ci/cases/pr/${case}.yaml" --dir "${HOMEgfs}" ci_status=$? set -e if [[ ${ci_status} -eq 0 ]]; then @@ -165,27 +163,27 @@ for pr in ${pr_list}; do echo "Case setup: Completed at $(date) for experiment ${pslot}" || true } >> "${GFS_CI_ROOT}/PR/${pr}/output_${id}" "${GH}" pr edit --repo "${REPO_URL}" "${pr}" --remove-label "CI-${MACHINE_ID^}-Building" --add-label "CI-${MACHINE_ID^}-Running" - "${HOMEgfs}/ci/scripts/pr_list_database.py" --dbfile "${pr_list_dbfile}" --update_pr "${pr}" Open Running - else + "${ROOT_DIR}/ci/scripts/pr_list_database.py" --dbfile "${pr_list_dbfile}" --update_pr "${pr}" Open Running + else { echo "Failed to create experiment: *FAIL* ${pslot}" echo "Experiment setup: failed at $(date) for experiment ${pslot}" || true echo "" - cat "${HOMEgfs_PR}/ci/scripts/"setup_*.std* + cat "${HOMEgfs}/ci/scripts/"setup_*.std* } >> "${GFS_CI_ROOT}/PR/${pr}/output_${id}" "${GH}" pr edit "${pr}" --repo "${REPO_URL}" --remove-label "CI-${MACHINE_ID^}-Building" --add-label "CI-${MACHINE_ID^}-Failed" - "${HOMEgfs}/ci/scripts/pr_list_database.py" --remove_pr "${pr}" --dbfile "${pr_list_dbfile}" + "${ROOT_DIR}/ci/scripts/pr_list_database.py" --remove_pr "${pr}" --dbfile "${pr_list_dbfile}" fi done - else + else { echo '```' echo "Failed on cloning and building global-workflowi PR: ${pr}" echo "CI on ${MACHINE_ID^} failed to build on $(date) for repo ${REPO_URL}" || true } >> "${GFS_CI_ROOT}/PR/${pr}/output_${id}" "${GH}" pr edit "${pr}" --repo "${REPO_URL}" --remove-label "CI-${MACHINE_ID^}-Building" --add-label "CI-${MACHINE_ID^}-Failed" - "${HOMEgfs}/ci/scripts/pr_list_database.py" --remove_pr "${pr}" --dbfile "${pr_list_dbfile}" + "${ROOT_DIR}/ci/scripts/pr_list_database.py" --remove_pr "${pr}" --dbfile "${pr_list_dbfile}" fi sed -i "s/\`\`\`//2g" "${GFS_CI_ROOT}/PR/${pr}/output_${id}" "${GH}" pr comment "${pr}" --repo "${REPO_URL}" --body-file "${GFS_CI_ROOT}/PR/${pr}/output_${id}" diff --git a/ci/scripts/driver_weekly.sh b/ci/scripts/driver_weekly.sh index 3650f75dfc..a52e5b1caa 100755 --- a/ci/scripts/driver_weekly.sh +++ b/ci/scripts/driver_weekly.sh @@ -8,13 +8,13 @@ set -eux # # Abstract: # -# This script runs the high resolution cases found in $HOMEgfs/ci/cases/weekly +# This script runs the high resolution cases found in ${HOMEgfs}/ci/cases/weekly # from the develop branch for the global-workflow repo that are intended to run on a weekly basis # from a cron job. When run it will clone and build a new branch from the EMC's global-workflow and # and create a pr using GitHub CLI by moving and replacing the yaml case files in # ${HOMEgfs}/ci/cases/weekly to {HOMEgfs}/ci/cases/pr. Then the requisite labels are added # so that the current BASH CI framework can then run these cases. Since this script -# creates a PR with the CI-Ready labels, the BASH CI framework will automatically run these cases +# creates a PR with the CI-Ready labels, the BASH CI framework will automatically run these cases # from that point so it is only required to run this script once from a single machine. ############################################################################################## @@ -27,7 +27,7 @@ export REPO_URL="ssh://git@ssh.github.com:443/NOAA-EMC/global-workflow.git" ################################################################ # Setup the relative paths to scripts and PS4 for better logging ################################################################ -HOMEgfs="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null 2>&1 && pwd )" +ROOT_DIR="$(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[0]})[${LINENO}]' @@ -36,11 +36,11 @@ export PS4='+ $(basename ${BASH_SOURCE[0]})[${LINENO}]' # Set up runtime environment variables for accounts on supported machines ######################################################################### -source "${HOMEgfs}/ush/detect_machine.sh" +source "${ROOT_DIR}/ush/detect_machine.sh" case ${MACHINE_ID} in hera | orion) echo "Running Automated Testing on ${MACHINE_ID}" - source "${HOMEgfs}/ci/platforms/config.${MACHINE_ID}" + source "${ROOT_DIR}/ci/platforms/config.${MACHINE_ID}" ;; *) echo "Unsupported platform. Exiting with error." @@ -52,8 +52,8 @@ esac # setup runtime env for correct python install and git ###################################################### set +x -source "${HOMEgfs}/ush/module-setup.sh" -module use "${HOMEgfs}/modulefiles" +source "${ROOT_DIR}/ush/module-setup.sh" +module use "${ROOT_DIR}/modulefiles" module load "module_gwsetup.${MACHINE_ID}" set -x @@ -71,7 +71,7 @@ cd global-workflow || exit 1 git checkout -b "${branch}" ###################################################### -# move yaml files from ci/cases/weekly to ci/cases/pr +# move yaml files from ci/cases/weekly to ci/cases/pr # and push new branch for PR weekly CI tests to GitHub REPO_OWNER="emcbot" REPO_NAME="global-workflow" diff --git a/ci/scripts/run_ci.sh b/ci/scripts/run_ci.sh index 0ff3725be9..cdaafb337f 100755 --- a/ci/scripts/run_ci.sh +++ b/ci/scripts/run_ci.sh @@ -3,13 +3,13 @@ set -eux ##################################################################################### # -# Script description: BASH script for checking for cases in a given PR and +# Script description: BASH script for checking for cases in a given PR and # simply running rocotorun on each. 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 )" +ROOT_DIR="$(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}]' @@ -18,11 +18,11 @@ export PS4='+ $(basename ${BASH_SOURCE})[${LINENO}]' # Set up runtime environment varibles for accounts on supproted machines ######################################################################### -source "${HOMEgfs}/ush/detect_machine.sh" +source "${ROOT_DIR}/ush/detect_machine.sh" case ${MACHINE_ID} in hera | orion) echo "Running Automated Testing on ${MACHINE_ID}" - source "${HOMEgfs}/ci/platforms/config.${MACHINE_ID}" + source "${ROOT_DIR}/ci/platforms/config.${MACHINE_ID}" ;; *) echo "Unsupported platform. Exiting with error." @@ -30,8 +30,8 @@ case ${MACHINE_ID} in ;; esac set +x -source "${HOMEgfs}/ush/module-setup.sh" -module use "${HOMEgfs}/modulefiles" +source "${ROOT_DIR}/ush/module-setup.sh" +module use "${ROOT_DIR}/modulefiles" module load "module_gwsetup.${MACHINE_ID}" module list set -eux @@ -47,7 +47,7 @@ pr_list_dbfile="${GFS_CI_ROOT}/open_pr_list.db" pr_list="" if [[ -f "${pr_list_dbfile}" ]]; then - pr_list=$("${HOMEgfs}/ci/scripts/pr_list_database.py" --display --dbfile "${pr_list_dbfile}" | grep -v Failed | grep Open | grep Running | awk '{print $1}' | head -"${max_concurrent_pr}") || true + pr_list=$("${ROOT_DIR}/ci/scripts/pr_list_database.py" --display --dbfile "${pr_list_dbfile}" | grep -v Failed | grep Open | grep Running | awk '{print $1}' | head -"${max_concurrent_pr}") || true fi if [[ -z "${pr_list}" ]]; then echo "no open and built PRs that are ready for the cases to advance with rocotorun .. exiting" diff --git a/parm/config/gfs/yaml/defaults.yaml b/parm/config/gfs/yaml/defaults.yaml index 112087bcbd..8c2b4ff22b 100644 --- a/parm/config/gfs/yaml/defaults.yaml +++ b/parm/config/gfs/yaml/defaults.yaml @@ -15,9 +15,9 @@ landanl: IO_LAYOUT_Y: 1 ocnanal: - SOCA_INPUT_FIX_DIR: "/scratch2/NCEPDEV/ocean/Guillaume.Vernieres/data/static/72x35x25/soca" + SOCA_INPUT_FIX_DIR: "/scratch2/NCEPDEV/ocean/Guillaume.Vernieres/data/static/72x35x25/soca" # TODO: These need to go to glopara fix space. @guillaumevernieres will open an issue CASE_ANL: "C48" - COMIN_OBS: "/scratch2/NCEPDEV/marineda/r2d2-v2-v3" + COMIN_OBS: "/scratch2/NCEPDEV/marineda/r2d2-v2-v3" # TODO: make platform agnostic SOCA_OBS_LIST: "{{ HOMEgfs }}/sorc/gdas.cd/parm/soca/obs/obs_list.yaml" SOCA_NINNER: 100 R2D2_OBS_SRC: "gdas_marine" From a80b61bf3cd7cebc68dd342e1a4fdba789fbc78d Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 13 Oct 2023 15:40:26 -0400 Subject: [PATCH 3/9] update type to system --- ci/cases/pr/C48_ATM.yaml | 2 +- ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml | 4 ++-- ci/cases/pr_disable/C48_S2SA_gefs.yaml | 2 +- ci/cases/pr_disable/C48_S2SW.yaml | 2 +- ci/cases/pr_disable/C96C48_hybatmDA.yaml | 2 +- ci/cases/pr_disable/C96_atm3DVar.yaml | 2 +- ci/cases/weekly/C384C192_hybatmda.yaml | 4 ++-- ci/cases/weekly/C384_S2SWA.yaml | 4 ++-- ci/cases/weekly/C384_atm3DVar.yaml | 4 ++-- ci/scripts/create_experiment.py | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ci/cases/pr/C48_ATM.yaml b/ci/cases/pr/C48_ATM.yaml index d563c6fba9..01a328873f 100644 --- a/ci/cases/pr/C48_ATM.yaml +++ b/ci/cases/pr/C48_ATM.yaml @@ -1,5 +1,5 @@ experiment: - type: gfs + system: gfs mode: forecast-only arguments: diff --git a/ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml b/ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml index 245a6a066d..51bfc817b2 100644 --- a/ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml +++ b/ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml @@ -1,5 +1,5 @@ experiment: - type: gfs + system: gfs mode: cycled arguments: @@ -9,7 +9,7 @@ arguments: comrot: ${RUNTESTS}/COMROT expdir: ${RUNTESTS}/EXPDIR # icsdir: ${ICSDIR_ROOT}/C48cpldDA - icsdir: "/scratch2/NCEPDEV/ocean/Guillaume.Vernieres/data/ICSDIR/C48O500" # TODO: make platform agnostic + icsdir: "/scratch2/NCEPDEV/ocean/Guillaume.Vernieres/data/ICSDIR/C48O500" # TODO: make platform agnostic idate: 2021032312 edate: 2021032400 nens: 0 diff --git a/ci/cases/pr_disable/C48_S2SA_gefs.yaml b/ci/cases/pr_disable/C48_S2SA_gefs.yaml index 50f8df1d55..156683ae28 100644 --- a/ci/cases/pr_disable/C48_S2SA_gefs.yaml +++ b/ci/cases/pr_disable/C48_S2SA_gefs.yaml @@ -1,5 +1,5 @@ experiment: - type: gefs + system: gefs mode: forecast-only arguments: diff --git a/ci/cases/pr_disable/C48_S2SW.yaml b/ci/cases/pr_disable/C48_S2SW.yaml index 63e175de80..4c4cf4f147 100644 --- a/ci/cases/pr_disable/C48_S2SW.yaml +++ b/ci/cases/pr_disable/C48_S2SW.yaml @@ -1,5 +1,5 @@ experiment: - type: gfs + system: gfs mode: forecast-only arguments: diff --git a/ci/cases/pr_disable/C96C48_hybatmDA.yaml b/ci/cases/pr_disable/C96C48_hybatmDA.yaml index bd4810ebd1..4844ee3c9b 100644 --- a/ci/cases/pr_disable/C96C48_hybatmDA.yaml +++ b/ci/cases/pr_disable/C96C48_hybatmDA.yaml @@ -1,5 +1,5 @@ experiment: - type: gfs + system: gfs mode: cycled arguments: diff --git a/ci/cases/pr_disable/C96_atm3DVar.yaml b/ci/cases/pr_disable/C96_atm3DVar.yaml index acd1a18690..02aff389c4 100644 --- a/ci/cases/pr_disable/C96_atm3DVar.yaml +++ b/ci/cases/pr_disable/C96_atm3DVar.yaml @@ -1,5 +1,5 @@ experiment: - type: gfs + system: gfs mode: cycled arguments: diff --git a/ci/cases/weekly/C384C192_hybatmda.yaml b/ci/cases/weekly/C384C192_hybatmda.yaml index ca62c4e8f9..1d3c94017c 100644 --- a/ci/cases/weekly/C384C192_hybatmda.yaml +++ b/ci/cases/weekly/C384C192_hybatmda.yaml @@ -1,5 +1,5 @@ experiment: - type: gfs + system: gfs mode: cycled arguments: @@ -15,4 +15,4 @@ arguments: nens: 2 gfs_cyc: 1 start: cold - yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci-updates.yaml + yaml: ${HOMEgfs}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/cases/weekly/C384_S2SWA.yaml b/ci/cases/weekly/C384_S2SWA.yaml index d494efb44b..2978e87c95 100644 --- a/ci/cases/weekly/C384_S2SWA.yaml +++ b/ci/cases/weekly/C384_S2SWA.yaml @@ -1,5 +1,5 @@ experiment: - type: gfs + system: gfs mode: forecast-only arguments: @@ -10,4 +10,4 @@ arguments: expdir: ${RUNTESTS}/EXPDIR idate: 2016070100 edate: 2016070100 - yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci-updates.yaml + yaml: ${HOMEgfs}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/cases/weekly/C384_atm3DVar.yaml b/ci/cases/weekly/C384_atm3DVar.yaml index 99f302b9ca..a754ed0ee0 100644 --- a/ci/cases/weekly/C384_atm3DVar.yaml +++ b/ci/cases/weekly/C384_atm3DVar.yaml @@ -1,5 +1,5 @@ experiment: - type: gfs + system: gfs mode: cycled arguments: @@ -15,4 +15,4 @@ arguments: nens: 0 gfs_cyc: 1 start: cold - yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci-updates.yaml + yaml: ${HOMEgfs}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/scripts/create_experiment.py b/ci/scripts/create_experiment.py index 47c1e1429f..fd65e042d1 100755 --- a/ci/scripts/create_experiment.py +++ b/ci/scripts/create_experiment.py @@ -75,7 +75,7 @@ def input_args(): experiment_dir = Path.absolute(Path.joinpath(Path(testconf.arguments.expdir), Path(testconf.arguments.pslot))) # Create a list of arguments to setup_expt.py - setup_expt_args = [testconf.experiment.type, testconf.experiment.mode] # TODO: rename 'type' as 'system' in case.yaml + setup_expt_args = [testconf.experiment.system , testconf.experiment.mode] for kk, vv in testconf.arguments.items(): setup_expt_args.append(f"--{kk}") setup_expt_args.append(str(vv)) From 0715d149a805d913d8604072d5af4c669ea121cc Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 13 Oct 2023 15:44:05 -0400 Subject: [PATCH 4/9] move create_experiment.py to workflow/ --- ci/scripts/driver.sh | 2 +- {ci/scripts => workflow}/create_experiment.py | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) rename {ci/scripts => workflow}/create_experiment.py (89%) diff --git a/ci/scripts/driver.sh b/ci/scripts/driver.sh index d2bffdd93a..25682fd1aa 100755 --- a/ci/scripts/driver.sh +++ b/ci/scripts/driver.sh @@ -154,7 +154,7 @@ for pr in ${pr_list}; do rm -Rf "${STMP}/RUNDIRS/${pslot}" export pslot set +e - "${HOMEgfs}/ci/scripts/create_experiment.py" --yaml "${HOMEgfs}/ci/cases/pr/${case}.yaml" --dir "${HOMEgfs}" + "${HOMEgfs}/workflow/create_experiment.py" --yaml "${HOMEgfs}/ci/cases/pr/${case}.yaml" --dir "${HOMEgfs}" ci_status=$? set -e if [[ ${ci_status} -eq 0 ]]; then diff --git a/ci/scripts/create_experiment.py b/workflow/create_experiment.py similarity index 89% rename from ci/scripts/create_experiment.py rename to workflow/create_experiment.py index fd65e042d1..ebef94a9e6 100755 --- a/ci/scripts/create_experiment.py +++ b/workflow/create_experiment.py @@ -17,25 +17,19 @@ with an error code of 0 upon success. """ -import os -import sys from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from pathlib import Path from wxflow import YAMLFile, Logger, logit - -_here = os.path.dirname(__file__) -_top = os.path.abspath(os.path.join(os.path.abspath(_here), '../..')) -logger = Logger(level='DEBUG', colored_log=True) - - -# TODO: move create_experiment.py to workflow/ and remove this sys.path.insert business -sys.path.insert(0, os.path.join(_top, 'workflow')) import setup_expt import setup_xml +# Setup the logger +logger = Logger(level='DEBUG', colored_log=True) + + @logit(logger) def input_args(): """ From e64ae94e1dcbe785cfd96d579b3d205f74d03b62 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 13 Oct 2023 15:45:54 -0400 Subject: [PATCH 5/9] fix pycodestyle error --- workflow/create_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/create_experiment.py b/workflow/create_experiment.py index ebef94a9e6..6e8dde0446 100755 --- a/workflow/create_experiment.py +++ b/workflow/create_experiment.py @@ -69,7 +69,7 @@ def input_args(): experiment_dir = Path.absolute(Path.joinpath(Path(testconf.arguments.expdir), Path(testconf.arguments.pslot))) # Create a list of arguments to setup_expt.py - setup_expt_args = [testconf.experiment.system , testconf.experiment.mode] + setup_expt_args = [testconf.experiment.system, testconf.experiment.mode] for kk, vv in testconf.arguments.items(): setup_expt_args.append(f"--{kk}") setup_expt_args.append(str(vv)) From 22ae19b842a74602be6cc8421bc97c93a2a92832 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 13 Oct 2023 16:00:51 -0400 Subject: [PATCH 6/9] disable the soca test --- ci/cases/{pr_disable => pr}/C48_S2SA_gefs.yaml | 0 ci/cases/{pr_disable => pr}/C48_S2SW.yaml | 0 ci/cases/{pr_disable => pr}/C96C48_hybatmDA.yaml | 0 ci/cases/{pr_disable => pr}/C96_atm3DVar.yaml | 0 ci/cases/{pr => pr_disable}/C48_atm3DVar_ocnhybDA.yaml | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename ci/cases/{pr_disable => pr}/C48_S2SA_gefs.yaml (100%) rename ci/cases/{pr_disable => pr}/C48_S2SW.yaml (100%) rename ci/cases/{pr_disable => pr}/C96C48_hybatmDA.yaml (100%) rename ci/cases/{pr_disable => pr}/C96_atm3DVar.yaml (100%) rename ci/cases/{pr => pr_disable}/C48_atm3DVar_ocnhybDA.yaml (100%) diff --git a/ci/cases/pr_disable/C48_S2SA_gefs.yaml b/ci/cases/pr/C48_S2SA_gefs.yaml similarity index 100% rename from ci/cases/pr_disable/C48_S2SA_gefs.yaml rename to ci/cases/pr/C48_S2SA_gefs.yaml diff --git a/ci/cases/pr_disable/C48_S2SW.yaml b/ci/cases/pr/C48_S2SW.yaml similarity index 100% rename from ci/cases/pr_disable/C48_S2SW.yaml rename to ci/cases/pr/C48_S2SW.yaml diff --git a/ci/cases/pr_disable/C96C48_hybatmDA.yaml b/ci/cases/pr/C96C48_hybatmDA.yaml similarity index 100% rename from ci/cases/pr_disable/C96C48_hybatmDA.yaml rename to ci/cases/pr/C96C48_hybatmDA.yaml diff --git a/ci/cases/pr_disable/C96_atm3DVar.yaml b/ci/cases/pr/C96_atm3DVar.yaml similarity index 100% rename from ci/cases/pr_disable/C96_atm3DVar.yaml rename to ci/cases/pr/C96_atm3DVar.yaml diff --git a/ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml b/ci/cases/pr_disable/C48_atm3DVar_ocnhybDA.yaml similarity index 100% rename from ci/cases/pr/C48_atm3DVar_ocnhybDA.yaml rename to ci/cases/pr_disable/C48_atm3DVar_ocnhybDA.yaml From beeaf3289d4ca14b0d01a9412006ad630f621e41 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 13 Oct 2023 16:43:23 -0400 Subject: [PATCH 7/9] remove soca tests --- ci/cases/pr_disable/C48_atm3DVar_ocnhybDA.yaml | 18 ------------------ ci/platforms/soca_gfs_defaults_ci.yaml | 6 ------ 2 files changed, 24 deletions(-) delete mode 100644 ci/cases/pr_disable/C48_atm3DVar_ocnhybDA.yaml delete mode 100644 ci/platforms/soca_gfs_defaults_ci.yaml diff --git a/ci/cases/pr_disable/C48_atm3DVar_ocnhybDA.yaml b/ci/cases/pr_disable/C48_atm3DVar_ocnhybDA.yaml deleted file mode 100644 index 51bfc817b2..0000000000 --- a/ci/cases/pr_disable/C48_atm3DVar_ocnhybDA.yaml +++ /dev/null @@ -1,18 +0,0 @@ -experiment: - system: gfs - mode: cycled - -arguments: - pslot: ${pslot} - app: S2S - resdet: 48 - comrot: ${RUNTESTS}/COMROT - expdir: ${RUNTESTS}/EXPDIR - # icsdir: ${ICSDIR_ROOT}/C48cpldDA - icsdir: "/scratch2/NCEPDEV/ocean/Guillaume.Vernieres/data/ICSDIR/C48O500" # TODO: make platform agnostic - idate: 2021032312 - edate: 2021032400 - nens: 0 - gfs_cyc: 0 - start: warm - yaml: ${HOMEgfs}/ci/platforms/soca_gfs_defaults_ci.yaml diff --git a/ci/platforms/soca_gfs_defaults_ci.yaml b/ci/platforms/soca_gfs_defaults_ci.yaml deleted file mode 100644 index 244c235860..0000000000 --- a/ci/platforms/soca_gfs_defaults_ci.yaml +++ /dev/null @@ -1,6 +0,0 @@ -defaults: - !INC {{ HOMEgfs }}/parm/config/gfs/yaml/defaults.yaml -base: - ACCOUNT: ${SLURM_ACCOUNT} - DOIAU: "NO" - DO_JEDIOCNVAR: "YES" From 758db445ff943e9bad6e5a9816a7cb11c8c5b135 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Mon, 16 Oct 2023 10:47:50 -0400 Subject: [PATCH 8/9] detect HOMEgfs in create_experiment.py based on location. update to use jinja templates in the cases --- ci/cases/pr/C48_ATM.yaml | 8 +++---- ci/cases/pr/C48_S2SA_gefs.yaml | 10 ++++----- ci/cases/pr/C48_S2SW.yaml | 8 +++---- ci/cases/pr/C96C48_hybatmDA.yaml | 10 ++++----- ci/cases/pr/C96_atm3DVar.yaml | 8 +++---- ci/cases/weekly/C384C192_hybatmda.yaml | 10 ++++----- ci/cases/weekly/C384_S2SWA.yaml | 8 +++---- ci/cases/weekly/C384_atm3DVar.yaml | 10 ++++----- ci/scripts/driver.sh | 2 +- workflow/create_experiment.py | 30 ++++++++++++++++++-------- 10 files changed, 58 insertions(+), 46 deletions(-) diff --git a/ci/cases/pr/C48_ATM.yaml b/ci/cases/pr/C48_ATM.yaml index 01a328873f..fc0b729af6 100644 --- a/ci/cases/pr/C48_ATM.yaml +++ b/ci/cases/pr/C48_ATM.yaml @@ -3,11 +3,11 @@ experiment: mode: forecast-only arguments: - pslot: ${pslot} + pslot: {{ 'pslot' | getenv }} app: ATM resdet: 48 - comrot: ${RUNTESTS}/COMROT - expdir: ${RUNTESTS}/EXPDIR + comrot: {{ 'RUNTESTS' | getenv }}/COMROT + expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR idate: 2021032312 edate: 2021032312 - yaml: ${HOMEgfs}/ci/platforms/gfs_defaults_ci.yaml + yaml: {{ HOMEgfs }}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/cases/pr/C48_S2SA_gefs.yaml b/ci/cases/pr/C48_S2SA_gefs.yaml index 156683ae28..927a979b13 100644 --- a/ci/cases/pr/C48_S2SA_gefs.yaml +++ b/ci/cases/pr/C48_S2SA_gefs.yaml @@ -3,15 +3,15 @@ experiment: mode: forecast-only arguments: - pslot: ${pslot} + pslot: {{ 'pslot' | getenv }} app: S2SA resdet: 48 resens: 48 nens: 2 gfs_cyc: 1 - comrot: ${RUNTESTS}/COMROT - expdir: ${RUNTESTS}/EXPDIR - icsdir: ${ICSDIR_ROOT}/C48C48mx500 + comrot: {{ 'RUNTESTS' | getenv }}/COMROT + expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR + icsdir: {{ 'ICSDIR_ROOT' | getenv }}/C48C48mx500 idate: 2021032312 edate: 2021032312 - yaml: ${HOMEgfs}/ci/platforms/gefs_ci_defaults.yaml + yaml: {{ HOMEgfs }}/ci/platforms/gefs_ci_defaults.yaml diff --git a/ci/cases/pr/C48_S2SW.yaml b/ci/cases/pr/C48_S2SW.yaml index 4c4cf4f147..f4b50ead22 100644 --- a/ci/cases/pr/C48_S2SW.yaml +++ b/ci/cases/pr/C48_S2SW.yaml @@ -3,11 +3,11 @@ experiment: mode: forecast-only arguments: - pslot: ${pslot} + pslot: {{ 'pslot' | getenv }} app: S2SW resdet: 48 - comrot: ${RUNTESTS}/COMROT - expdir: ${RUNTESTS}/EXPDIR + comrot: {{ 'RUNTESTS' | getenv }}/COMROT + expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR idate: 2021032312 edate: 2021032312 - yaml: ${HOMEgfs}/ci/platforms/gfs_defaults_ci.yaml + yaml: {{ HOMEgfs }}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/cases/pr/C96C48_hybatmDA.yaml b/ci/cases/pr/C96C48_hybatmDA.yaml index 4844ee3c9b..c3aa6e8892 100644 --- a/ci/cases/pr/C96C48_hybatmDA.yaml +++ b/ci/cases/pr/C96C48_hybatmDA.yaml @@ -3,16 +3,16 @@ experiment: mode: cycled arguments: - pslot: ${pslot} + pslot: {{ 'pslot' | getenv }} app: ATM resdet: 96 resens: 48 - comrot: ${RUNTESTS}/COMROT - expdir: ${RUNTESTS}/EXPDIR - icsdir: ${ICSDIR_ROOT}/C96C48 + comrot: {{ 'RUNTESTS' | getenv }}/COMROT + expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR + icsdir: {{ 'ICSDIR_ROOT' | getenv }}/C96C48 idate: 2021122018 edate: 2021122106 nens: 2 gfs_cyc: 1 start: cold - yaml: ${HOMEgfs}/ci/platforms/gfs_defaults_ci.yaml + yaml: {{ HOMEgfs }}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/cases/pr/C96_atm3DVar.yaml b/ci/cases/pr/C96_atm3DVar.yaml index 02aff389c4..5215cb0d90 100644 --- a/ci/cases/pr/C96_atm3DVar.yaml +++ b/ci/cases/pr/C96_atm3DVar.yaml @@ -3,15 +3,15 @@ experiment: mode: cycled arguments: - pslot: ${pslot} + pslot: {{ 'pslot' | getenv }} app: ATM resdet: 96 - comrot: ${RUNTESTS}/COMROT - expdir: ${RUNTESTS}/EXPDIR + comrot: {{ 'RUNTESTS' | getenv }}/COMROT + expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR icsdir: ${ICSDIR_ROOT}/C96C48 idate: 2021122018 edate: 2021122106 nens: 0 gfs_cyc: 1 start: cold - yaml: ${HOMEgfs}/ci/platforms/gfs_defaults_ci.yaml + yaml: {{ HOMEgfs }}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/cases/weekly/C384C192_hybatmda.yaml b/ci/cases/weekly/C384C192_hybatmda.yaml index 1d3c94017c..4c14018e2d 100644 --- a/ci/cases/weekly/C384C192_hybatmda.yaml +++ b/ci/cases/weekly/C384C192_hybatmda.yaml @@ -3,16 +3,16 @@ experiment: mode: cycled arguments: - pslot: ${pslot} + pslot: {{ 'pslot' | getenv }} app: ATM resdet: 384 resens: 192 - comrot: ${RUNTESTS}/COMROT - expdir: ${RUNTESTS}/EXPDIR - icsdir: ${ICSDIR_ROOT}/C384C192 + comrot: {{ 'RUNTESTS' | getenv }}/COMROT + expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR + icsdir: {{ 'ICSDIR_ROOT' | getenv }}/C384C192 idate: 2023040118 edate: 2023040200 nens: 2 gfs_cyc: 1 start: cold - yaml: ${HOMEgfs}/ci/platforms/gfs_defaults_ci.yaml + yaml: {{ HOMEgfs }}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/cases/weekly/C384_S2SWA.yaml b/ci/cases/weekly/C384_S2SWA.yaml index 2978e87c95..6c624f5698 100644 --- a/ci/cases/weekly/C384_S2SWA.yaml +++ b/ci/cases/weekly/C384_S2SWA.yaml @@ -3,11 +3,11 @@ experiment: mode: forecast-only arguments: - pslot: ${pslot} + pslot: {{ 'pslot' | getenv }} app: S2SWA resdet: 384 - comrot: ${RUNTESTS}/COMROT - expdir: ${RUNTESTS}/EXPDIR + comrot: {{ 'RUNTESTS' | getenv }}/COMROT + expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR idate: 2016070100 edate: 2016070100 - yaml: ${HOMEgfs}/ci/platforms/gfs_defaults_ci.yaml + yaml: {{ HOMEgfs }}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/cases/weekly/C384_atm3DVar.yaml b/ci/cases/weekly/C384_atm3DVar.yaml index a754ed0ee0..e7986ef097 100644 --- a/ci/cases/weekly/C384_atm3DVar.yaml +++ b/ci/cases/weekly/C384_atm3DVar.yaml @@ -3,16 +3,16 @@ experiment: mode: cycled arguments: - pslot: ${pslot} + pslot: {{ 'pslot' | getenv }} app: ATM resdet: 384 resens: 192 - comrot: ${RUNTESTS}/COMROT - expdir: ${RUNTESTS}/EXPDIR - icsdir: ${ICSDIR_ROOT}/C384C192 + comrot: {{ 'RUNTESTS' | getenv }}/COMROT + expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR + icsdir: {{ 'ICSDIR_ROOT' | getenv }}/C384C192 idate: 2023040118 edate: 2023040200 nens: 0 gfs_cyc: 1 start: cold - yaml: ${HOMEgfs}/ci/platforms/gfs_defaults_ci.yaml + yaml: {{ HOMEgfs }}/ci/platforms/gfs_defaults_ci.yaml diff --git a/ci/scripts/driver.sh b/ci/scripts/driver.sh index 25682fd1aa..267a93922e 100755 --- a/ci/scripts/driver.sh +++ b/ci/scripts/driver.sh @@ -154,7 +154,7 @@ for pr in ${pr_list}; do rm -Rf "${STMP}/RUNDIRS/${pslot}" export pslot set +e - "${HOMEgfs}/workflow/create_experiment.py" --yaml "${HOMEgfs}/ci/cases/pr/${case}.yaml" --dir "${HOMEgfs}" + "${HOMEgfs}/workflow/create_experiment.py" --yaml "${HOMEgfs}/ci/cases/pr/${case}.yaml" ci_status=$? set -e if [[ ${ci_status} -eq 0 ]]; then diff --git a/workflow/create_experiment.py b/workflow/create_experiment.py index 6e8dde0446..c343f1d798 100755 --- a/workflow/create_experiment.py +++ b/workflow/create_experiment.py @@ -3,7 +3,7 @@ """ Basic python script to create an experiment directory on the fly from a given yaml file for the arguments to the two scripts below in ${HOMEgfs}/workflow -where ${HOMEgfs} is specified within the input yaml file. +where ${HOMEgfs} is determined from the location of this script. ${HOMEgfs}/workflow/setup_expt.py ${HOMEgfs}/workflow/setup_xml.py @@ -17,17 +17,22 @@ with an error code of 0 upon success. """ +import os + from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from pathlib import Path -from wxflow import YAMLFile, Logger, logit +from wxflow import AttrDict, parse_j2yaml, Logger, logit import setup_expt import setup_xml +_here = os.path.dirname(__file__) +_top = os.path.abspath(os.path.join(os.path.abspath(_here), '..')) + # Setup the logger -logger = Logger(level='DEBUG', colored_log=True) +logger = Logger(level=os.environ.get("LOGGING_LEVEL", "INFO"), colored_log=True) @logit(logger) @@ -55,8 +60,8 @@ def input_args(): parser = ArgumentParser(description=description, formatter_class=ArgumentDefaultsHelpFormatter) - parser.add_argument('--yaml', help='full path to yaml file describing the experiment configuration', type=str, required=True) - parser.add_argument('--dir', help='full path to global-workflow', type=str, required=True) + parser.add_argument( + '--yaml', help='full path to yaml file describing the experiment configuration', type=Path, required=True) return parser.parse_args() @@ -64,9 +69,11 @@ def input_args(): if __name__ == '__main__': user_inputs = input_args() - HOMEgfs = Path.absolute(Path(user_inputs.dir)) - testconf = YAMLFile(path=user_inputs.yaml) - experiment_dir = Path.absolute(Path.joinpath(Path(testconf.arguments.expdir), Path(testconf.arguments.pslot))) + + # Create a dictionary to pass to parse_j2yaml for parsing the yaml file + data = AttrDict(HOMEgfs=_top) + data.update(os.environ) + testconf = parse_j2yaml(path=user_inputs.yaml, data=data) # Create a list of arguments to setup_expt.py setup_expt_args = [testconf.experiment.system, testconf.experiment.mode] @@ -74,11 +81,16 @@ def input_args(): setup_expt_args.append(f"--{kk}") setup_expt_args.append(str(vv)) - logger.info(f'Call: setup_expt.main()') + logger.info(f"Call: setup_expt.main()") + logger.debug(f"setup_expt.py {' '.join(setup_expt_args)}") setup_expt.main(setup_expt_args) # Create a list of arguments to setup_xml.py + experiment_dir = Path.absolute(Path.joinpath( + Path(testconf.arguments.expdir), Path(testconf.arguments.pslot))) + setup_xml_args = [str(experiment_dir)] logger.info(f"Call: setup_xml.main()") + logger.debug(f"setup_xml.py {' '.join(setup_xml_args)}") setup_xml.main(setup_xml_args) From e4933f7cc5a174149a6902e2efa10df40cedcf95 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Mon, 16 Oct 2023 15:50:11 -0400 Subject: [PATCH 9/9] remove export of HOMEgfs from driver.sh --- ci/scripts/driver.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/scripts/driver.sh b/ci/scripts/driver.sh index 267a93922e..a79ecfd6cf 100755 --- a/ci/scripts/driver.sh +++ b/ci/scripts/driver.sh @@ -144,15 +144,15 @@ for pr in ${pr_list}; do # loop over every yaml file in the PR's ci/cases # and create an run directory for each one for this PR loop ############################################################# - export HOMEgfs="${pr_dir}/global-workflow" + HOMEgfs="${pr_dir}/global-workflow" cd "${HOMEgfs}" pr_sha=$(git rev-parse --short HEAD) for yaml_config in "${HOMEgfs}/ci/cases/pr/"*.yaml; do case=$(basename "${yaml_config}" .yaml) || true - pslot="${case}_${pr_sha}" + # export pslot for yaml case files to pickup + export pslot="${case}_${pr_sha}" rm -Rf "${STMP}/RUNDIRS/${pslot}" - export pslot set +e "${HOMEgfs}/workflow/create_experiment.py" --yaml "${HOMEgfs}/ci/cases/pr/${case}.yaml" ci_status=$?