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 rocoto sh tag, script to check netcdf file and apply this to check ocean output #2484

Merged
merged 8 commits into from
Apr 17, 2024

Conversation

aerorahul
Copy link
Contributor

Description

This PR:

  • adds a Rocoto dependency tag that executes a shell command. The return code of the shell expression serves as a dependency check
  • adds a script that executes ncdump on a netCDF file. If the file is a valid netCDF file, the return code is 0, else it is non-zero
  • combines the above 2 to use as a dependency check for MOM6 output. If the model is still in the process of writing out the ocean output, the rocoto will execute the shell script and gather the return code.

This PR also:

  • changes permissions on some ush/ scripts that did not have executable permissions.

Resolves #2328

With the addition of the shtag, the gfsocean_prod dependency will look like:

<dependency>
    <and>
        <datadep age="120"><cyclestr>&ROTDIR;/gfs.@Y@m@d/@H//model_data/ocean/history/[email protected]_avg.#dep#.nc</cyclestr></datadep>
        <sh shell="/bin/sh"><cyclestr>&HOMEgfs;/ush/check_netcdf.sh &ROTDIR;/gfs.@Y@m@d/@H//model_data/ocean/history/[email protected]_avg.#dep#.nc</cyclestr></sh>
    </and>
</dependency>

Type of change

  • New feature (adds functionality)

Change characteristics

  • Is this a breaking change (a change in existing functionality)? NO
  • Does this change require a documentation update? YES

How has this been tested?

This was tested at low resolution and in a standalone XML where an invalid netCDF file was purposefully placed in the path to check for rocoto status.
This should be tested in the case where the issue was first seen and reported.

Checklist

  • Any dependent changes have been merged and published
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing tests pass with my changes
  • I have made corresponding changes to the documentation if necessary

…script that does a ncdump. If a file is incomplete or invalid, return code is non-zero. Combine those two to check if the ocean output is valid before triggering ocean_prod jobs
ush/check_netcdf.sh Fixed Show fixed Hide fixed
ush/check_netcdf.sh Fixed Show fixed Hide fixed
ush/check_netcdf.sh Outdated Show resolved Hide resolved
workflow/rocoto/rocoto.py Show resolved Hide resolved
@NeilBarton-NOAA
Copy link
Contributor

tagging @EricSinsky-NOAA for awareness

@GwenChen-NOAA
Copy link
Contributor

Adding @jiandewang.

@WalterKolczynski-NOAA WalterKolczynski-NOAA added the CI-Hera-Ready **CM use only** PR is ready for CI testing on Hera label Apr 15, 2024
@emcbot emcbot added CI-Hera-Building **Bot use only** CI testing is cloning/building on Hera CI-Hera-Running **Bot use only** CI testing on Hera for this PR is in-progress and removed CI-Hera-Ready **CM use only** PR is ready for CI testing on Hera CI-Hera-Building **Bot use only** CI testing is cloning/building on Hera labels Apr 15, 2024
@emcbot
Copy link

emcbot commented Apr 15, 2024

Experiment C96_atmaerosnowDA failed on Hera with error logs: /scratch1/NCEPDEV/global/CI/2484/RUNTESTS/COMROOT/C96_atmaerosnowDA_96009402/logs/2021122018/gdasprepsnowobs.log

Follow link here to view the contents of the above file(s): (link)

@emcbot
Copy link

emcbot commented Apr 15, 2024

Experiment C96C48_hybatmDA failed on Hera with error logs:

/scratch1/NCEPDEV/global/CI/2484/RUNTESTS/COMROOT/C96_atmaerosnowDA_96009402/logs/2021122018/gdasprepsnowobs.log

Follow link here to view the contents of the above file(s): (link)

@emcbot emcbot added CI-Hera-Failed **Bot use only** CI testing on Hera for this PR has failed and removed CI-Hera-Running **Bot use only** CI testing on Hera for this PR is in-progress labels Apr 15, 2024
@emcbot
Copy link

emcbot commented Apr 15, 2024

CI FAILED Hera at 04 15 16:19:50
Built and ran in directory /scratch1/NCEPDEV/global/CI/2484

@aerorahul
Copy link
Contributor Author

aerorahul commented Apr 16, 2024

Detective @CoryMartin-NOAA traced the failure to:

str_date = re.search(r'\d{8}', self.filename).group()
        my_date = datetime.strptime(str_date, "%Y%m%d")

In the above code, a search is being performed to find 8 integers from self.filename.
self.filename in this instance is: /scratch1/NCEPDEV/stmp2/Terry.McGuinness/RUNDIRS/C96_atmaerosnowDA_96009402/gdassnowanl_18/IMSscf.20211220.C96_oro_data.nc
The first 8 integers in this filename are: 96009402. Incidentally, that is the 9600940 of the test commit. datetime is having a difficult time (pun intended) to convert 96009402 into a valid date. In the year 9600, there is no month 94 (at least on this planet).

I will merge develop and resubmit the test.

@aerorahul aerorahul removed the CI-Hera-Failed **Bot use only** CI testing on Hera for this PR has failed label Apr 16, 2024
@WalterKolczynski-NOAA
Copy link
Contributor

That explains it. Let me know if you need regex voodoo to find the right string.

@CoryMartin-NOAA
Copy link
Contributor

I've opened an issue. It's in a JCSDA repository so it may not be fixed immediately. In the meantime, we shall hope for alphanumeric hashes only!

@aerorahul
Copy link
Contributor Author

That explains it. Let me know if you need regex voodoo to find the right string.

@CoryMartin-NOAA has opened an issue in the JCSDA-internal/ioda-converters repo.
The new hash should not suffer from the same issue.

@CoryMartin-NOAA
Copy link
Contributor

Please also note though that GDASApp will not currently build due to the RZDM meltdown.

@WalterKolczynski-NOAA WalterKolczynski-NOAA added the CI-Hera-Ready **CM use only** PR is ready for CI testing on Hera label Apr 16, 2024
@emcbot emcbot added CI-Hera-Building **Bot use only** CI testing is cloning/building on Hera and removed CI-Hera-Ready **CM use only** PR is ready for CI testing on Hera labels Apr 16, 2024
@emcbot emcbot added CI-Hera-Failed **Bot use only** CI testing on Hera for this PR has failed and removed CI-Hera-Building **Bot use only** CI testing is cloning/building on Hera labels Apr 16, 2024
@emcbot
Copy link

emcbot commented Apr 16, 2024

CI FAILED Hera at 04 16 16:14:40
Built and ran in directory /scratch1/NCEPDEV/global/CI/2484

@WalterKolczynski-NOAA
Copy link
Contributor

WalterKolczynski-NOAA commented Apr 16, 2024

@CoryMartin-NOAA This revised regex should only get an eight-digit string if it is between two periods:

str_date = re.search(r'\.(\d{8})\.', self.filename).group(1)

Test:

>>> import re
>>> test_string="abc12345678_def.87654321.xyz"
>>> print( re.search(r'\.(\d{8})\.', test_string).group(1) )                                                                                             
87654321

@aerorahul aerorahul removed the CI-Hera-Failed **Bot use only** CI testing on Hera for this PR has failed label Apr 16, 2024
@WalterKolczynski-NOAA WalterKolczynski-NOAA added the CI-Wcoss2-Ready **CM use only** PR is ready for CI testing on WCOSS label Apr 17, 2024
@emcbot emcbot added CI-Wcoss2-Building **Bot use only** CI testing is cloning/building on WCOSS and removed CI-Wcoss2-Ready **CM use only** PR is ready for CI testing on WCOSS labels Apr 17, 2024
@emcbot
Copy link

emcbot commented Apr 17, 2024

CI Update on Wcoss2 at 04/17/24 01:18:15 AM
============================================
Cloning and Building global-workflow PR: 2484
with PID: 151480 on host: dlogin08

@emcbot emcbot added CI-Wcoss2-Running **Bot use only** CI testing on WCOSS for this PR is in-progress and removed CI-Wcoss2-Building **Bot use only** CI testing is cloning/building on WCOSS labels Apr 17, 2024
@emcbot
Copy link

emcbot commented Apr 17, 2024

Automated global-workflow Testing Results:

Machine: Wcoss2
Start: Wed Apr 17 01:22:48 UTC 2024 on dlogin08
---------------------------------------------------
Build: Completed at 04/17/24 01:34:02 AM
Case setup: Completed for experiment C48_ATM_00209d76
Case setup: Skipped for experiment C48mx500_3DVarAOWCDA_00209d76
Case setup: Skipped for experiment C48_S2SWA_gefs_00209d76
Case setup: Completed for experiment C48_S2SW_00209d76
Case setup: Completed for experiment C96_atm3DVar_00209d76
Case setup: Skipped for experiment C96_atmaerosnowDA_00209d76
Case setup: Completed for experiment C96C48_hybatmDA_00209d76
Case setup: Skipped for experiment C96C48_ufs_hybatmDA_00209d76

@emcbot
Copy link

emcbot commented Apr 17, 2024

Experiment C48_ATM_00209d76 SUCCESS on Wcoss2 at 04/17/24 07:12:09 AM

@emcbot
Copy link

emcbot commented Apr 17, 2024

Experiment C96_atm3DVar_00209d76 SUCCESS on Wcoss2 at 04/17/24 08:24:20 AM

@emcbot
Copy link

emcbot commented Apr 17, 2024

Experiment C96C48_hybatmDA_00209d76 SUCCESS on Wcoss2 at 04/17/24 08:24:27 AM

@emcbot
Copy link

emcbot commented Apr 17, 2024

Experiment C48_S2SW_00209d76 SUCCESS on Wcoss2 at 04/17/24 08:32:13 AM

@emcbot emcbot added CI-Wcoss2-Passed **Bot use only** CI testing on WCOSS for this PR has completed successfully and removed CI-Wcoss2-Running **Bot use only** CI testing on WCOSS for this PR is in-progress labels Apr 17, 2024
@emcbot
Copy link

emcbot commented Apr 17, 2024

All CI Test Cases Passed on Wcoss2:

Experiment C48_ATM_00209d76 *** SUCCESS *** at 04/17/24 07:12:09 AM
Experiment C96_atm3DVar_00209d76 *** SUCCESS *** at 04/17/24 08:24:20 AM
Experiment C96C48_hybatmDA_00209d76 *** SUCCESS *** at 04/17/24 08:24:27 AM
Experiment C48_S2SW_00209d76 *** SUCCESS *** at 04/17/24 08:32:13 AM

@jiandewang
Copy link
Contributor

@aerorahul my test run is successful on ocean post

@aerorahul aerorahul merged commit c679d94 into NOAA-EMC:develop Apr 17, 2024
4 checks passed
@aerorahul aerorahul deleted the feature/add_sh_tag branch April 17, 2024 16:06
danholdaway added a commit to danholdaway/global-workflow that referenced this pull request Apr 17, 2024
* upstream/develop:
  Add rocoto `sh` tag, script to check netcdf file and apply this to check ocean output (NOAA-EMC#2484)
  Revert file name changes in off-line post (NOAA-EMC#2499)
  Add mean/spread for atmos grib2 (NOAA-EMC#2482)
  Upadte and tested CI Bash for WCOSS2 (NOAA-EMC#2481)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-Wcoss2-Passed **Bot use only** CI testing on WCOSS for this PR has completed successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ocean/ice post failed occasionally
7 participants