Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
2980f48
Script to setup new r2d2 credentials
ftgoktas Jul 8, 2025
d502482
Create a new swell task to test new r2d2
ftgoktas Jul 8, 2025
29a42d8
Adapt get_observations to new R2D2
ftgoktas Jul 8, 2025
85d7124
Remove exit()
ftgoktas Jul 17, 2025
88fd221
Add r2d2 configs (#318)
ftgoktas Aug 4, 2025
da1c318
Update swell tasks to new R2D2 (#318)
ftgoktas Aug 4, 2025
56c1c47
Update r2d2 version of save obs diagnostics #318
ftgoktas Aug 27, 2025
0149e4a
Remove unused files #318
ftgoktas Aug 28, 2025
e83db93
Merge remote-tracking branch 'origin/develop' into feature/r2d2_v3
ftgoktas Aug 28, 2025
958ec06
Create r2d2 file register script #318
ftgoktas Aug 28, 2025
1240447
Add scripts for manual setup for R2D2 #318
ftgoktas Aug 28, 2025
7c0be9d
Clean up files (#318)
ftgoktas Aug 28, 2025
f8fc151
Clean up the files (#318)
ftgoktas Aug 29, 2025
a75bf9c
Update Python coding norms (#318)
ftgoktas Aug 29, 2025
c2b91d2
Fix pycode styles
ftgoktas Sep 2, 2025
f2c4d08
Remove redundant lines
ftgoktas Sep 12, 2025
6a614eb
Load R2D2 credentials under TaskBase (#318)
ftgoktas Sep 12, 2025
591f570
Load credentials under create R2D2 config (#318)
ftgoktas Sep 15, 2025
53ded1b
make R2D2 host/compiler detection support dynamic (#318)
ftgoktas Sep 16, 2025
44c7b17
Add docs for credential setup (#318)
ftgoktas Sep 16, 2025
d035da4
Update r2d2_config for cascade (#318)
ftgoktas Sep 18, 2025
bbb953d
Move credentials under create_task (#318)
ftgoktas Sep 24, 2025
fa927ae
Move scripts under utilities (#318)
ftgoktas Sep 25, 2025
98cf89d
Fix pylint errors
ftgoktas Sep 25, 2025
18d9e0d
Merge branch 'develop' of https://github.com/GEOS-ESM/swell into feat…
ftgoktas Oct 16, 2025
a1828f5
Merge branch 'feature/r2d2_v3' of https://github.com/GEOS-ESM/swell i…
ftgoktas Oct 16, 2025
eafae45
Fix AttributeError when fetching bias correction files (#318)
ftgoktas Oct 16, 2025
9384fc9
Fix bias correction arguments (#318)
ftgoktas Oct 16, 2025
d380589
Fix bias correction argument (#318)
ftgoktas Oct 16, 2025
0cf308c
Add file type argument (#318)
ftgoktas Oct 17, 2025
a76237c
Fix bias correction ingest
ftgoktas Oct 23, 2025
2e76dac
Improve file extension support
ftgoktas Oct 23, 2025
af53fb6
Add logging
ftgoktas Oct 23, 2025
0b77a04
Resolve merge conflict
ftgoktas Oct 23, 2025
1349f67
Fix bias coefficient ingestion
ftgoktas Oct 24, 2025
ef8483c
Go back to existing bias naming convention
ftgoktas Oct 24, 2025
e0a08f6
Use JCSDA enums for bias files
ftgoktas Oct 24, 2025
65867a0
Improve logging
ftgoktas Oct 24, 2025
3e8acba
Fix code style
ftgoktas Oct 25, 2025
a8e2111
extend exclude list to ignore venv and build directories
ftgoktas Oct 25, 2025
c57ee13
Change the script name register_files with ingest_files
ftgoktas Oct 27, 2025
7d441c2
Fix logger
ftgoktas Oct 27, 2025
3cfd995
Fix string literal
ftgoktas Oct 27, 2025
2271658
Merge remote-tracking branch 'origin/feature/r2d2_v3' into feature/r2…
ftgoktas Oct 27, 2025
2448d38
Moved readme to docs
ftgoktas Oct 27, 2025
0a28441
Fix pycode style
ftgoktas Oct 27, 2025
c28ebb5
Remove redundant lines
ftgoktas Oct 28, 2025
63b5e6a
Make the comment more generic
ftgoktas Oct 28, 2025
a641b9b
Merge branch 'develop' into feature/r2d2_v3
ftgoktas Oct 28, 2025
a90d3c2
Add readme for ingest_files.py (#318)
ftgoktas Oct 28, 2025
b869cfc
Merge remote-tracking branch 'origin' into feature/r2d2_v3
ftgoktas Oct 28, 2025
b971636
Merge remote-tracking branch 'origin/feature/r2d2_v3' into feature/r2…
ftgoktas Oct 28, 2025
29213af
Update src/swell/deployment/platforms/nccs_discover_sles15/r2d2_confi…
ftgoktas Oct 28, 2025
987efb6
Remove redundant loging
ftgoktas Oct 28, 2025
b4ab97f
Remove redundant logging
ftgoktas Oct 28, 2025
3918843
Remove unnecessary statements
ftgoktas Oct 28, 2025
9e8b9da
Bump version to 1.11.0
ftgoktas Oct 29, 2025
a49f1f6
Bump version to 1.20.0
ftgoktas Oct 29, 2025
dfc250f
Add how to register experiments to readme
ftgoktas Oct 30, 2025
a5d836b
Upgrade r2d2-client (#618)
ftgoktas Nov 6, 2025
dc2e9da
Add register experiment to readme
ftgoktas Nov 7, 2025
de0461d
r2d2 v3 turnoffrestart (#653)
Dooruk Nov 7, 2025
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: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,8 @@ dmypy.json
# Pyre type checker
.pyre/
*.egg-info

# R2D2 credentials
r2d2_credentials.yaml
**/r2d2_credentials.yaml
.swell/r2d2_credentials.yaml
100 changes: 100 additions & 0 deletions docs/configs/r2d2_v3_credentials.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# R2D2 v3 Credentials Configuration

This document explains how to configure R2D2 v3 credentials for SWELL workflows.

## Overview

SWELL now uses R2D2 v3 for metadata-driven data storage and retrieval. R2D2 v3 requires authentication credentials to access the centralized API. SWELL automatically loads these credentials from a YAML configuration file.

## Quick Setup

1. **Create the credentials directory:**
```bash
mkdir -p ~/.swell
```

2. **Create the credentials file:**
```bash
cp /path/to/swell/r2d2_credentials.yaml ~/.swell/r2d2_credentials.yaml
```

3. **Edit with your credentials:**
```bash
vim ~/.swell/r2d2_credentials.yaml
```

4. **Set secure permissions:**
```bash
chmod 600 ~/.swell/r2d2_credentials.yaml
```

## Credentials File Format

Create `~/.swell/r2d2_credentials.yaml` with the following structure:

```yaml
# R2D2 v3 credentials file
# Save this as ~/.swell/r2d2_credentials.yaml
# Set permissions: chmod 600 ~/.swell/r2d2_credentials.yaml

# Required credentials
user: your_username # Your R2D2 username
api_key: your_api_key # Your R2D2 API key

# Platform-specific values (automatically determined by SWELL with an option to use YAML-first)
# host: discover-gmao # Automatically set based on platform
# compiler: intel # Automatically set based on platform

```

## Required Fields

| Field | Description | Example |
|-------|-------------|---------|
| `user` | Your R2D2 username | `jdoe` |
| `api_key` | Your R2D2 API authentication key | `abcd1234-ef56-7890-abcd-1234567890ab` |

## Platform-Specific Fields (Automatically Set)

| Field | Description | NCCS Discover Value |
|-------|-------------|---------------------|
| `host` | Compute host identifier | `discover-gmao` |
| `compiler` | Compiler type used | `intel` |

**Important**: `host` and `compiler` are automatically determined by SWELL based on your platform configuration. You can also set these manually in your credentials file.

### Loading Precedence

The credential loading follows this priority order:

1. **Environment Variables** (highest priority)
2. **YAML Configuration File**
3. **Platform Detection** (for host/compiler only)

**For host and compiler specifically:**
- YAML `host`/`compiler` values override platform detection
- Platform detection is used as fallback when not specified in YAML

### Platform-Specific Configuration

SWELL automatically determines `host` and `compiler` based on your platform:

| Platform | R2D2 Host | R2D2 Compiler | Notes |
|----------|-----------|---------------|-------|
| `nccs_discover_sles15` | `discover-gmao` | `intel` | NCCS Discover SLES15 |
| `nccs_discover_cascade` | `discover-gmao` | `intel` | NCCS Discover Cascade |
<!-- | `aws` | `aws-gmao` | `intel` | AWS cloud platform |
| `generic` | `None` | `None` | Fallback to YAML/env vars | -->


## Environment Variables Set

When loaded, the following environment variables are set:

- `R2D2_USER`: Your R2D2 username
- `R2D2_API_KEY`: Your R2D2 API key
- `R2D2_HOST`: Compute host name
- `R2D2_COMPILER`: Compiler type
<!-- - `R2D2_SERVER_HOST`: (Optional) API server override
- `R2D2_SERVER_PORT`: (Optional) API server port override -->

3 changes: 2 additions & 1 deletion pycodestyle.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
max-line-length = 100
indent-size = 4
statistics = True
exclude = ._*, build, .venv
exclude = ._*, build, .venv, venv, .git, __pycache__, .tox, .eggs, *.egg-info, dist

13 changes: 13 additions & 0 deletions r2d2_credentials.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# R2D2 v3 credentials file
# Save this as ~/.swell/r2d2_credentials.yaml
# Set permissions: chmod 600 ~/.swell/r2d2_credentials.yaml

# R2D2 v3 API credentials
user: your_username
api_key: your_api_key_here

# Platform configuration
host: discover-gmao
compiler: intel


2 changes: 1 addition & 1 deletion src/swell/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
repo_directory = os.path.dirname(__file__)

# Set the version for swell
__version__ = '1.10.0'
__version__ = '1.20.0'
4 changes: 1 addition & 3 deletions src/swell/deployment/platforms/nccs_discover_cascade/modules
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ module load other/mepo
# Load r2d2 modules
# -----------------
module use -a /discover/nobackup/projects/gmao/advda/JediOpt/modulefiles/core
module load solo/sles15_skylab9
module load py-boto3
module load r2d2/sles15_spack19
module load r2d2-client/112025

# Load eva and jedi_bundle
# ------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
databases:

${USER}:
class: LocalDB
root: {{r2d2_local_path}}
cache_fetch: false

gmao-shared:
class: LocalDB
root: /discover/nobackup/projects/gmao/advda/R2D2DataStore/Shared
cache_fetch: false
# v3 API configuration (for centralized nccs-gmao data)
data_hub: nccs-gmao
data_store: r2d2-experiments-nccs-gmao
compute_host: discover-gmao-intel

# when fetching data, in which order should the databases accessed?
# Fetch order: try local first, then API
fetch_order:
- ${USER}
- gmao-shared

# when storing data, in which order should the databases accessed?
store_order:
- ${USER}
# Optional: credentials file for v3 API authentication
# credentials_file: ~/.swell/swell-r2d2-credentials.yaml

# Cache settings
cache_name: ${USER}
cache_fetch: false
8 changes: 5 additions & 3 deletions src/swell/deployment/platforms/nccs_discover_sles15/modules
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ module load other/mepo
# Load r2d2 modules
# -----------------
module use -a /discover/nobackup/projects/gmao/advda/JediOpt/modulefiles/core
module load solo/sles15_skylab9
module load py-boto3
module load r2d2/sles15_spack19
module load r2d2-client/112025

# Load eva and jedi_bundle
# ------------------------
module load eva/sles15_milan_1.6.5
module load jedi_bundle/sles15_skylab9

# Remove any r2d2 v2 paths from PYTHONPATH to prevent conflicts
export PYTHONPATH=$(echo $PYTHONPATH | tr ':' '\n' | grep -v "/r2d2/sles15_spack19/" | tr '\n' ':' | sed 's/:$//')

# Set the swell paths
# -------------------
PATH={{swell_bin_path}}:$PATH
Expand All @@ -57,3 +58,4 @@ ulimit -S -s unlimited
ulimit -S -v unlimited
umask 022


Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
databases:

${USER}:
class: LocalDB
root: {{r2d2_local_path}}
cache_fetch: false

gmao-shared:
class: LocalDB
root: /discover/nobackup/projects/gmao/advda/R2D2DataStore/Shared
cache_fetch: false
# v3 API configuration (for centralized nccs-gmao data)
data_hub: nccs-gmao
data_store: r2d2-experiments-nccs-gmao
compute_host: discover-gmao-intel

# when fetching data, in which order should the databases accessed?
# Fetch order: try local first, then API
fetch_order:
- ${USER}
- gmao-shared

# when storing data, in which order should the databases accessed?
store_order:
- ${USER}
# Optional: credentials file for v3 API authentication
# credentials_file: ~/.swell/swell-r2d2-credentials.yaml

# Cache settings
cache_name: ${USER}
cache_fetch: false
25 changes: 9 additions & 16 deletions src/swell/suites/3dfgat_cycle/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,8 @@
LinkGeosOutput-{{model_component}} => GenerateBClimatology-{{model_component}}

# Data assimilation preperation
GetObservations-{{model_component}}
GenerateBClimatologyByLinking-{{model_component}} :fail? => GenerateBClimatology-{{model_component}}

LinkGeosOutput-{{model_component}} => RunJediFgatExecutable-{{model_component}}
StageJediCycle-{{model_component}} => RunJediFgatExecutable-{{model_component}}
GenerateBClimatologyByLinking-{{model_component}}? | GenerateBClimatology-{{model_component}} => RunJediFgatExecutable-{{model_component}}
GenerateBClimatology-{{model_component}} => RunJediFgatExecutable-{{model_component}}
GetObservations-{{model_component}} => RunJediFgatExecutable-{{model_component}}

# Run analysis diagnostics
Expand All @@ -94,14 +90,17 @@
RunJediFgatExecutable-{{model_component}} => EvaIncrement-{{model_component}}
{% if 'cice6' in models[model_component]["marine_models"] %}
PrepareAnalysis-{{model_component}} => RunJediConvertStateSoca2ciceExecutable-{{model_component}}
RunJediConvertStateSoca2ciceExecutable-{{model_component}} => SaveRestart-{{model_component}}
# RunJediConvertStateSoca2ciceExecutable-{{model_component}} => SaveRestart-{{model_component}}
RunJediConvertStateSoca2ciceExecutable-{{model_component}} => MoveDaRestart-{{model_component}}
RunJediConvertStateSoca2ciceExecutable-{{model_component}} => CleanCycle-{{model_component}}
{% else %}
PrepareAnalysis-{{model_component}} => SaveRestart-{{model_component}}
# PrepareAnalysis-{{model_component}} => SaveRestart-{{model_component}}
PrepareAnalysis-{{model_component}} => MoveDaRestart-{{model_component}}
{% endif %}

# Temporarily disable saving restarts
# Move restart to next cycle
SaveRestart-{{model_component}} => MoveDaRestart-{{model_component}}
# SaveRestart-{{model_component}} => MoveDaRestart-{{model_component}}

# Save analysis output
# RunJediFgatExecutable-{{model_component}} => SaveAnalysis-{{model_component}}
Expand Down Expand Up @@ -192,9 +191,6 @@
[[MoveDaRestart-{{model_component}}]]
script = "swell task MoveDaRestart $config -d $datetime -m {{model_component}}"

[[SaveRestart-{{model_component}}]]
script = "swell task SaveRestart $config -d $datetime -m {{model_component}}"

[[StageJedi-{{model_component}}]]
script = "swell task StageJedi $config -m {{model_component}}"

Expand All @@ -213,9 +209,6 @@
--{{key}} = {{value}}
{%- endfor %}

[[GenerateBClimatologyByLinking-{{model_component}}]]
script = "swell task GenerateBClimatologyByLinking $config -d $datetime -m {{model_component}}"

{% if 'cice6' in models["geos_marine"]["marine_models"] %}

[[RunJediConvertStateSoca2ciceExecutable-{{model_component}}]]
Expand Down Expand Up @@ -253,8 +246,8 @@
--{{key}} = {{value}}
{%- endfor %}

[[SaveRestart-{{model_component}}]]
script = "swell task SaveRestart $config -d $datetime -m {{model_component}}"
# [[SaveRestart-{{model_component}}]]
# script = "swell task SaveRestart $config -d $datetime -m {{model_component}}"

[[SaveObsDiags-{{model_component}}]]
script = "swell task SaveObsDiags $config -d $datetime -m {{model_component}}"
Expand Down
12 changes: 1 addition & 11 deletions src/swell/suites/3dvar/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,7 @@
{% if cycle_time[model_component] %}
# Task triggers for: {{model_component}}
# ------------------
# Get background
GetBackground-{{model_component}}

# Get observations
GetObservations-{{model_component}}

# GenerateBClimatology, for ocean it is cycle dependent
GenerateBClimatologyByLinking-{{model_component}} :fail? => GenerateBClimatology-{{model_component}}
GetBackground-{{model_component}} => GenerateBClimatology-{{model_component}}

# Perform staging that is cycle dependent
Expand All @@ -65,7 +58,7 @@
StageJedi-{{model_component}}[^] => RunJediVariationalExecutable-{{model_component}}
StageJediCycle-{{model_component}} => RunJediVariationalExecutable-{{model_component}}
GetBackground-{{model_component}} => RunJediVariationalExecutable-{{model_component}}
GenerateBClimatologyByLinking-{{model_component}}? | GenerateBClimatology-{{model_component}} => RunJediVariationalExecutable-{{model_component}}
GenerateBClimatology-{{model_component}} => RunJediVariationalExecutable-{{model_component}}
GetObservations-{{model_component}} => RunJediVariationalExecutable-{{model_component}}

# EvaObservations
Expand Down Expand Up @@ -132,9 +125,6 @@
[[GetObservations-{{model_component}}]]
script = "swell task GetObservations $config -d $datetime -m {{model_component}}"

[[GenerateBClimatologyByLinking-{{model_component}}]]
script = "swell task GenerateBClimatologyByLinking $config -d $datetime -m {{model_component}}"

[[GenerateBClimatology-{{model_component}}]]
script = "swell task GenerateBClimatology $config -d $datetime -m {{model_component}}"
platform = {{platform}}
Expand Down
21 changes: 8 additions & 13 deletions src/swell/suites/3dvar_cycle/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,8 @@
LinkGeosOutput-{{model_component}} => GenerateBClimatology-{{model_component}}

# Data assimilation things
GetObservations-{{model_component}}
GenerateBClimatologyByLinking-{{model_component}} :fail? => GenerateBClimatology-{{model_component}}

LinkGeosOutput-{{model_component}} => RunJediVariationalExecutable-{{model_component}}
StageJediCycle-{{model_component}} => RunJediVariationalExecutable-{{model_component}}
GenerateBClimatologyByLinking-{{model_component}}? | GenerateBClimatology-{{model_component}} => RunJediVariationalExecutable-{{model_component}}
GenerateBClimatology-{{model_component}} => RunJediVariationalExecutable-{{model_component}}
GetObservations-{{model_component}} => RunJediVariationalExecutable-{{model_component}}

# Run analysis diagnostics
Expand All @@ -93,14 +89,16 @@
EvaIncrement-{{model_component}} => PrepareAnalysis-{{model_component}}
{% if 'cice6' in models[model_component]["marine_models"] %}
PrepareAnalysis-{{model_component}} => RunJediConvertStateSoca2ciceExecutable-{{model_component}}
RunJediConvertStateSoca2ciceExecutable-{{model_component}} => SaveRestart-{{model_component}}
# RunJediConvertStateSoca2ciceExecutable-{{model_component}} => SaveRestart-{{model_component}}
RunJediConvertStateSoca2ciceExecutable-{{model_component}} => MoveDaRestart-{{model_component}}
RunJediConvertStateSoca2ciceExecutable-{{model_component}} => CleanCycle-{{model_component}}
{% else %}
PrepareAnalysis-{{model_component}} => SaveRestart-{{model_component}}
# PrepareAnalysis-{{model_component}} => SaveRestart-{{model_component}}
PrepareAnalysis-{{model_component}} => MoveDaRestart-{{model_component}}
{% endif %}

# Move restart to next cycle
SaveRestart-{{model_component}} => MoveDaRestart-{{model_component}}
# SaveRestart-{{model_component}} => MoveDaRestart-{{model_component}}

# Save analysis output
# RunJediVariationalExecutable-{{model_component}} => SaveAnalysis-{{model_component}}
Expand Down Expand Up @@ -192,9 +190,6 @@
[[MoveDaRestart-{{model_component}}]]
script = "swell task MoveDaRestart $config -d $datetime -m {{model_component}}"

[[SaveRestart-{{model_component}}]]
script = "swell task SaveRestart $config -d $datetime -m {{model_component}}"

[[StageJedi-{{model_component}}]]
script = "swell task StageJedi $config -m {{model_component}}"

Expand Down Expand Up @@ -253,8 +248,8 @@
--{{key}} = {{value}}
{%- endfor %}

[[SaveRestart-{{model_component}}]]
script = "swell task SaveRestart $config -d $datetime -m {{model_component}}"
# [[SaveRestart-{{model_component}}]]
# script = "swell task SaveRestart $config -d $datetime -m {{model_component}}"

[[SaveObsDiags-{{model_component}}]]
script = "swell task SaveObsDiags $config -d $datetime -m {{model_component}}"
Expand Down
Loading