Skip to content
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 hash to CI experiment paths to avoid collisions #1735

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9ba6c00
Update driver.sh
TerrenceMcGuinness-NOAA Jun 7, 2023
03e3e39
Merge branch 'NOAA-EMC:develop' into develop
TerrenceMcGuinness-NOAA Jun 9, 2023
5e4d690
Merge branch 'NOAA-EMC:develop' into develop
TerrenceMcGuinness-NOAA Jun 13, 2023
d792096
Merge branch 'NOAA-EMC:develop' into develop
TerrenceMcGuinness-NOAA Jun 14, 2023
e6fb30b
Update driver.sh
TerrenceMcGuinness-NOAA Jun 7, 2023
9f7352f
Merge branch 'develop' of github.com:TerrenceMcGuinness-NOAA/global-w…
TerryMcGuinness-NOAA Jun 15, 2023
38e0917
Merge branch 'NOAA-EMC:develop' into develop
TerrenceMcGuinness-NOAA Jun 15, 2023
6101b70
Merge branch 'develop' of github.com:TerrenceMcGuinness-NOAA/global-w…
TerryMcGuinness-NOAA Jun 15, 2023
fe1dcde
Merge branch 'NOAA-EMC:develop' into develop
TerrenceMcGuinness-NOAA Jun 15, 2023
fa9e3e0
Merge branch 'develop' of github.com:TerrenceMcGuinness-NOAA/global-w…
TerryMcGuinness-NOAA Jun 15, 2023
4bfa873
Merge branch 'develop' of github.com:TerrenceMcGuinness-NOAA/global-w…
TerryMcGuinness-NOAA Jun 23, 2023
d0bdf58
Merge branch 'develop' of github.com:TerrenceMcGuinness-NOAA/global-w…
TerryMcGuinness-NOAA Jun 26, 2023
79f06b7
Merge branch 'develop' of github.com:TerrenceMcGuinness-NOAA/global-w…
TerryMcGuinness-NOAA Jun 28, 2023
5eef690
Merge branch 'develop' of github.com:TerrenceMcGuinness-NOAA/global-w…
TerryMcGuinness-NOAA Jun 28, 2023
19891d5
Merge branch 'develop' of github.com:TerrenceMcGuinness-NOAA/global-w…
TerryMcGuinness-NOAA Jun 30, 2023
44b687e
Merge branch 'develop' of github.com:TerrenceMcGuinness-NOAA/global-w…
TerryMcGuinness-NOAA Jul 10, 2023
3a5d137
removed two cases for testing
TerryMcGuinness-NOAA Jul 10, 2023
f3b6403
added switch to create experment to tag pslot name
TerryMcGuinness-NOAA Jul 10, 2023
24064ee
Merge branch 'feature_1732_add-pslot-tag' of github.com:TerrenceMcGui…
TerryMcGuinness-NOAA Jul 10, 2023
a1aaf6e
updates for adding has to pslot name
TerryMcGuinness-NOAA Jul 10, 2023
3707a4a
Merge branch 'NOAA-EMC:develop' into feature_1732_add-pslot-tag
TerrenceMcGuinness-NOAA Jul 11, 2023
115c799
fine tuning pslot with hash name
TerryMcGuinness-NOAA Jul 11, 2023
633f9fc
Merge branch 'feature_1732_add-pslot-tag' of github.com:TerrenceMcGui…
TerryMcGuinness-NOAA Jul 11, 2023
f2eaee7
forgot : on pslot line in casefile
TerryMcGuinness-NOAA Jul 11, 2023
3a47b41
removed -c -g -u from checkout to reduce time to build
TerryMcGuinness-NOAA Jul 11, 2023
2361130
fixed extra pslot removal in cron checks
TerryMcGuinness-NOAA Jul 12, 2023
bcd9b45
Merge branch 'feature_1732_add-pslot-tag' of github.com:TerrenceMcGui…
TerryMcGuinness-NOAA Jul 12, 2023
25508ec
case loop updates pslot bug fix in driver
TerryMcGuinness-NOAA Jul 12, 2023
7f84442
still needed pslot at the end of path to EXPDER for setup_xml in crea…
TerryMcGuinness-NOAA Jul 12, 2023
21cd42d
had to add EXPDIR onto the path where number of remaining cases are s…
TerryMcGuinness-NOAA Jul 12, 2023
12592b6
Update create_experiment.py
TerrenceMcGuinness-NOAA Jul 12, 2023
04efffe
Update check_ci.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
3658c32
added back two other cycled case files with updates
TerryMcGuinness-NOAA Jul 12, 2023
ff5c181
Merge branch 'feature_1732_add-pslot-tag' of github.com:TerrenceMcGui…
TerryMcGuinness-NOAA Jul 12, 2023
f19dc02
Update C96C48_hybatmDA.yaml
TerrenceMcGuinness-NOAA Jul 12, 2023
60df7e9
Update check_ci.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
96cf183
Update ci/scripts/driver.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
aee3c60
Update ci/scripts/driver.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
0f34d7c
Update ci/scripts/run_ci.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
a4d0922
Update ci/scripts/run_ci.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
2b6d64c
Update ci/scripts/run_ci.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
10233c2
Update ci/scripts/clone-build_ci.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
310348a
Update ci/scripts/check_ci.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
4e139c6
Update ci/scripts/check_ci.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
93b1f06
Update ci/scripts/check_ci.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
67a01f3
Update ci/scripts/check_ci.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
ff6429f
Update ci/scripts/check_ci.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
b33e394
Update ci/scripts/clone-build_ci.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
888ceb4
Update ci/scripts/run_ci.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
2a82708
Update ci/scripts/run_ci.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
61d242e
Update ci/scripts/check_ci.sh
TerrenceMcGuinness-NOAA Jul 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ci/cases/C48_S2S.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ experiment:
mode: forecast-only

arguments:
pslot: ${pslot}
app: S2S
resdet: 48
comrot: ${RUNTESTS}/${pslot}/COMROT
expdir: ${RUNTESTS}/${pslot}/EXPDIR
comrot: ${RUNTESTS}/COMROT
expdir: ${RUNTESTS}/EXPDIR
idate: 2021032312
edate: 2021032312
yaml: ${HOMEgfs_PR}/ci/platforms/gfs_defaults_ci-updates.yaml
5 changes: 3 additions & 2 deletions ci/cases/C96C48_hybatmDA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ experiment:
mode: cycled

arguments:
pslot: ${pslot}
app: ATM
resdet: 96
resens: 48
comrot: ${RUNTESTS}/${pslot}/COMROT
expdir: ${RUNTESTS}/${pslot}/EXPDIR
comrot: ${RUNTESTS}/COMROT
expdir: ${RUNTESTS}/EXPDIR
icsdir: ${ICSDIR_ROOT}/C96C48
idate: 2021122018
edate: 2021122106
Expand Down
5 changes: 3 additions & 2 deletions ci/cases/C96_atm3DVar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ experiment:
mode: cycled

arguments:
pslot: ${pslot}
app: ATM
resdet: 96
comrot: ${RUNTESTS}/${pslot}/COMROT
expdir: ${RUNTESTS}/${pslot}/EXPDIR
comrot: ${RUNTESTS}/COMROT
expdir: ${RUNTESTS}/EXPDIR
icsdir: ${ICSDIR_ROOT}/C96C48
idate: 2021122018
edate: 2021122106
Expand Down
20 changes: 10 additions & 10 deletions ci/scripts/check_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ set -eux
# 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 )"
Expand Down Expand Up @@ -78,11 +77,11 @@ for pr in ${pr_list}; do
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
#Check for PR success when ${pr_dir}/RUNTESTS/EXPDIR is void of subfolders
# since all successfull ones where previously removed
if [[ "${num_cases}" -eq 0 ]] && [[ -d "${pr_dir}/RUNTESTS" ]]; then
# shellcheck disable=SC2312
if [[ -z $(ls -A "${pr_dir}/RUNTESTS/EXPDIR") ]] ; then
Fixed Show fixed Hide fixed

Check notice

Code scanning / shellcheck

Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).

Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).
"${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}"
Expand All @@ -92,14 +91,14 @@ for pr in ${pr_list}; do
continue
fi

for cases in "${pr_dir}/RUNTESTS/"*; do
pslot=$(basename "${cases}") || true
for pslot_dir in "${pr_dir}/RUNTESTS/EXPDIR/"*; do
pslot=$(basename "${pslot_dir}") || true
if [[ -z "${pslot+x}" ]]; then
echo "No cases found in ${pr_dir}/RUNTESTS .. exiting"
echo "No experiments found in ${pslot_dir} .. exiting"
exit 0
fi
xml="${pr_dir}/RUNTESTS/${pslot}/EXPDIR/${pslot}/${pslot}.xml"
db="${pr_dir}/RUNTESTS/${pslot}/EXPDIR/${pslot}/${pslot}.db"
xml="${pslot_dir}/${pslot}.xml"
db="${pslot_dir}/${pslot}.db"
if [[ ! -f "${db}" ]]; then
continue
fi
Expand Down Expand Up @@ -138,7 +137,8 @@ for pr in ${pr_list}; do
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}"
#Remove Experment cases that completed successfully
rm -Rf "${pr_dir}/RUNTESTS/${pslot}"
rm -Rf "${pslot_dir}"
rm -Rf "${pr_dir}/RUNTESTS/COMROT/${pslot}"
fi
done
done
3 changes: 2 additions & 1 deletion ci/scripts/clone-build_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ echo "${commit}" > "../commit"
# run checkout script
cd sorc || exit 1
set +e
./checkout.sh -c -g -u >> log.checkout 2>&1
# TODO enable -u later when GDASApp tests are added
./checkout.sh -c -g >> log.checkout 2>&1
checkout_status=$?
if [[ ${checkout_status} != 0 ]]; then
{
Expand Down
7 changes: 2 additions & 5 deletions ci/scripts/create_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
with an error code of 0 upon success.
"""

import os
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from pathlib import Path

Expand Down Expand Up @@ -80,7 +81,6 @@ def input_args():
setup_expt_args = YAMLFile(path=user_inputs.yaml)

HOMEgfs = Path.absolute(Path(user_inputs.dir))
pslot = Path(user_inputs.yaml).stem
type = setup_expt_args.experiment.type
mode = setup_expt_args.experiment.mode

Expand All @@ -93,17 +93,14 @@ def input_args():
setup_expt_cmd.add_default_arg(f'--{conf}')
setup_expt_cmd.add_default_arg(str(value))

setup_expt_cmd.add_default_arg('--pslot')
setup_expt_cmd.add_default_arg(pslot)

logger.info(f'Run command: {setup_expt_cmd.command}')
setup_expt_stderr = str(Path.joinpath(HOMEgfs, 'ci', 'scripts', 'setup_expt.stderr'))
setup_expt_stdout = str(Path.joinpath(HOMEgfs, 'ci', 'scripts', 'setup_expt.stdout'))
print(setup_expt_stderr)
setup_expt_cmd(output=setup_expt_stdout, error=setup_expt_stderr)

setup_xml_cmd = Executable(Path.joinpath(HOMEgfs, 'workflow', 'setup_xml.py'))
expdir = Path.absolute(Path.joinpath(Path(setup_expt_args.arguments.expdir), Path(pslot)))
expdir = Path.absolute(Path.joinpath(Path(setup_expt_args.arguments.expdir), Path(setup_expt_args.arguments.pslot)))
setup_xml_cmd.add_default_arg(str(expdir))

logger.info(f'Run command: {setup_xml_cmd.command}')
Expand Down
8 changes: 6 additions & 2 deletions ci/scripts/driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,15 @@ for pr in ${pr_list}; do
#############################################################
HOMEgfs_PR="${pr_dir}/global-workflow"
export HOMEgfs_PR
cd "${HOMEgfs_PR}"
pr_sha=$(git rev-parse --short HEAD)

for yaml_config in "${HOMEgfs_PR}/ci/cases/"*.yaml; do
pslot=$(basename "${yaml_config}" .yaml) || true
case=$(basename "${yaml_config}" .yaml) || true
pslot="${case}_${pr_sha}"
export pslot
set +e
"${HOMEgfs}/ci/scripts/create_experiment.py" --yaml "${HOMEgfs_PR}/ci/cases/${pslot}.yaml" --dir "${HOMEgfs_PR}"
"${HOMEgfs}/ci/scripts/create_experiment.py" --yaml "${HOMEgfs_PR}/ci/cases/${case}.yaml" --dir "${HOMEgfs_PR}"
ci_status=$?
set -e
if [[ ${ci_status} -eq 0 ]]; then
Expand Down
12 changes: 6 additions & 6 deletions ci/scripts/run_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ for pr in ${pr_list}; do
continue
fi
num_cases=0
for cases in "${pr_dir}/RUNTESTS/"*; do
if [[ ! -d "${cases}" ]]; then
for pslot_dir in "${pr_dir}/RUNTESTS/EXPDIR/"*; do
if [[ ! -d "${pslot_dir}" ]]; then
continue
fi
((num_cases=num_cases+1))
# No more than two cases are going forward at a time for each PR
if [[ "${num_cases}" -gt "${max_concurrent_cases}" ]]; then
continue
fi
pslot=$(basename "${cases}")
xml="${pr_dir}/RUNTESTS/${pslot}/EXPDIR/${pslot}/${pslot}.xml"
db="${pr_dir}/RUNTESTS/${pslot}/EXPDIR/${pslot}/${pslot}.db"
echo "Running: ${rocotorun} -v 6 -w ${xml} -d ${db}"
pslot=$(basename "${pslot_dir}")
xml="${pslot_dir}/${pslot}.xml"
db="${pslot_dir}/${pslot}.db"
echo "Running: ${rocotorun} -v 10 -w ${xml} -d ${db}"
"${rocotorun}" -v 10 -w "${xml}" -d "${db}"
done
done