airflow-nomad
Run and monitor Nomad-managed jobs from Apache Airflow.
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
- nomad-pydantic supplies jobspec models and the Nomad CLI client.
- supervisor-pydantic, systemd-pydantic, and cron-pydantic model alternative runtimes.
- airflow-supervisor and airflow-systemd provide analogous long-running job lifecycles.
- airflow-cron converts cron jobs into ordinary Airflow tasks.
- airflow-pydantic supplies declarative task and connection models.
- airflow-config produces YAML-driven DAGs.
Metadata
Release files for airflow-nomad 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| airflow_nomad-0.2.0.tar.gz | 16.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| airflow_nomad-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.9 kB
Release files / airflow_nomad-0.2.0.tar.gz
| Download URL | airflow_nomad-0.2.0.tar.gz |
|---|---|
| Size | 16.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
587f36e3245ad5f3724604303e0ff109b220cdf63310c7d8c0cfba7893643add
|
|
BLAKE2b-256 checksum How to use checksums |
1348a2bce0fda98dfb5bd129eb40bfdc1f5fff976d78646ca2c4cdb9e1b97c5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / airflow_nomad-0.2.0-py3-none-any.whl
| Download URL | airflow_nomad-0.2.0-py3-none-any.whl |
|---|---|
| Size | 19.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58f371bfb1a35d69e4dfe362136fcdaac0eff519be7002d6de0f26e5aa698275
|
|
BLAKE2b-256 checksum How to use checksums |
29533e6a08134a80a10e25f004e94961142ee72d07cb9e61984d8f470e1ff8cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|