Skip to main content

airflow-nomad

Run and monitor Nomad-managed jobs from Apache Airflow.

Build Status codecov License PyPI

from datetime import datetime, timezone

from airflow import DAG
from airflow_nomad import Job, Nomad, NomadAirflowConfiguration, Task, TaskGroup

dag = DAG(
    dag_id="nightly-nomad",
    schedule="@daily",
    start_date=datetime(2025, 1, 1, tzinfo=timezone.utc),
    catchup=False,
)
config = NomadAirflowConfiguration(
    working_dir="/var/tmp/nightly-nomad",
    job=Job(
        id="airflow-nightly",
        type="batch",
        namespace="default",
        datacenters=["dc1"],
        task_groups=[
            TaskGroup(
                name="nightly",
                tasks=[Task(name="nightly", driver="exec", config={"command": "/bin/sleep", "args": ["5"]})],
            )
        ],
    )
)
Nomad(dag=dag, cfg=config)

The generated task lifecycle writes and registers the jobspec, monitors current allocations with airflow-ha, handles retriggers, stops the job, and optionally removes the generated configuration on successful completion. Workers use the Nomad CLI to reach local or remote clusters through their HTTP API. Define the same lifecycle in inline Python or airflow-config YAML.

Documentation

Start with the tutorial to run a short batch job on a development cluster and check cleanup. For an existing cluster, follow the Python or airflow-config guide. Both use the same cluster credentials and namespace settings.

Use the observability guide to forward task logs, attach failure callbacks, or monitor a persistent job between management runs.

The API reference lists configuration defaults, monitoring settings, and task boundaries. Why Airflow owns the lifecycle explains allocation state, persistent services, and scheduling ownership.

Published documentation is available at airflow-laminar.github.io/airflow-nomad.

Ecosystem

Metadata

Release files for airflow-nomad 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for airflow-nomad 0.2.1
File Size Uploaded Provenance
airflow_nomad-0.2.1.tar.gz 16.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for airflow-nomad 0.2.1
File Interpreter ABI Platform
airflow_nomad-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.9 kB

Release files / airflow_nomad-0.2.1.tar.gz

Download URL airflow_nomad-0.2.1.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
572aa18793fbf002aaecbd6f1effed421742f2ca5c3708df5986f47ee3fe14fb
BLAKE2b-256 checksum
How to use checksums
a222436f93918c6ec605e9621d4fab0527736e2b4df870605d9205d0b53939ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / airflow_nomad-0.2.1-py3-none-any.whl

Download URL airflow_nomad-0.2.1-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf59f57ff82bf72e431fc0ba280f791049a85a4afbd05f2ebda46b0c8b672ff5
BLAKE2b-256 checksum
How to use checksums
beb120668a804be627f394f1d96acaab2787470fcbd2adb801e05ac5826eab94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for airflow-nomad 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page