From 45b565a67212d781ffdcf2e3936d57344a38ce8b Mon Sep 17 00:00:00 2001 From: Terry McGuinness Date: Fri, 8 Nov 2024 20:23:53 -0600 Subject: [PATCH] needed pslot when removing individual experments and STMP was needed in previous fix (months ago) for deleting RUNDIRS before creeating experment --- ci/Jenkinsfile | 4 ---- ci/scripts/utils/ci_utils.sh | 11 ++++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index fc7c847322..b3bd6a917a 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -221,10 +221,6 @@ pipeline { def yaml_case = readYaml file: "${CUSTOM_WORKSPACE}/gfs/ci/cases/pr/${caseName}.yaml.tmp" def build_system = yaml_case.experiment.system try { - // Remove any data in that might still be in the DATAROOT directory from previous runs - STMP=sh(script: "${HOMEgfs}/ci/scripts/utils/get_config_var.py STMP ${CUSTOM_WORKSPACE}/RUNTESTS/EXPDIR/${pslot}", returnStdout: true).trim() - echo "Cleaning RUNDIRS if previously ran in: ${STMP}/RUNDIRS/${pslot}" - sh(script: "rm -Rf ${STMP}/RUNDIRS/${pslot}") sh(script: "${HOMEgfs}/ci/scripts/run-check_ci.sh ${CUSTOM_WORKSPACE} ${pslot} ${build_system}") sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh cleanup_experiment ${CUSTOM_WORKSPACE}/RUNTESTS/EXPDIR/${pslot}") } catch (Exception error_experment) { diff --git a/ci/scripts/utils/ci_utils.sh b/ci/scripts/utils/ci_utils.sh index ae2f02c2b8..2a4598a6be 100755 --- a/ci/scripts/utils/ci_utils.sh +++ b/ci/scripts/utils/ci_utils.sh @@ -122,8 +122,9 @@ function create_experiment () { source "${HOMEgfs}/ci/platforms/config.${MACHINE_ID}" source "${HOMEgfs}/workflow/gw_setup.sh" - # Remove RUNDIRS dir incase this is a retry - STMP=$(grep STMP "workflow/hosts/${MACHIND_ID}.yaml" | cut -d: -f2 | sed 's/[ "'\''"]*//g') || true + # Remove RUNDIRS dir incase this is a retry (STMP now in host file) + STMP=$(grep "${HOMEgfs}/ci/scripts/parse_yaml.py -y ${HOMEgfs}/workflow/hosts/${MACHINE_ID}.yaml -k STMP -s") + echo "Removing ${STMP}/RUNDIRS/${pslot} directory incase this is a retry" rm -Rf "${STMP}/RUNDIRS/${pslot}" "${HOMEgfs}/${system}/workflow/create_experiment.py" --overwrite --yaml "${yaml_config}" @@ -170,9 +171,9 @@ function cleanup_experiment() { # Use the Python utility to get the required variables read -r ARCDIR ATARDIR STMP COMROOT < <("${HOMEgfs}/ci/scripts/utils/get_config_var.py" ARCDIR ATARDIR STMP COMROOT "${EXPDIR}") || true - #rm -Rf "${STMP}/RUNDIRS/${pslot}" rm -Rf "${ARCDIR:?}" rm -Rf "${ATARDIR:?}" - rm -Rf "${COMROOT:?}" - rm -Rf "${EXPDIR}" + rm -Rf "${COMROOT}/${pslot}" + rm -Rf "${EXPDIR}/${pslot}" + rm -Rf "${STMP}/RUNDIRS/${pslot}" }