schedr
An open-source job orchestrator written in Rust for running Python scripts, Bash processes, and Python DAGs.
from datetime import timedelta
from schedr import CommandOperator, Cron, Dag, StepDefaults, dag_ctx, task
with Dag(
"sync_customers",
trigger=Cron("0 3 * * *", tz="Europe/Warsaw", start="2026-01-01"),
defaults=StepDefaults(retries=2, retry_delay=timedelta(minutes=5)),
):
@task
def extract() -> list[dict[str, str]]:
return [{"id": "1", "name": "Ada"}, {"id": "2", "name": "Grace"}]
@task(timeout=timedelta(minutes=10))
def load(rows: list[dict[str, str]]) -> int:
print(f"loading {len(rows)} customers")
return len(rows)
rows = extract() # Output[list[dict[str, str]]]
count = load(rows) # load depends on extract (data flow)
CommandOperator( # depends on load: its command uses `count`
"notify",
command=["echo", t"synced {count} customers for {dag_ctx.run.planned_for}"],
)
(examples/sync.py; Python 3.14, for the t-string.)
Status
1.0.0 is the first stable release (pip install schedr; CHANGELOG.md), with M1 to M4B of
PLAN.md done: standalone and distributed, the fork server, the web UI and the native API.
From 1.0.0 on, the database schema changes only through new migrations and the protocol
between schedr's processes only additively within 1.x; DAG JSON, the REST API and the
configuration keep accepting what they accept now. Upgrading from the 0.1.0 preview needs a
fresh database. Next: the Airflow layer (M5); see PLAN.md.
What works:
- The native API:
Dag,@task(Python, sync orasync),CommandOperator,EmptyOperator, data flow between tasks,>>andchain,Cron/Every/Onceand presets,StepDefaults(retries, timeouts, queues, memory),dag_ctx; outcomes and.on(...),@branch,first_of, task groups, mapping (.partial/.expand), concurrency limits, run parameters (Dag(params=), a form in the UI);schedr dag-ctxandschedr task-ctx(secrets, connections, cleanup handles, resource values) for commands and plain scripts, over the agent's socket. - Waiting and starting: wait steps (
@sensor,@sensor.poke, thedelayanduntilsensors), triggers (@trigger,@trigger.pokewithbatch=) and named events through the API,RunOfto wait for or start on another DAG's run,TriggerDagOperator, backfills. - Secrets and connections:
secrets[...]in tasks and commands, from Vault (KV v2) or the database (schedr secrets, encrypted), masked in logs;@connectionwith typed clients (HTTP, SSH, SQL, Mongo, ...), given to commands as variables and files;schedr connections check/test. - Cleanups and resources: a task's
cleanup=run after each attempt, on its worker or, withcleanup_anywhere, on another after its worker was lost;@resource,CommandResourceandScriptResource, set up for their users and cleaned once after the last one. - Plain scripts: script roots (
SCHEDR_SCRIPT_PATH) withschedr.tomldeclarations, standalone jobs, thescripttask kind andScriptOperator. - Notifications and retention: webhooks and email on eight events (
Dag(notify=...),channel.sendfrom tasks);[retention]for runs, outputs, events and commands. - Testing DAGs:
schedr dags check,schedr dags test, andschedr.testing(run_dag,task_context) for pytest. - One process or separate roles:
schedr standalone(master, webserver and one worker, SQLite or Postgres; for production in one pod too), orschedr master,schedr workerandschedr webserveras separate processes on Postgres, with mTLS between them. - Surviving failures: workers keep running tasks while the master restarts; a worker's journal survives its restarts; drains on SIGTERM; a standby master takes over through a lease in the database; liveness decided on the master's monotonic clock; retries by rule (see the guide, "State and failures").
- Operations: the REST API (
/api/v1, Swagger UI at/api/v1/docs/) used by the CLI (dags,runs,tasks,workers,secrets,connections) and byschedr.apifrom Python; task logs through the webserver; a memory budget and watchdog per task;/healthz,/readyzand Prometheus/metricson an ops port. - Tested under faults: a stress suite and chaos scenarios (links cut one way or both, slowed, a frozen worker, a seeded random schedule), and a simulator of the master and its workers on one virtual clock, all nightly.
- Kubernetes: images (
schedrwith Python for workers and standalone,schedr-slimwithout the task libraries,schedr-serverwithout Python for the master and webserver), on glibc and on Alpine, and a Helm chart (charts/schedr: standalone or distributed, git-sync or DAGs from values, Istio, Vault), tested on kind. - Web UI:
schedr ui(in standalone too): DAGs, runs and their graphs (groups, mapped tasks), logs and outputs live, import errors, resources, cleanups and connections, actions with confirmations, several deployments in one UI.
Documentation
Online at https://ptutak.github.io/schedr/ (the latest release).
make docs builds the site into site/ (make docs-serve serves it at
http://localhost:8765). Its sections:
- Overview (this file).
- Writing DAGs (
docs/02-dags/): the native API, with tested examples. - How schedr works (
docs/03-guide/): the running system, failures, deployment. - Reference, generated from the code: configuration, CLI, REST API, metrics.
- Design:
archive/PROJECT.md, the decision log, one page per chapter. - Plan:
PLAN.md. - API: Python (from docstrings) and Rust (rustdoc).
Installing
pip install schedr # Python 3.14; add [pydantic] for Pydantic models
Wheels for Linux x86_64 (glibc and musl), Linux aarch64 and macOS arm64; each carries the
schedr binary, so there is nothing to compile. The images, x86_64: ghcr.io/ptutak/schedr (Python and
the package: standalone and workers, the base for your own image), ghcr.io/ptutak/schedr-slim
(the same without the task libraries and connection clients) and
ghcr.io/ptutak/schedr-server (the binary alone: master, webserver and UI), on Debian
(glibc), tagged with the version (1.0.0) and its series (1.0); the same on Alpine add
-alpine (1.0.0-alpine). There is no latest: a deployment names the version it runs.
Trying it
make standalone # schedr standalone on the DAGs of examples/, SQLite in .schedr/, API on :8080
make standalone-separate-ui # two standalones without a UI (the first with a standby master) and one `schedr ui` over both, on :8082
Then, from another shell: schedr dags list, schedr dags unpause sync_customers,
schedr runs trigger sync_customers, schedr runs list sync_customers (the CLI talks to
http://localhost:8080 unless --server or SCHEDR_SERVER says otherwise). After
make standalone-separate-ui the pages are on port 8082; the CLI still uses main's API
on 8080. DAGS=<directory> runs other DAGs;
LISTEN=127.0.0.1 keeps the API off the network (it has no authentication yet).
Layout
crates/
schedr-model/ # shared model: DAG JSON, states, JSON Schema
schedr-proto/ # Protobuf + gRPC, master <-> worker agent
schedr-config/ # configuration loading and validation
schedr-db/ # schema, migrations, queries (SQLite, Postgres)
schedr-master/ # scheduling loop, DAG validation, commands, the lease
schedr-agent/ # worker agent: processes, journal, memory watchdog, log endpoint
schedr-api/ # webserver: REST API, Swagger UI, log proxy
schedr-tls/ # mTLS on the internal links: certificates, reloading, handshakes
schedr/ # the binary: roles, user CLI, in-task CLI
src/<module>.rs # code
src/<module>/tests.rs # its unit tests
tests/ # integration tests; tests/stress/ is the stress suite
xtask/ # development tasks: schema, the docs' generated pages
python/
schedr/ # the Python package: the native API, the runner, schedr.testing
tests/unit/schedr/ # unit tests mirroring the package: test_<module>.py
tests/integration/
examples/ # example DAGs with their tests; examples/docs/ for the docs' examples
schema/ # generated from schedr-model, committed (make schema)
docs/ # the hand-written pages (02-dags, 03-guide, 05-design, 08-history indexes); the rest generated
charts/schedr/ # the Helm chart
images/ # Dockerfiles: schedr (with Python), schedr-server (without)
scripts/ # smoke tests; kind-*.sh cluster checks (standalone, mesh, distributed, kill)
Design decisions: archive/PROJECT.md. Implementation plan: PLAN.md. Open
bugs: BUGS.md.
Development
Requirements: Rust (stable, via rustup), uv, make; Podman or
Docker for the integration tests (Postgres) and the images; kind, kubectl and Helm for the
cluster scripts. make setup also installs cargo-nextest, cargo-llvm-cov and the
llvm-tools-preview component.
make setup # dev tools, uv sync, pre-commit hooks
make fmt # format Rust + Python
make lint # clippy, ruff, mypy
make test # unit tests: Rust (nextest) + pytest, both with an 85 % coverage floor
make test-integration # real processes, the binary, Postgres in a container
make schema # regenerate schema/ from the Rust model (CI fails if it's stale)
make docs # build the documentation site into site/ (fails on any warning)
make check # everything CI runs
make stress # the stress suite (STRESS_PROFILE=quick|full)
make smoke # build the release wheel and smoke-test it
make image # the schedr image (make server-image: schedr-server), smoke-tested
make chart-check # lint and render the Helm chart
make help # every target
Metadata
Release files for schedr 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| schedr-1.0.0-py3-none-musllinux_1_2_x86_64.whl | Python 3 | none | Linux musl 1.2+ x86-64 | Details for schedr-1.0.0-py3-none-musllinux_1_2_x86_64.whl |
| schedr-1.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details for schedr-1.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| schedr-1.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64 | Details for schedr-1.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
| schedr-1.0.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details for schedr-1.0.0-py3-none-macosx_11_0_arm64.whl |
Total release size: 116.3 MB
Release files / schedr-1.0.0-py3-none-musllinux_1_2_x86_64.whl
| Download URL | schedr-1.0.0-py3-none-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 30.5 MB |
| Tags | Linux musl 1.2+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
16aa47b7c73b14e0673c7fe6d28b203b4b824cfc289585e6e8e2ce0cbff2556f
|
|
BLAKE2b-256 checksum How to use checksums |
1ce40840c09cc3c2bab9973c47cb2336c107a288b64f9a27acce8ccbfa429b4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logRelease files / schedr-1.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | schedr-1.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 29.3 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
73fb07c0b8c6db0a3456ae76696668c21225dcb1e3c60f1ce7980aa9d07f4a63
|
|
BLAKE2b-256 checksum How to use checksums |
8bfcbc14623d50f7f8f3a56916e794ec851068808c6f2cc083c2211c28e241e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logRelease files / schedr-1.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | schedr-1.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 29.5 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
f5dc229665a2609b5c49bf9163cee59793dc4ee3e72631c7fd2106cf7eceb886
|
|
BLAKE2b-256 checksum How to use checksums |
22c4e67a3ff1d507c82a972772eea256f7e099f7baa03079fae267a1696d1c5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logRelease files / schedr-1.0.0-py3-none-macosx_11_0_arm64.whl
| Download URL | schedr-1.0.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 27.0 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5bf554138dc1350f09e24e1fc2ccb328481d72b3390e54d6f117577056a24813
|
|
BLAKE2b-256 checksum How to use checksums |
fcd54794f535d063b6f073b1bcc0bde81b66822f1c73c0fda2d26cdd4be793f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logSecurity for schedr 1.0.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.
Full provenance
All 4 files in this release have been uploaded with provenance metadata.
Attestation for schedr-1.0.0-py3-none-musllinux_1_2_x86_64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logA 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.