-
Notifications
You must be signed in to change notification settings - Fork 212
CTests extended validation for C48_ATM and staged C48_S2SW for gfs_fcst and gfs_atmos #3256
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
Merged
WalterKolczynski-NOAA
merged 219 commits into
NOAA-EMC:develop
from
TerrenceMcGuinness-NOAA:ctests_extended
Feb 3, 2025
Merged
Changes from all commits
Commits
Show all changes
219 commits
Select commit
Hold shift + click to select a range
987ae5b
added ctest dir with cmake to create an experment
61fcf83
added CMakeLists for creating initial case EXPDIR usint ctest
TerrenceMcGuinness-NOAA f5f6595
ready to test getting the job names
cbe3bab
move all operations of creating EXPDIR cases into configure phase
6a50e14
got cmake configure to work for EXPDIR
TerrenceMcGuinness-NOAA bcebeca
can not do both file and variable save for execute_process
be7a890
working cmake config up to output of job names
TerrenceMcGuinness-NOAA 2811629
Merge branch 'NOAA-EMC:develop' into ctest_jjobs_framework
TerrenceMcGuinness-NOAA 70a8183
loop over jobnames and create an experment for each
TerrenceMcGuinness-NOAA 72e5a9c
update JOB name update in loop
1f1fcd6
addded debug outputs
ee27b02
modifying plslot list to be only on a per case
TerrenceMcGuinness-NOAA bc76ddf
filter pslot list for only relevent cases
38838a6
refining get_job_names
d18ad01
modigied get_jobs_names to task and metatask names
ef0e066
got better jobname parcer working
TerrenceMcGuinness-NOAA 519a919
Merge branch 'NOAA-EMC:develop' into ctest_jjobs_framework
TerrenceMcGuinness-NOAA f813a1b
replaced generate_workflows with create_experment
8238228
removed non-existing ENVIRONMENT setting to consolated COMMAND line
bf579ee
got cmake script to use creat_experiment
TerrenceMcGuinness-NOAA 28ef1af
Merge branch 'NOAA-EMC:develop' into ctest_jjobs_framework
TerrenceMcGuinness-NOAA 374927f
just getting started with addeding a ctest
8b4fc4f
add in test for configured project
ce37d86
added ctest and testing
TerrenceMcGuinness-NOAA d4e3266
Merge branch 'NOAA-EMC:develop' into ctest_jjobs_framework
TerrenceMcGuinness-NOAA bb12cda
moved ctests dir to top HOMEgfs/ci/ctests with its own scripts dir
f78181c
added all jobs for tests for each case
46cddb7
added data stagging dependances and started it as a stub script
d6c3a49
Merge branch 'NOAA-EMC:develop' into ctest_jjobs_framework
TerrenceMcGuinness-NOAA 434f869
added driver for creating ctests from yaml files
99df88d
added a driver to create ctests from defintions in yaml files
e186173
added final step to loop over yaml files for creating functiona ctest…
c4a2780
Merge branch 'NOAA-EMC:develop' into ctest_jjobs_framework
TerrenceMcGuinness-NOAA 0183667
added second yaml case file for testing python driver
3088bff
added a few comments for each section
9d06df7
Merge branch 'NOAA-EMC:develop' into ctest_jjobs_framework
TerrenceMcGuinness-NOAA 674f8d6
made CMakeList.txt independent of python script
TerrenceMcGuinness-NOAA 68ca6ee
simplified CMakeList to be compatible with manin build, consolated cr…
TerrenceMcGuinness-NOAA f7bbd40
repurposed python script for generating args to man CMakeLists.txt
TerrenceMcGuinness-NOAA 36d497e
added lables to run tests in groups and added stubbed scripts
TerrenceMcGuinness-NOAA 808a4cf
created script and cases dir to isolate CMakeLists.txt
TerrenceMcGuinness-NOAA 81e640f
renamed test to create_experiment
TerrenceMcGuinness-NOAA a1d0f20
missed update to name of test from test_ to create_experiment_
TerrenceMcGuinness-NOAA 2cbf4ee
forgot to save contents of the stubbed scripts
TerrenceMcGuinness-NOAA 687217f
spelling error on create_experiment
TerrenceMcGuinness-NOAA 55766bd
got a few hints on using File Utils directly in case Yaml file
TerrenceMcGuinness-NOAA f69fb68
updated adding functional test as line enteries in CMakeLists.txt dir…
TerrenceMcGuinness-NOAA 3cc83c6
Cleaned up names to have Case and job name first
TerrenceMcGuinness-NOAA e1e1858
added file utils copy commands in gfs_fcst for C48_ATM
TerrenceMcGuinness-NOAA 5ce988f
started on stage data python script
TerrenceMcGuinness-NOAA cefaccd
added exec line for python staging script
TerrenceMcGuinness-NOAA bec03d9
deleted space in yaml file for copy commands
TerrenceMcGuinness-NOAA 5f9451b
Merge branch 'NOAA-EMC:develop' into ctest_jjobs_framework
TerrenceMcGuinness-NOAA 74fbf45
removed extra $ on JOB var
TerrenceMcGuinness-NOAA 19600f1
idate needed for PDY
TerrenceMcGuinness-NOAA 2caa229
updated stage data with idate for PDY and HH and made sure paths wher…
TerrenceMcGuinness-NOAA 749e54f
added copy using FIleHandler
TerrenceMcGuinness-NOAA 75450e1
copy command needs quotes
TerrenceMcGuinness-NOAA 0fc5d76
added sync() on file handler
TerrenceMcGuinness-NOAA ea01737
got FileUtil to work in stage data
TerrenceMcGuinness-NOAA e9c46f1
got started on execute
TerrenceMcGuinness-NOAA 2602166
execute needed shabang and exit 0
TerrenceMcGuinness-NOAA 1950af4
almost ready to launch execute.sh
TerrenceMcGuinness-NOAA c691c0e
Merge branch 'NOAA-EMC:develop' into ctest_jjobs_framework
TerrenceMcGuinness-NOAA 276a9bd
added working skeleton bash script for execute using rocotoboot with …
TerrenceMcGuinness-NOAA 283000e
added a few ICs that where missed
TerrenceMcGuinness-NOAA b2a6fec
removed extra scripts no longer used
TerrenceMcGuinness-NOAA 9525c74
added defulted values and over rides from command line
TerrenceMcGuinness-NOAA 74f7268
removed HOMEgfs for path to create expermient
TerrenceMcGuinness-NOAA 5cd1c5f
removed another unused script
TerrenceMcGuinness-NOAA c132786
fixed a few path errors with HOMEgfs still hanging around
TerrenceMcGuinness-NOAA 87674f2
Merge branch 'NOAA-EMC:develop' into ctest_jjobs_framework
TerrenceMcGuinness-NOAA e873722
added cmake_parse_arguments with extras and used inline template for …
TerrenceMcGuinness-NOAA 32c5f87
added template for cmake tests setup.sh
TerrenceMcGuinness-NOAA 128d0e6
had to add ARG_ header to labels names for depenancies for setup worked
TerrenceMcGuinness-NOAA abb2952
added bash wrapper to stage_data.py and made single job per yaml conf…
TerrenceMcGuinness-NOAA 1d54caf
added the part to drop in templated inline script for stage.sh
TerrenceMcGuinness-NOAA 2532576
getting stage.sh.in args to work for now
TerrenceMcGuinness-NOAA 0967f10
still getting args straintened out with staging
TerrenceMcGuinness-NOAA 8231519
added args in bash wrapper to stage.py to pick up ARG_CASE and ARG_JOB
TerrenceMcGuinness-NOAA 30466b9
updated args to stage.py to simply take yaml input
TerrenceMcGuinness-NOAA 3deeb41
had extra ) for updated add_test
TerrenceMcGuinness-NOAA 099a2cb
removed reading of pr case file for getting idate
TerrenceMcGuinness-NOAA 94dd64e
replaced JOB_CASE in path for inputs to TEST_NAME
TerrenceMcGuinness-NOAA a98d55d
updated path to yaml input to stage
TerrenceMcGuinness-NOAA 29517e3
ctest dir is ctests in path to YAML file for stage.py
TerrenceMcGuinness-NOAA 60a6136
finilized inputs to make stage.py to work without using CASE+JOB
TerrenceMcGuinness-NOAA b977e52
mnissed a couple or ARGS_ again this time in execute
TerrenceMcGuinness-NOAA 95be9f2
ARG are prefixes in execute add test
TerrenceMcGuinness-NOAA e9b0b6a
ARG are prefixes in execute add test 2
TerrenceMcGuinness-NOAA a72827c
ARG are prefixes in execute add test 3
TerrenceMcGuinness-NOAA 4f010a4
added MAKE_CURRENT_BINARY_DIR as templated VAR in stage
TerrenceMcGuinness-NOAA b79d445
made execute bash sript a template too
TerrenceMcGuinness-NOAA 16cd19f
forgot to save CMakeLists now has updated call to excute from script …
TerrenceMcGuinness-NOAA fffb13d
last bug for working execute phase
TerrenceMcGuinness-NOAA 5c5ac0f
ready to test x coders add for waiting for slurm job to complete
TerrenceMcGuinness-NOAA 06c8e8f
do not need link to wxflow anymore, added it to PYTHONPATH in bash wr…
TerrenceMcGuinness-NOAA edde418
Merge branch 'NOAA-EMC:develop' into ctest_jjobs_framework
TerrenceMcGuinness-NOAA d68b02e
path to wxflow in PYTHONPATH was wrong in stage template
TerrenceMcGuinness-NOAA b0602bc
generlized ARG over-ride and added check for exectution success from …
TerrenceMcGuinness-NOAA 30b3f3a
should have checked for End not END for success
TerrenceMcGuinness-NOAA 42084e7
oops need done at then of loop in execute bash sript
TerrenceMcGuinness-NOAA 8d71151
removed C48_S2SW.yaml for functional test as it is not ready yet
TerrenceMcGuinness-NOAA cf7be28
working on shellnorms
TerrenceMcGuinness-NOAA a49a642
working on more shellnorms
TerrenceMcGuinness-NOAA 466831d
working on even more shellnorms
TerrenceMcGuinness-NOAA 2d18461
working couple more shellnorms
TerrenceMcGuinness-NOAA 53b13e3
Merge branch 'NOAA-EMC:develop' into ctest_jjobs_framework
TerrenceMcGuinness-NOAA 4ee8d81
removed scripts used for getting system defaults and added top level …
TerrenceMcGuinness-NOAA b3518ca
added to yaml fun conf file to us jinja string modification TEST_DATE
TerrenceMcGuinness-NOAA 54f633b
typos in CMakeLists and module file for adding CMake on Orion
TerrenceMcGuinness-NOAA a182c44
added TEST_DATE as an agrment to adding a test in CMake List file
TerrenceMcGuinness-NOAA fd8a8bc
needed idate in arg to exexcute
TerrenceMcGuinness-NOAA 472d89c
just use par_yaml
TerrenceMcGuinness-NOAA 45d2901
trying to get args into yaml
TerrenceMcGuinness-NOAA 8ca4d7a
added TEST_DATA via data to template
TerrenceMcGuinness-NOAA 91d76e3
added TEST_DATE into arg to bash stage
TerrenceMcGuinness-NOAA 61e7ce3
changed test_date argument to datetime object so it can be used with …
TerrenceMcGuinness-NOAA 1860e05
MACHINE_ID is no longer used (removed from messae)
TerrenceMcGuinness-NOAA e979f75
updated arg to stagy.py for test_date to a str
TerrenceMcGuinness-NOAA 91f4331
missed commit (adding test_date arg to stage.py)
TerrenceMcGuinness-NOAA 17fd1da
added env vars to starge.py in wrapper via prefixed values to call
TerrenceMcGuinness-NOAA 48ec7c6
check if default is not used and needs to be set to valule for error …
TerrenceMcGuinness-NOAA 243d47b
did not have updated var name for STAGED_TEST_DIR in yaml file
TerrenceMcGuinness-NOAA c092b10
replaced scraping output file with status from sacct
TerrenceMcGuinness-NOAA 41b6aee
added extra step for making sure the submitted job_id is in the sacct…
TerrenceMcGuinness-NOAA 42fbc2a
remove white spaces from job_status
TerrenceMcGuinness-NOAA b17ca77
update path to validate stub and reduce first wait on sacct to 30 sec…
TerrenceMcGuinness-NOAA bee8efc
update a few shellnorm suggestions
TerrenceMcGuinness-NOAA 613d951
one more shellnorm for true on pipe
TerrenceMcGuinness-NOAA 53bfb62
innocuous extra line at end of toplevel CMake file
TerrenceMcGuinness-NOAA c6cfefb
consolated GFS ROOT path for staged data dir on orion
TerrenceMcGuinness-NOAA 02a03f1
added some more notes for validate subs
TerrenceMcGuinness-NOAA 02e1a92
remove extras from stage.py
TerrenceMcGuinness-NOAA 3da4c54
still had path woring to valication stub (has no *.in file)
TerrenceMcGuinness-NOAA c416370
another shellnorm || true
TerrenceMcGuinness-NOAA 52c5081
pynomrs spaces
TerrenceMcGuinness-NOAA 1b74559
pynomrs line space two
TerrenceMcGuinness-NOAA 99defb4
Merge branch 'NOAA-EMC:develop' into ctest_jjobs_framework
TerrenceMcGuinness-NOAA e965602
added back missing submodels gsi_enkf and gsi_utils
TerrenceMcGuinness-NOAA 241392d
updating to correct hash for submodule gsi_enkf
TerrenceMcGuinness-NOAA 4669e38
added inline documentation to the stage file python script
TerrenceMcGuinness-NOAA 892a6bf
added simple README.md file in the ctest directory
TerrenceMcGuinness-NOAA 3dff4d1
Merge branch 'develop' into ctest_jjobs_framework
TerrenceMcGuinness-NOAA b7f80cb
included instructions on how to add a new test in the README.md file
TerrenceMcGuinness-NOAA 898fcfe
Update README.md
TerrenceMcGuinness-NOAA 12cf0cf
Update README.md
TerrenceMcGuinness-NOAA eeb744f
Update README.md
TerrenceMcGuinness-NOAA 73211bc
Update README.md
TerrenceMcGuinness-NOAA f18f1ee
Update ctests/scripts/validate.sh
TerrenceMcGuinness-NOAA b1a9fd2
added validate.sh.in template bash wrapper script
TerrenceMcGuinness-NOAA f058450
added cmake to Hercules gwsetup modulefile
TerrenceMcGuinness-NOAA eede574
updated path to validate.sh
TerrenceMcGuinness-NOAA 7da3828
needed to remove bash from the COMMAND line for validate.sh
TerrenceMcGuinness-NOAA 5f722e3
Merge branch 'NOAA-EMC:develop' into ctest_jjobs_framework
TerrenceMcGuinness-NOAA e48ae52
allow the build to continue whe ctests can not be created without the…
TerrenceMcGuinness-NOAA 1318858
added folder compair code to capture output of job
TerrenceMcGuinness-NOAA 704887d
added to helper file util to copy files
TerrenceMcGuinness-NOAA 69469ea
removed full path and only save relative path
TerrenceMcGuinness-NOAA 3079028
added pwd to folder where the files are
TerrenceMcGuinness-NOAA ab43e45
added shabang
TerrenceMcGuinness-NOAA 137f0b0
use two args for copy files as relative paths
TerrenceMcGuinness-NOAA 3798c22
use two args for copy files as relative paths 2
TerrenceMcGuinness-NOAA 2328b6f
added basic validation script
TerrenceMcGuinness-NOAA d985542
fixed bugs in validate.sh.in
TerrenceMcGuinness-NOAA 1118074
extra / got in yaml
TerrenceMcGuinness-NOAA d7777dc
had to add underscores back in to yaml file
TerrenceMcGuinness-NOAA ea32a7c
had to add more underscores back in to yaml file
TerrenceMcGuinness-NOAA e082fc3
mistakenly had input files in path for mkdir
TerrenceMcGuinness-NOAA fb6bcc2
Merge branch 'NOAA-EMC:develop' into ctest_work
TerrenceMcGuinness-NOAA 36303c1
print ok for each file on verify
3fdedde
missed a quote on command line of validate.sh.in
ccd50e7
fixed but name of YAML_FILE and permisions to run pytnon script for v…
bc107c8
missed spelling of STAGED_TESTS_DIR in yaml and needed check for fail…
ae626ba
fixed var name on arg and listed only files from test when output che…
TerrenceMcGuinness-NOAA e27f0c3
merged develop into ctest_work
TerrenceMcGuinness-NOAA 21b8cad
used bash command to get rocotoboot_dryrun that is in the path
TerrenceMcGuinness-NOAA e212e80
Merge branch 'NOAA-EMC:develop' into ctest_work
TerrenceMcGuinness-NOAA 087bd24
adding case C48_S2SW for JJOB gfs_fcst_seg0
TerrenceMcGuinness-NOAA 54a8abf
trying to add 6 hours to TEST_DATE for ocean retart in C48_S3SW stagg…
TerrenceMcGuinness-NOAA df109e1
used add_to_datetime with a time_delta function from the tmetools wxf…
TerrenceMcGuinness-NOAA 466b19f
finaly got 6 hour offest to work with TEST_DATE in jinja yaml
TerrenceMcGuinness-NOAA 5011dc5
added ice restart in staged data
TerrenceMcGuinness-NOAA 76491f8
fixed wrong path to ice restart and added tile6 atmos IC to input_fil…
TerrenceMcGuinness-NOAA a24020d
Merge branch 'NOAA-EMC:develop' into ctest_work
TerrenceMcGuinness-NOAA 105da3a
first pass at adding ctest gfs_atmos_prod_f000
TerrenceMcGuinness-NOAA 598f212
added C48_S2SW_gfs_atmos_prod_f000-f003 JJOB
TerrenceMcGuinness-NOAA 0de2327
Merge branch 'NOAA-EMC:develop' into ctest_work
TerrenceMcGuinness-NOAA ad57686
tried to simplfy readablity of input paths by using CYC and PDY and t…
TerrenceMcGuinness-NOAA 2f6b42f
added CYC and PDY alias to C48_ATM for readablity
TerrenceMcGuinness-NOAA 86d783f
missed alias for PYD on offset
TerrenceMcGuinness-NOAA c3273e9
fixed check for output files in validate to signlal non-fail subbed w…
TerrenceMcGuinness-NOAA 3132b8f
update READMe with some finer explinations
TerrenceMcGuinness-NOAA 5cd73e5
added some qulifying comments about validation in the yaml files
TerrenceMcGuinness-NOAA 4abf286
added Numpydoc doc strings
TerrenceMcGuinness-NOAA 9b5b032
needed trailing lines at the end of a couple of files
TerrenceMcGuinness-NOAA 9570f8a
still needed trailing line on the CMakefile
TerrenceMcGuinness-NOAA 1dd04fe
Update ctests/scripts/validate.py
TerrenceMcGuinness-NOAA 27e083e
Update ctests/scripts/validate.py
TerrenceMcGuinness-NOAA f930224
Update ctests/scripts/validate.py
TerrenceMcGuinness-NOAA 3b65b38
Update ctests/scripts/validate.py
TerrenceMcGuinness-NOAA c4c96e2
Merge branch 'NOAA-EMC:develop' into ctests_extended
TerrenceMcGuinness-NOAA b2bda5a
Update ctests/scripts/validate.py
TerrenceMcGuinness-NOAA 9bfe5e0
Update ctests/scripts/validate.py
TerrenceMcGuinness-NOAA e58bf3b
Merge branch 'NOAA-EMC:develop' into ctests_extended
TerrenceMcGuinness-NOAA efd1318
updated staged python script to use to_datetime aswell
TerrenceMcGuinness-NOAA ffb5c7e
made CYC cyc in yaml case files
TerrenceMcGuinness-NOAA 9fdd433
fixed main() indentation in the stage python script
TerrenceMcGuinness-NOAA c82b4b7
pynomrs space needced in stage python script before main block
TerrenceMcGuinness-NOAA ecc2a70
fixed bug introduced by suggested commit from reviewer regarding logg…
TerrenceMcGuinness-NOAA 470a044
Merge branch 'NOAA-EMC:develop' into ctests_extended
TerrenceMcGuinness-NOAA 5a17753
Update ctests/cases/C48_S2SW_gfs_fcst_seg0.yaml
TerrenceMcGuinness-NOAA b872311
Update ctests/cases/C48_S2SW_gfs_fcst_seg0.yaml
TerrenceMcGuinness-NOAA 7033b61
added doc-blocks in validate python script
TerrenceMcGuinness-NOAA 825de73
Merge branch 'NOAA-EMC:develop' into ctests_extended
TerrenceMcGuinness-NOAA 6bf32c2
Update ctests/cases/C48_ATM_gfs_fcst_seg0.yaml
TerrenceMcGuinness-NOAA d31f8f7
Update ctests/cases/C48_S2SW_gfs_atmos_prod_f000-f003.yaml
TerrenceMcGuinness-NOAA 26eddb8
Update ctests/cases/C48_S2SW_gfs_atmos_prod_f000-f003.yaml
TerrenceMcGuinness-NOAA 810b253
Update ctests/cases/C48_ATM_gfs_fcst_seg0.yaml
TerrenceMcGuinness-NOAA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| {% set H_offset = "-6H" %} | ||
| {% set H_timedelta = H_offset | to_timedelta %} | ||
| {% set TEST_DATE_offset = TEST_DATE | add_to_datetime(H_timedelta) %} | ||
|
|
||
| {% set cyc = TEST_DATE | strftime('%H') %} | ||
| {% set cyc_offset = TEST_DATE_offset | strftime('%H') %} | ||
|
|
||
| {% set PDY = TEST_DATE | to_YMD %} | ||
| {% set PDY_offset = TEST_DATE_offset | to_YMD %} | ||
|
|
||
| input_files: | ||
| mkdir: | ||
| - "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input" | ||
| - "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep" | ||
| - "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gdas.{{ PDY }}/{{cyc_offset}}/model/ocean/restart" | ||
| - "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gdas.{{ PDY }}/{{cyc_offset}}/model/ice/restart" | ||
| copy: | ||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/gfs_ctrl.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/gfs_ctrl.nc"] | ||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/gfs_data.tile1.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/gfs_data.tile1.nc"] | ||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/gfs_data.tile2.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/gfs_data.tile2.nc"] | ||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/gfs_data.tile3.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/gfs_data.tile3.nc"] | ||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/gfs_data.tile4.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/gfs_data.tile4.nc"] | ||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/gfs_data.tile5.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/gfs_data.tile5.nc"] | ||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/gfs_data.tile6.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/gfs_data.tile6.nc"] | ||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/sfc_data.tile1.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/sfc_data.tile1.nc"] | ||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/sfc_data.tile2.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/sfc_data.tile2.nc"] | ||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/sfc_data.tile3.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/sfc_data.tile3.nc"] | ||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/sfc_data.tile4.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/sfc_data.tile4.nc"] | ||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/sfc_data.tile5.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/sfc_data.tile5.nc"] | ||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/sfc_data.tile5.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/sfc_data.tile5.nc"] | ||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/sfc_data.tile6.nc", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/atmos/input/sfc_data.tile6.nc"] | ||
|
|
||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfswave.mod_def.glo_200", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfswave.mod_def.glo_200"] | ||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfswave.mod_def.uglo_100km", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/model/wave/prep/gfswave.mod_def.uglo_100km"] | ||
|
|
||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gdas.{{ PDY_offset }}/{{ cyc_offset }}/model/ocean/restart/{{ TEST_DATE | strftime('%Y%m%d.%H0000') }}.MOM.res.nc", | ||
| "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gdas.{{ PDY_offset }}/{{ cyc_offset }}/model/ocean/restart/{{ TEST_DATE | strftime('%Y%m%d.%H0000') }}.MOM.res.nc" ] | ||
|
|
||
| - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/input_files/gdas.{{ PDY_offset }}/{{ cyc_offset }}/model/ice/restart/{{ TEST_DATE | strftime('%Y%m%d.%H0000') }}.cice_model.res.nc", | ||
| "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gdas.{{ PDY_offset }}/{{ cyc_offset }}/model/ice/restart/{{ TEST_DATE | strftime('%Y%m%d.%H0000') }}.cice_model.res.nc" ] | ||
|
|
||
| # TODO - To enable the validation step include specific files to compare against the results from running the test. | ||
| # Note: The below three files is only an example. The cmpfiles tag means it will use checksum to compare the files in the two locations. | ||
| # Other extensions can be added and/or folded into the FileUtils class in wxflow FileUtilities.py | ||
| # | ||
| #output_files: | ||
| # cmpfiles: | ||
| # - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/output_files/gfs.{{ PDY }}/{{ cyc }}/conf/ufs.diag_table", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/conf/ufs.diag_table"] | ||
| # - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/output_files/gfs.{{ PDY }}/{{ cyc }}/conf/ufs.input.nml", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/conf/ufs.input.nml"] | ||
| # - ["{{ 'STAGED_TESTS_DIR' | getenv }}/{{ 'TEST_NAME' | getenv }}/output_files/gfs.{{ PDY }}/{{ cyc }}/conf/ufs.model_configure", "{{ 'RUNTESTS' | getenv }}/COMROOT/{{ 'TEST_NAME' | getenv }}/gfs.{{ PDY }}/{{ cyc }}/conf/ufs.model_configure"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| #!/usr/bin/env python3 | ||
| """ | ||
| validate.py | ||
|
|
||
| Validation script that checks file checksums and verifies test outputs. | ||
|
|
||
| Usage | ||
| ----- | ||
| validate.py --yaml <path_to_yaml> --test_date <YYYYMMDDHH> | ||
|
|
||
| Parameters | ||
| ---------- | ||
| --yaml : str | ||
| Path to the YAML configuration file. | ||
| --test_date : str | ||
| Test date in the format YYYYMMDDHH. | ||
|
|
||
| """ | ||
|
|
||
| import sys | ||
| import argparse | ||
| from pathlib import Path | ||
| import hashlib | ||
| from wxflow import parse_j2yaml, Logger, logit, to_datetime | ||
|
|
||
| logger = Logger(level="DEBUG", colored_log=True) | ||
|
|
||
|
|
||
| def parse_args(): | ||
| """ | ||
| parse_args | ||
| Parses command line arguments. | ||
|
|
||
| Returns | ||
| ------- | ||
| argparse.Namespace | ||
| Parsed command line arguments. | ||
| """ | ||
| parser = argparse.ArgumentParser() | ||
| parser.add_argument("--yaml", required=True) | ||
| parser.add_argument("--test_date", required=True) | ||
| return parser.parse_args() | ||
|
|
||
|
|
||
| def file_checksum(path): | ||
| """ | ||
| file_checksum | ||
| Computes the MD5 checksum of a file. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| path : str | ||
| Path to the file. | ||
|
|
||
| Returns | ||
| ------- | ||
| str | ||
| MD5 checksum of the file. | ||
| """ | ||
| hasher = hashlib.md5() | ||
| with open(path, "rb") as f: | ||
| for chunk in iter(lambda: f.read(4096), b""): | ||
| hasher.update(chunk) | ||
| return hasher.hexdigest() | ||
|
|
||
|
|
||
| def validate_cmpfiles(config): | ||
| """ | ||
| validate_cmpfiles | ||
| Validates that the checksums of paired files match. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| config : dict | ||
| Configuration dictionary containing file pairs to compare. | ||
|
|
||
| Raises | ||
| ------ | ||
| ValueError | ||
| If the checksums of any paired files do not match. | ||
| """ | ||
| cmpfiles = config.get("output_files", {}).get("cmpfiles", []) | ||
| for pair in cmpfiles: | ||
| file_a, file_b = pair | ||
| if file_checksum(file_a) != file_checksum(file_b): | ||
| logger.error(f"Checksum mismatch: {file_a} vs {file_b}") | ||
| raise ValueError(f"Checksum mismatch: {file_a} vs {file_b}") | ||
| logger.info(f"checksums match: {file_a} vs {file_b}") | ||
|
|
||
|
|
||
| @logit(logger) | ||
| def main(): | ||
| """ | ||
| main | ||
| Main function that parses arguments, reads configuration, and validates file checksums. | ||
|
|
||
| Raises | ||
| ------ | ||
| SystemExit | ||
| If no output files are found in the configuration. | ||
| """ | ||
| args = parse_args() | ||
|
|
||
| data = {} | ||
| if args.test_date: | ||
| # Parse test date from string to datetime object | ||
| data['TEST_DATE'] = to_datetime(args.test_date) | ||
|
|
||
| files = parse_j2yaml(path=args.yaml, data=data) | ||
| if 'output_files' not in files: | ||
| logger.info(f"No output files found for test: {args.yaml}") | ||
| logger.info("Nothing to validate (TODO - Stubbed).") | ||
| sys.exit(0) | ||
|
|
||
| validate_cmpfiles(files) | ||
| logger.info(f"All files exist and pass checksum for test: {args.yaml}") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.