|
| 1 | +# R2D2 v3 Credentials Configuration |
| 2 | + |
| 3 | +This document explains how to configure R2D2 v3 credentials for SWELL workflows. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +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. |
| 8 | + |
| 9 | +## Quick Setup |
| 10 | + |
| 11 | +1. **Create the credentials directory:** |
| 12 | + ```bash |
| 13 | + mkdir -p ~/.swell |
| 14 | + ``` |
| 15 | + |
| 16 | +2. **Create the credentials file:** |
| 17 | + ```bash |
| 18 | + cp /path/to/swell/r2d2_credentials.yaml ~/.swell/r2d2_credentials.yaml |
| 19 | + ``` |
| 20 | + |
| 21 | +3. **Edit with your credentials:** |
| 22 | + ```bash |
| 23 | + vim ~/.swell/r2d2_credentials.yaml |
| 24 | + ``` |
| 25 | + |
| 26 | +4. **Set secure permissions:** |
| 27 | + ```bash |
| 28 | + chmod 600 ~/.swell/r2d2_credentials.yaml |
| 29 | + ``` |
| 30 | + |
| 31 | +## Credentials File Format |
| 32 | + |
| 33 | +Create `~/.swell/r2d2_credentials.yaml` with the following structure: |
| 34 | + |
| 35 | +```yaml |
| 36 | +# R2D2 v3 credentials file |
| 37 | +# Save this as ~/.swell/r2d2_credentials.yaml |
| 38 | +# Set permissions: chmod 600 ~/.swell/r2d2_credentials.yaml |
| 39 | + |
| 40 | +# Required credentials |
| 41 | +user: your_username # Your R2D2 username |
| 42 | +api_key: your_api_key # Your R2D2 API key |
| 43 | + |
| 44 | +# Platform-specific values (automatically determined by SWELL with an option to use YAML-first) |
| 45 | +# host: discover-gmao # Automatically set based on platform |
| 46 | +# compiler: intel # Automatically set based on platform |
| 47 | + |
| 48 | +``` |
| 49 | + |
| 50 | +## Required Fields |
| 51 | + |
| 52 | +| Field | Description | Example | |
| 53 | +|-------|-------------|---------| |
| 54 | +| `user` | Your R2D2 username | `jdoe` | |
| 55 | +| `api_key` | Your R2D2 API authentication key | `abcd1234-ef56-7890-abcd-1234567890ab` | |
| 56 | + |
| 57 | +## Platform-Specific Fields (Automatically Set) |
| 58 | + |
| 59 | +| Field | Description | NCCS Discover Value | |
| 60 | +|-------|-------------|---------------------| |
| 61 | +| `host` | Compute host identifier | `discover-gmao` | |
| 62 | +| `compiler` | Compiler type used | `intel` | |
| 63 | + |
| 64 | +**Important**: `host` and `compiler` are automatically determined by SWELL based on your platform configuration. You can also set these manually in your credentials file. |
| 65 | + |
| 66 | +### Loading Precedence |
| 67 | + |
| 68 | +The credential loading follows this priority order: |
| 69 | + |
| 70 | +1. **Environment Variables** (highest priority) |
| 71 | +2. **YAML Configuration File** |
| 72 | +3. **Platform Detection** (for host/compiler only) |
| 73 | + |
| 74 | +**For host and compiler specifically:** |
| 75 | +- YAML `host`/`compiler` values override platform detection |
| 76 | +- Platform detection is used as fallback when not specified in YAML |
| 77 | + |
| 78 | +### Platform-Specific Configuration |
| 79 | + |
| 80 | +SWELL automatically determines `host` and `compiler` based on your platform: |
| 81 | + |
| 82 | +| Platform | R2D2 Host | R2D2 Compiler | Notes | |
| 83 | +|----------|-----------|---------------|-------| |
| 84 | +| `nccs_discover_sles15` | `discover-gmao` | `intel` | NCCS Discover SLES15 | |
| 85 | +| `nccs_discover_cascade` | `discover-gmao` | `intel` | NCCS Discover Cascade | |
| 86 | +<!-- | `aws` | `aws-gmao` | `intel` | AWS cloud platform | |
| 87 | +| `generic` | `None` | `None` | Fallback to YAML/env vars | --> |
| 88 | + |
| 89 | + |
| 90 | +## Environment Variables Set |
| 91 | + |
| 92 | +When loaded, the following environment variables are set: |
| 93 | + |
| 94 | +- `R2D2_USER`: Your R2D2 username |
| 95 | +- `R2D2_API_KEY`: Your R2D2 API key |
| 96 | +- `R2D2_HOST`: Compute host name |
| 97 | +- `R2D2_COMPILER`: Compiler type |
| 98 | +<!-- - `R2D2_SERVER_HOST`: (Optional) API server override |
| 99 | +- `R2D2_SERVER_PORT`: (Optional) API server port override --> |
| 100 | + |
0 commit comments