airflow-systemd
Run and monitor systemd-managed jobs from Apache Airflow.
Manage services on an Airflow worker's systemd manager or on an SSH host.
Define units directly in a Python DAG or in airflow-config YAML.
from datetime import datetime, timezone
from pathlib import Path
from airflow import DAG
from airflow_systemd import ServiceConfiguration, ServiceUnitConfiguration, Systemd, SystemdAirflowConfiguration
with DAG(
dag_id="nightly-systemd",
schedule="@daily",
start_date=datetime(2025, 1, 1, tzinfo=timezone.utc),
catchup=False,
) as dag:
systemd = Systemd(
dag=dag,
cfg=SystemdAirflowConfiguration(
scope="user",
unit_dir=Path.home() / ".config/systemd/user",
working_dir=Path.home() / ".local/state/nightly-systemd",
service={
"airflow-nightly": ServiceUnitConfiguration(
service=ServiceConfiguration(type="exec", exec_start="/bin/sleep 5"),
),
},
),
)
The lifecycle writes unit files, reloads the manager, starts services, monitors
state with airflow-ha, and stops and removes generated configuration on
successful completion. SystemdSSH performs configuration and service
operations over the configured SSH connection.
Documentation
Start with the tutorial to run a self-contained local service and check cleanup. For an existing deployment, choose a how-to guide:
| Execution | Inline Python | airflow-config YAML |
|---|---|---|
| Local worker | Run a local service | Configure a local service |
| SSH host | Run a service over SSH | Configure an SSH service |
The API reference describes scope, paths, monitoring defaults, and DAG constraints. Why Airflow owns the schedule explains service ownership, user managers, remote paths, and restart policies.
Published documentation is available at airflow-laminar.github.io/airflow-systemd.
Ecosystem
- systemd-pydantic supplies unit models and the systemctl client.
- supervisor-pydantic and cron-pydantic model alternative runtimes.
- airflow-supervisor provides the analogous supervisord lifecycle.
- 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-systemd 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 | Provenance | |
|---|---|---|---|---|
| airflow_systemd-0.2.0.tar.gz | 15.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| airflow_systemd-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.8 kB
Release files / airflow_systemd-0.2.0.tar.gz
| Download URL | airflow_systemd-0.2.0.tar.gz |
|---|---|
| Size | 15.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d150dbd385e3f0b4738ae3487256e498afce4ee0b69c0f6657415412ac84810b
|
|
BLAKE2b-256 checksum How to use checksums |
89e0aea14fb47e4c7d13312e04bde6e9a2792a9ae7d33c1bc1fb10450c86f072
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|
Release files / airflow_systemd-0.2.0-py3-none-any.whl
| Download URL | airflow_systemd-0.2.0-py3-none-any.whl |
|---|---|
| Size | 19.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2bf7ff016f2e09cf417fadd2215ffb1880eb3f1aa09c4992db9ca224ec5287db
|
|
BLAKE2b-256 checksum How to use checksums |
6375c261a0315263e2b18c8db500f84ae2a8f8b901ae0c6effcc19325d10b914
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.15
|
Security for airflow-systemd 0.2.0
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.