-
Notifications
You must be signed in to change notification settings - Fork 7
R2D2 v3 Adaptation #618
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
R2D2 v3 Adaptation #618
Conversation
mranst
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work- It seems like r2d2 v3 requires a lot of environment variables to be set in order to run. @ashiklom or @Dooruk may have a better idea, but maybe a way to handle this would be to have a config file called ~/.swell/r2d2_credentials.yaml where the user could store this information. There could then be a function within TaskBase that parses and sets these variables using os.environ (you can see a somewhat similar example to this in slurm.py, where we set slurm defaults in ~/.swell/swell-slurm.yaml). We're also going to need some documentation explaining this, I'm having trouble getting it running with all the necessary environment additions
Dooruk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ftgoktas great job! finally v3 is becoming a reality.
There are Swell specific peculiarities, @mranst pointed out most of them. Also there are built-in functions like logger so you could use them. We should store R2D2 related config and environment variables inside a file like ~/.swell/r2d2-config.yaml.
A few additional notes and Q.s:
-
There is a little bit of separation happening here with the atmosphere side accessing obs file outside of R2D2 context, which is fine during the development.
-
Once we have something like
~/.swell/r2d2-config.yamlwe need to have a dedicated section in the documentation, maybe pointing at JCSDA-internal/R2D2 documentation and with useful commands. -
Is it possible to request API keys for @mranst and @ashiklom? Or is it possible to request a generic "gmao-user" API key and have special ones for sudo type users? That way we can create a generic
~/.swell/r2d2-config.yamlif none exists, otherwise I imagine %98 users will be flabbergasted and message one of us without looking at the documentation. -
I probably asked this before but Is linking rather than copying an option with
fetch? -
(Long term) Let's keep in mind we would like to use R2D2 on AWS or NAS and able to access cloud dataset (e.g., NNJA) with it.
Dooruk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to run three suites successfully!
Most of my comments are taking out redundant logger outputs as r2d2 already puts out that information. For me this is really close, with three things holding this back for me, other than ingesting more obs. ofcourse:
- There is an addition to the taskBase for r2d2 but could that be put in
utiltiies/r2d2.pyand only employed during R2D2 relevant tasks? - Model types should support more for marine (I briefly explained this in my comment)
- In terms of storage, what "lifetime" are we choosing? Are people storing their experiments temporarily? Is everyone storing their experiments in the general gmao database?
Also, can you bump up the SWELL version? I would like to make a release before we merge this.
I also noticed a slight increase in the time it takes to complete getObservations. Not a huge deal as we can trigger this task at a cycle before any other dependencies but just got me thinking.
src/swell/deployment/platforms/nccs_discover_sles15/r2d2_config.yaml
Outdated
Show resolved
Hide resolved
|
I probably forgot to mention this one but in cycling tasks, there is a need to save backgrounds and/or restarts. I am not super clear on where we will end up in terms of @mer-a-o do you store all hourly model state files for the backgrounds? Also do you store ensemble files? (you being in Skylab) |
…g.yaml Co-authored-by: Doruk Ardağ <38666458+Dooruk@users.noreply.github.com>
Co-authored-by: Doruk Ardağ <38666458+Dooruk@users.noreply.github.com>
|
So this fails the https://github.com/JCSDA-internal/r2d2/issues/839 For now I can deactivate the @mranst would you mind testing this on |
https://github.com/GEOS-ESM/swell/actions/runs/19082156562 I added the
|
|
The issue was caused by a bug in the r2d2 codebase, the r2d2-client module on Discover has been updated with the fix, and tasks should now run without errors. @mranst could you please pull the latest changes and re-run the tests? |
https://github.com/GEOS-ESM/swell/actions/runs/19150912180/job/54740655821
|
|
This will be addressed in #652 |
|
Working towards merging this, some final things:
Q.s:
|
Yes, feedback is for IODA observation diagnostic files produced by DA systems, contains original observations plus analysis results. I had confirmed with the R2D2 team that JEDI 3dvar output files (observations + analysis feedback) should use item='feedback', which applies to SaveObsDiags since that task stores those files.
The ingest script doesn't enforce permissions; it relies on the R2D2 v3 API server to enforce authentication/authorization, so unauthorized users will get permission errors from the API if they don't have the API key set up in their environment. |
|
Ok, this is ready to go in after #653 merges. There are still things to be addressed but no need to hold this one back. I made a release right before this so we should be good. |
Dooruk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent job! Long time coming.

This PR migrates SWELL from r2d2 v1 to r2d2 v3 API for centralized metadata management.
Updates GetObservations, GetBackground, and SaveObsDiags tasks to use new API syntax.
Adresses #318
Key Changes:
r2d2-client/sles15_0604instead ofr2d2/sles15_spack19data_hub,data_store,compute_host)GetObservations: Updated fetch parameters (item='observation',window_start, etc.)GetBackground: Updated for forecast item fetchingSaveObsDiags: Updated to store asitem='feedback'with proper parametersR2D2_USER,R2D2_API_KEY)Tested with 3dvar and 3dvar_atmos suites - successfully fetches observations/backgrounds and stores feedback files.
Dependencies