Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
dbd2b50
Old repo went stale, trying fresh
BrianCurtis-NOAA Mar 28, 2021
c7ca541
Check for BL_DATE in PR body BEFORE getting far into the Job
BrianCurtis-NOAA Mar 28, 2021
de8a812
Raised error at wrong point in get_bl_date()
BrianCurtis-NOAA Mar 28, 2021
b68615f
BL JOBS PASSED: hera.gnu. Updated rt.sh with new develop date: 20210324
BrianCurtis-NOAA Mar 28, 2021
c91b9d6
change rt.sh to work for code
BrianCurtis-NOAA Mar 28, 2021
8c5cdf9
Merge branch 'feature/autort-bl' of https://github.com/BrianCurtis-NO…
BrianCurtis-NOAA Mar 28, 2021
4134be2
Make logging better in update_rt_sh
BrianCurtis-NOAA Mar 28, 2021
1447195
Lets not go through with the BL job if the directory already exists a…
BrianCurtis-NOAA Mar 28, 2021
29f1944
BL JOBS PASSED: hera.gnu. Updated rt.sh with new develop date: 20210331
BrianCurtis-NOAA Mar 29, 2021
58da308
Search for BL_DATE= not BL_DATE as the latter is not unique
BrianCurtis-NOAA Mar 29, 2021
a256db4
need to test date that doesn't match code
BrianCurtis-NOAA Mar 29, 2021
7798cac
BL JOBS PASSED: hera.gnu. Updated rt.sh with new develop date: 20210331
BrianCurtis-NOAA Mar 29, 2021
1168e41
Adjusting to upstream date for test with RT
BrianCurtis-NOAA Mar 29, 2021
2bce7e4
RT JOBS PASSED: hera.gnu. Log file uploaded. skip-ci
BrianCurtis-NOAA Mar 29, 2021
7981107
Reverting regression test log, and fixing hera directories for emc.ne…
BrianCurtis-NOAA Mar 29, 2021
5df473d
Don't need to skip-ci any more
BrianCurtis-NOAA Mar 29, 2021
20634a5
Lets look in ufs-community and not BrianCurtis-NOAA for repo PR's
BrianCurtis-NOAA Mar 30, 2021
6297c15
Adjustments for GAEA and HERA
BrianCurtis-NOAA Mar 30, 2021
3192ab0
Allow empty commit messages
BrianCurtis-NOAA Mar 30, 2021
3a1daf7
Run RT job after successful BL Job
BrianCurtis-NOAA Mar 30, 2021
7c6330a
Space issues from bad editor
BrianCurtis-NOAA Mar 30, 2021
4e68e6f
Some fixes
BrianCurtis-NOAA Mar 31, 2021
db102d0
Fixes from Gaea tests
BrianCurtis-NOAA Mar 31, 2021
ff19c26
Update to h-nems accouunt and storage locations on Jet
BrianCurtis-NOAA Apr 7, 2021
67eb9f3
FAIL is not shown where baselines are there but jobs does not complet…
BrianCurtis-NOAA Apr 8, 2021
adddae3
Merge from upstream/develop and conflict resolution
BrianCurtis-NOAA Apr 9, 2021
e5a1b21
test addition
BrianCurtis-NOAA Apr 9, 2021
a6008f8
test subtraction
BrianCurtis-NOAA Apr 9, 2021
ddea93c
Cheyenne Fixes
BrianCurtis-NOAA Apr 19, 2021
1e591a6
Need to fail nicely when PR owners block commits by maintainers
BrianCurtis-NOAA Apr 20, 2021
89fb16c
Merge branch 'feature/autort-bl' of https://github.com/BrianCurtis-NO…
BrianCurtis-NOAA Apr 20, 2021
9d60073
Merge branch 'develop' into feature/autort-bl
BrianCurtis-NOAA Apr 22, 2021
d1e13a9
Typo in RTBLDIR
BrianCurtis-NOAA Apr 26, 2021
0e9a294
New autort location on cheyenne. lets note when baselines are complet…
BrianCurtis-NOAA May 27, 2021
8e85cfc
/glade/scratch/ not /glade/work
BrianCurtis-NOAA May 27, 2021
7f343ff
remove f-string where no variables are
BrianCurtis-NOAA Jun 2, 2021
c01b725
line had tab indentation instead of space
BrianCurtis-NOAA Jun 3, 2021
59ca5da
Lets check to see if the baseline dir exists before running BL job
BrianCurtis-NOAA Aug 11, 2021
f2533ae
Add a comment to the PR text on BLDIR existing
BrianCurtis-NOAA Aug 11, 2021
0cf6bf3
job_obj needs to be added to call variables
BrianCurtis-NOAA Aug 11, 2021
ad5b017
Special case for orion to use adjust_permissions.sh
BrianCurtis-NOAA Aug 11, 2021
0c11ec9
Merge branch 'feature/autort-bl' of https://github.com/BrianCurtis-NO…
BrianCurtis-NOAA Aug 11, 2021
0d6539f
Hera ECFLOW node adjustments
BrianCurtis-NOAA Aug 11, 2021
e56a045
Merge branch 'feature/autort-bl' of https://github.com/BrianCurtis-NO…
BrianCurtis-NOAA Aug 11, 2021
af4e392
Merge branch 'develop' of https://github.com/ufs-community/ufs-weathe…
BrianCurtis-NOAA Aug 19, 2021
ad29b5b
Merge branch 'develop' of https://github.com/ufs-community/ufs-weathe…
BrianCurtis-NOAA Aug 19, 2021
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
28 changes: 18 additions & 10 deletions tests/auto/jobs/bl.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def run(job_obj):
pr_repo_loc, repo_dir_str = clone_pr_repo(job_obj, workdir)
bldate = get_bl_date(job_obj, pr_repo_loc)
bldir = f'{blstore}/develop-{bldate}/{job_obj.compiler.upper()}'
bldirbool = check_for_bl_dir(bldir, job_obj)
run_regression_test(job_obj, pr_repo_loc)
post_process(job_obj, pr_repo_loc, repo_dir_str, rtbldir, bldir)

Expand All @@ -24,8 +25,8 @@ def set_directories(job_obj):
f'REGRESSION_TEST_{job_obj.compiler.upper()}'
elif job_obj.machine == 'jet':
workdir = '/lfs4/HFIP/h-nems/emc.nemspara/autort/pr'
blstore = '/lfs4/HFIP/hfv3gfs/RT/NEMSfv3gfs/'
rtbldir = '/lfs4/HFIP/hfv3gfs/emc.nemspara/RT_BASELINE/'\
blstore = '/lfs4/HFIP/h-nems/emc.nemspara/RT/NEMSfv3gfs/'
rtbldir = '/lfs4/HFIP/h-nems/emc.nemspara/RT_BASELINE/'\
f'emc.nemspara/FV3_RT/REGRESSION_TEST_{job_obj.compiler.upper()}'
elif job_obj.machine == 'gaea':
workdir = '/lustre/f2/pdata/ncep/emc.nemspara/autort/pr'
Expand All @@ -38,9 +39,9 @@ def set_directories(job_obj):
rtbldir = '/work/noaa/stmp/bcurtis/stmp/bcurtis/FV3_RT/'\
f'REGRESSION_TEST_{job_obj.compiler.upper()}'
elif job_obj.machine == 'cheyenne':
workdir = '/glade/work/heinzell/fv3/ufs-weather-model/auto-rt'
blstore = '/glade/p/ral/jntp/GMTB/ufs-weather-model/RT'
rtbldir = '/glade/work/heinzell/FV3_RT/'\
workdir = '/glade/scratch/dtcufsrt/autort/tests/auto/pr'
blstore = '/glade/p/ral/jntp/GMTB/ufs-weather-model/RT/NEMSfv3gfs'
rtbldir = '/glade/scratch/dtcufsrt/FV3_RT/'\
f'REGRESSION_TEST_{job_obj.compiler.upper()}'
else:
logger.critical(f'Machine {job_obj.machine} is not supported for this job')
Expand All @@ -54,18 +55,20 @@ def set_directories(job_obj):
return workdir, rtbldir, blstore


def check_for_bl_dir(bldir):
def check_for_bl_dir(bldir, job_obj):
logger = logging.getLogger('BL/CHECK_FOR_BL_DIR')
logger.info('Checking if baseline directory exists')
if os.path.exists(bldir):
logger.critical(f'Baseline dir: {bldir} exists. It should not, yet.')
job_obj.comment_text_append(f'{bldir}\n Exists already. '
'It should not yet. Please delete.')
raise FileExistsError
return False


def create_bl_dir(bldir):
def create_bl_dir(bldir, job_obj):
logger = logging.getLogger('BL/CREATE_BL_DIR')
if not check_for_bl_dir(bldir):
if not check_for_bl_dir(bldir, job_obj):
os.makedirs(bldir)
if not os.path.exists(bldir):
logger.critical(f'Someting went wrong creating {bldir}')
Expand Down Expand Up @@ -154,9 +157,12 @@ def post_process(job_obj, pr_repo_loc, repo_dir_str, rtbldir, bldir):
filepath = f'{pr_repo_loc}/{rt_log}'
rt_dir, logfile_pass = process_logfile(job_obj, filepath)
if logfile_pass:
create_bl_dir(bldir)
create_bl_dir(bldir, job_obj)
move_bl_command = [[f'mv {rtbldir}/* {bldir}/', pr_repo_loc]]
if job_obj.machine == 'orion':
move_bl_command.append([f'/bin/bash --login adjust_permissions.sh orion develop-{bldate}', blstore])
job_obj.run_commands(logger, move_bl_command)
job_obj.comment_text_append('Baseline creation and move successful')
logger.info('Starting RT Job')
rt.run(job_obj)
logger.info('Finished with RT Job')
Expand Down Expand Up @@ -196,10 +202,12 @@ def get_bl_date(job_obj, pr_repo_loc):
def process_logfile(job_obj, logfile):
logger = logging.getLogger('BL/PROCESS_LOGFILE')
rt_dir = []
fail_string_list = ['Test', 'failed']
if os.path.exists(logfile):
with open(logfile) as f:
for line in f:
if 'FAIL' in line and 'Test' in line:
if all(x in line for x in fail_string_list):
# if 'FAIL' in line and 'Test' in line:
job_obj.comment_text_append(f'{line.rstrip(chr(10))}')
elif 'working dir' in line and not rt_dir:
logger.info(f'Found "working dir" in line: {line}')
Expand Down
36 changes: 23 additions & 13 deletions tests/auto/jobs/rt.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def set_directories(job_obj):
elif job_obj.machine == 'orion':
workdir = '/work/noaa/nems/emc.nemspara/autort/pr'
elif job_obj.machine == 'cheyenne':
workdir = '/glade/work/heinzell/fv3/ufs-weather-model/auto-rt'
workdir = '/glade/scratch/dtcufsrt/autort/tests/auto/pr'
else:
print(f'Machine {job_obj.machine} is not supported for this job')
raise KeyError
Expand Down Expand Up @@ -94,26 +94,36 @@ def post_process(job_obj, pr_repo_loc, repo_dir_str, branch):
filepath = f'{pr_repo_loc}/{rt_log}'
rt_dir, logfile_pass = process_logfile(job_obj, filepath)
if logfile_pass:
move_rt_commands = [
[f'git pull --ff-only origin {branch}', pr_repo_loc],
[f'git add {rt_log}', pr_repo_loc],
[f'git commit -m "RT JOBS PASSED: {job_obj.machine}'
f'.{job_obj.compiler}. Log file uploaded."',
pr_repo_loc],
['sleep 10', pr_repo_loc],
[f'git push origin {branch}', pr_repo_loc]
]
job_obj.run_commands(logger, move_rt_commands)
remove_pr_data(job_obj, pr_repo_loc, repo_dir_str, rt_dir)
if job_obj.preq_dict['preq'].maintainer_can_modify:
move_rt_commands = [
[f'git pull --ff-only origin {branch}', pr_repo_loc],
[f'git add {rt_log}', pr_repo_loc],
[f'git commit -m "RT JOBS PASSED: {job_obj.machine}'
f'.{job_obj.compiler}. Log file uploaded.\n\n'
'on-behalf-of @ufs-community"',
pr_repo_loc],
['sleep 10', pr_repo_loc],
[f'git push origin {branch}', pr_repo_loc]
]
job_obj.run_commands(logger, move_rt_commands)
remove_pr_data(job_obj, pr_repo_loc, repo_dir_str, rt_dir)
else:
job_obj.comment_text_append(f'Cannot upload {job_obj.machine}.'\
f'{job_obj.compiler} RT Log'\
'It is blocked by PR owner')
job_obj.comment_text_append(f'Please obtain logs from {pr_repo_loc}')
job_obj.preq_dict['preq'].create_issue_comment(job_obj.comment_text)


def process_logfile(job_obj, logfile):
logger = logging.getLogger('RT/PROCESS_LOGFILE')
rt_dir = []
fail_string_list = ['Test', 'failed']
if os.path.exists(logfile):
with open(logfile) as f:
for line in f:
if 'FAIL' in line and 'Test' in line:
if all(x in line for x in fail_string_list):
# if 'FAIL' in line and 'Test' in line:
job_obj.comment_text_append(f'{line.rstrip(chr(10))}')
elif 'working dir' in line and not rt_dir:
rt_dir = os.path.split(line.split()[-1])[0]
Expand Down
4 changes: 3 additions & 1 deletion tests/auto/rt_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ def setup_env():
hostname = os.getenv('HOSTNAME')
if bool(re.match(re.compile('hfe.+'), hostname)):
machine = 'hera'
elif bool(re.match(re.compile('hecflow.+'), hostname)):
machine = 'hera'
elif bool(re.match(re.compile('fe.+'), hostname)):
machine = 'jet'
os.environ['ACCNR'] = 'h-nems'
Expand All @@ -220,7 +222,7 @@ def setup_env():
os.environ['ACCNR'] = 'nggps_emc'
elif bool(re.match(re.compile('Orion-login.+'), hostname)):
machine = 'orion'
elif bool(re.match(re.compile('.+.cheyenne.ucar.edu'), hostname)):
elif bool(re.match(re.compile('chadmin.+'), hostname)):
machine = 'cheyenne'
os.environ['ACCNR'] = 'P48503002'
else:
Expand Down
6 changes: 5 additions & 1 deletion tests/auto/start_rt_auto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set -eux
if [[ $HOSTNAME == hfe* ]]; then
export PATH=/scratch1/NCEPDEV/nems/emc.nemspara/soft/miniconda3/bin:$PATH
export PYTHONPATH=/scratch1/NCEPDEV/nems/emc.nemspara/soft/miniconda3/lib/python3.8/site-packages
elif [[ $HOSTNAME == hecflow* ]]; then
export PATH=/scratch1/NCEPDEV/nems/emc.nemspara/soft/miniconda3/bin:$PATH
export PYTHONPATH=/scratch1/NCEPDEV/nems/emc.nemspara/soft/miniconda3/lib/python3.8/site-packages
elif [[ $HOSTNAME == Orion-login-* ]]; then
export PATH=/work/noaa/nems/emc.nemspara/soft/miniconda3/bin:$PATH
export PYTHONPATH=/work/noaa/nems/emc.nemspara/soft/miniconda3/lib/python3.8/site-packages
Expand All @@ -13,7 +16,8 @@ elif [[ $HOSTNAME == fe* ]]; then
elif [[ $HOSTNAME == gaea* ]]; then
export PATH=/lustre/f2/pdata/esrl/gsd/contrib/miniconda3/4.8.3/envs/ufs-weather-model/bin:$PATH
export PYTHONPATH=/lustre/f2/pdata/esrl/gsd/contrib/miniconda3/4.8.3/lib/python3.8/site-packages
elif [[ $HOSTNAME == *cheyenne* ]]; then
elif [[ $HOSTNAME == *chadmin* ]]; then
export MACHINE_ID=cheyenne
export PATH=/glade/p/ral/jntp/tools/miniconda3/4.8.3/envs/ufs-weather-model/bin:/glade/p/ral/jntp/tools/miniconda3/4.8.3/bin:$PATH
export PYTHONPATH=/glade/p/ral/jntp/tools/miniconda3/4.8.3/envs/ufs-weather-model/lib/python3.8/site-packages:/glade/p/ral/jntp/tools/miniconda3/4.8.3/lib/python3.8/site-packages
else
Expand Down