Skip to content

Configuration

Default Platform Cache Directory

On the DIVA platform, the download directory is already configured by default:

/workspace/.cache/gathering/

All downloaded observation files, satellite granules, ground-based profiles, and auxiliary assets (such as the AERONET station database) are automatically cached and indexed in /workspace/.cache/gathering/. Users do not need to configure download paths manually.

If needed for custom local development outside the platform, the root directory can optionally be overridden via the GATHERER_FOLDER environment variable (which defaults to /workspace on the DIVA platform, or ~/.cache/gathering/ in standard local environments).

Download Directory Structure

Each source organizes files in a consistent hierarchy under the cache directory:

Ground-Based Sources

/workspace/.cache/gathering/
├── aeronet/
│   └── <station>/
│       └── <product>_<start>_<end>.csv
├── actris_ares/
│   └── <station>/
│       └── <data_type>/
│           └── <filename>.nc
├── actris_cloudnet/
│   └── <station>/
│       └── <product>/
│           └── <date>_<site>_<product>.nc
└── pandonia/
    └── <station>/
        └── <instrument_id>/
            └── <product>_<date>.txt

Satellite Sources

/workspace/.cache/gathering/
├── cdse/
│   └── <instrument>/
│       └── <product_type>/
│           └── <YYYY>/<MM>/<DD>/
├── eumdac/
│   └── <instrument>/
│       └── <YYYY>/<MM>/<DD>/
├── earthcare/
│   └── <collection>/
│       └── <product_type>/
│           └── <YYYY>/<MM>/<DD>/
├── pace/
│   └── <instrument>/
│       └── <product_type>/
│           └── <YYYY>/<MM>/<DD>/
├── modis/
│   └── <satellite>/
│       └── <product_type>/
│           └── <YYYY>/<MM>/<DD>/
└── AHI/
    └── <NC|CLP>/
        └── <YYYY>/<MM>/<DD>/

Environment Variables

The following environment variables are recognized:

Variable Description Default
GATHERER_FOLDER Root workspace directory (optional override) /workspace (DIVA) / ~ (local)
GATHERING_CREDENTIALS_FILE Custom path to credentials.yaml ~/.config/gathering/credentials.yaml
CDSE_USERNAME Copernicus Data Space username —
CDSE_PASSWORD Copernicus Data Space password —
EUMETSAT_CONSUMER_KEY EUMETSAT API consumer key —
EUMETSAT_CONSUMER_SECRET EUMETSAT API consumer secret —
EARTHCARE_USERNAME EarthCARE / MAAP username —
EARTHCARE_PASSWORD EarthCARE / MAAP password —
EARTHCARE_MAAP_TOKEN EarthCARE MAAP bearer token (optional) —
PANDONIA_API_KEY Pandonia Global Network API key —
EARTHDATA_USERNAME NASA Earthdata Login username —
EARTHDATA_PASSWORD NASA Earthdata Login password —
AHI_USERNAME JAXA P-Tree FTP username —
AHI_PASSWORD JAXA P-Tree FTP password —

Credential Pools

Credential pools allow one service to use several complete credential identities. A pool is a non-empty JSON array; each object is one indivisible identity. The resolver validates every object before selecting one uniformly when the gatherer or task is created. It does not select fields independently, rotate credentials per request, or fail over automatically.

Canonical Pool Shape

Use the canonical service name and the complete field set for one supported contract:

Service Required record shape
eumdac consumer_key + consumer_secret
cdse access_token or username + password
earthcare maap_token or username + password
cmr (shared by MODIS and PACE) token, bearer_token, or username + password
pandonia api_key
ahi username + password

Example for one service (use placeholders only; never commit real values):

[
  {"consumer_key": "<key-a>", "consumer_secret": "<secret-a>"},
  {"consumer_key": "<key-b>", "consumer_secret": "<secret-b>"}
]

For a service-specific environment variable, set the JSON array directly:

export GATHERING_CREDENTIAL_POOL_EUMDAC='[{"consumer_key":"<key>","consumer_secret":"<secret>"}]'

The corresponding mounted-file convention is GATHERING_CREDENTIAL_POOL_EUMDAC_FILE=/run/secrets/eumdac-pool.json. The generic GATHERING_CREDENTIAL_POOL_FILE is also supported. For local stored configuration, use a top-level pools mapping in credentials.yaml:

pools:
  eumdac:
    - consumer_key: <key>
      consumer_secret: <secret>
  cmr:
    - token: <token>

Precedence, Fallback, and Rollback

Credential resolution follows this order:

  1. Complete explicit credentials.
  2. A configured credential pool from the environment, mounted file, or stored pools mapping.
  3. The existing single-credential environment, .env, or stored configuration lookup.

Incomplete explicit credentials fail rather than falling through. A configured empty, malformed, or partially invalid pool also fails fast; remove or correct the pool instead of expecting legacy credentials to be used. Removing the pool injection is the rollback path: after the workload is restarted or recreated, the existing single-credential lookup remains available. Revert the pool configuration and code change together if the resolver itself must be rolled back.

Deployment Owner Instructions

In production, inject each pool through the active WorkflowTemplate pod contract. Valid mechanisms are:

  • env[].valueFrom.secretKeyRef for a service-specific pool variable;
  • envFrom referencing the Secret; or
  • a mounted Secret volume, with the matching *_FILE variable pointing to the mounted JSON file.

The Secret value must contain the complete pool records. Do not put credential values in task YAML, workflow parameters, logs, or annotations. In particular, kubectl.kubernetes.io/last-applied-configuration is not an injection mechanism; only the active pod template is used at runtime.

Before enabling production pools, run one canary with a non-production Secret and verify task startup and redacted logs. The current argo-workflow/gathering-downloader template (execute-gathering) has no active env, envFrom, or Secret volume injection; it exposes only the last-applied annotation, so a deployment owner must add an active injection before relying on credential pools.

.env File Support

You can store environment variables in a .env file that is automatically loaded:

# Generate a template .env file with all variables
gathering auth env

The .env file is searched in this order:

  1. /workspace/.env (on DIVA platform)
  2. Current working directory .env
  3. $GATHERER_FOLDER/.env (if set)

You can generate it automatically using gathering auth env or copy the built-in template using gathering examples copy credentials.env.example .env:

# Copernicus Data Space Ecosystem (CDSE)
CDSE_USERNAME=your_email@domain.com
CDSE_PASSWORD=your_cdse_password

# EUMETSAT Data Access Client (EUMDAC)
EUMETSAT_CONSUMER_KEY=your_eumetsat_consumer_key
EUMETSAT_CONSUMER_SECRET=your_eumetsat_consumer_secret

# ESA EarthCARE (MAAP STAC / OADS)
EARTHCARE_USERNAME=your_earthcare_username
EARTHCARE_PASSWORD=your_earthcare_password
EARTHCARE_MAAP_TOKEN=your_optional_maap_token

# Pandonia Global Network (PGN)
PANDONIA_API_KEY=your_pandonia_api_key

# Himawari-8/9 AHI via JAXA P-Tree FTP
AHI_USERNAME=your_ptree_user
AHI_PASSWORD=your_ptree_password

# NASA Earthdata Login
EARTHDATA_USERNAME=your_earthdata_username
EARTHDATA_PASSWORD=your_earthdata_password

Cache Behavior

By default, files already present in the cache are skipped. You can override this:

task = Task.aeronet(
    station="Granada",
    product="AOD15",
    start_date="2023-07-01",
    end_date="2023-07-05",
    overwrite_cache=True,  # Force re-download
)
- source: aeronet
  site: Granada
  start_date: "2023-07-01"
  end_date: "2023-07-05"
  product: AOD15
  overwrite_cache: true
gathering aeronet \
  --station Granada \
  --product AOD15 \
  --start_date 2023-07-01 \
  --end_date 2023-07-05 \
  --overwrite_cache