Skip to content

Commit

Permalink
needed pslot when removing individual experments and STMP was needed …
Browse files Browse the repository at this point in the history
…in previous fix (months ago) for deleting RUNDIRS before creeating experment
  • Loading branch information
TerryMcGuinness-NOAA committed Nov 9, 2024
1 parent d9d63af commit 45b565a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 0 additions & 4 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
11 changes: 6 additions & 5 deletions ci/scripts/utils/ci_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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}"

Check warning

Code scanning / shellcheck

Use "${var:?}" to ensure this never expands to / . Warning

Use "${var:?}" to ensure this never expands to / .
rm -Rf "${EXPDIR}/${pslot}"

Check warning

Code scanning / shellcheck

Use "${var:?}" to ensure this never expands to / . Warning

Use "${var:?}" to ensure this never expands to / .
rm -Rf "${STMP}/RUNDIRS/${pslot}"
}

0 comments on commit 45b565a

Please sign in to comment.