Skip to content

canvod-airflow

canvod-airflow turns canvodpy's task functions into Airflow DAGs. One daily DAG per site runs the site's processing, and one backfill DAG covers a date range. Every task calls canvodpy.workflows.tasks, so no pipeline logic lives here.

When you need it

You need it when a site's processing runs on a schedule you don't want to start by hand, or when you want to reprocess a date range you already ran. You don't need it when you run canvodpy run yourself, or when you process one batch once.

Install

uv add canvod-airflow

This also installs apache-airflow>=3.3.2, the first release without known vulnerabilities; an installed Airflow older than that is upgraded. Airflow runs on POSIX systems (Linux, macOS); on Windows, run it in WSL2 (Airflow's prerequisites).

A minimal example

Point a dags_folder at a shim module that imports both DAG modules, so Airflow's DagBag finds them. Airflow's pre-filter scans the folder for DAG files. Give the shim a name that holds the keywords, for example canvod_dags.py:

# <dags_folder>/canvod_dags.py
from canvod.airflow.daily_processing import *  # noqa: F403  (Airflow DAG scan)
from canvod.airflow.backfill import *  # noqa: F403

Importing the module builds the DAGs. For each site in canvodpy's settings file, the package builds a daily DAG named canvod_{site}:

t_validate_dirs → t_wait_for_data → (t_wait_for_sp3) → t_process_day → t_validate_ingest → t_calculate_vod

t_validate_dirs checks the receiver directories. t_wait_for_data and t_wait_for_sp3 are sensors: they wait until the files of the receiver and the satellite products are there, holding up to 21 days. t_process_day reads the files and stores the observations, t_validate_ingest checks them, and t_calculate_vod computes the VOD.

To reprocess a date range, trigger canvod_backfill by hand with the site and the range:

airflow dags trigger canvod_backfill --conf '{
    "site": "fangorn",
    "start_date": "2025001",
    "end_date": "2025010"
}'

Each date becomes one mapped task. A failure on one date retries only that date; the rest of the range continues.

How it fits into a run

The tasks call canvodpy's task functions directly: validate_data_dirs, check_day, process_day, validate_ingest, and calculate_vod. These functions are stateless and accept only primitives, so they carry dates and settings to and from Airflow. Use them in a script or a notebook without Airflow if you want.

The daily DAG waits for SP3/CLK products only when a run uses the precise ephemeris, that is when processing.params.ephemeris_source is not broadcast. With broadcast, the satellite angles come from the receiver's own data, the SBF files or the RINEX navigation files, and the results are available as soon as the day's files are there. The SP3/CLK wait, check_sp3_availability in canvod.airflow.sensors, goes by the day's age: it continues after 2 days for rapid and 14 days for final products (processing.aux_data.product_type), and skips days older than 30 days. See Configuration. Parallel processing and Icechunk stores explain how the runs scale and write.

Limits and known issues

  • An Icechunk store takes one commit at a time. Every task that writes to a store uses the pool canvod_store_write with one slot, which serializes the writes across the DAGs and the backfill runs. Create the pool once:
    airflow pools set canvod_store_write 1 "Serialise Icechunk commits"
    
  • Within one backfill run, the dates process one at a time (max_active_tis_per_dagrun=1).
  • The settings file must be reachable from the Airflow worker. If it is not, no DAGs are generated.

API

See the API reference for the full public API.