Command line¶
Every schedr command, generated from the code (schedr <command> --help shows the same).
Options of every command¶
Argument |
Description |
|---|---|
|
The configuration file (otherwise |
schedr master¶
Run the master: scheduling loop, state in the database, internal API for workers
schedr master [OPTIONS]
Argument |
Description |
|---|---|
|
Migrate the database at start, holding the master’s lease, when its schema isn’t up to date, instead of refusing it: for a deployment that can’t migrate as a step of its own (e.g. an init container without a mesh’s sidecar) |
schedr worker¶
Run a worker agent
schedr worker [OPTIONS]
schedr webserver¶
Run the webserver: the REST API used by the web UI and the CLI
schedr webserver [OPTIONS]
schedr ui¶
Run the web UI over webservers’ APIs ([ui] deployments)
schedr ui [OPTIONS]
schedr standalone¶
Run every role in one process (SQLite or Postgres): local development, or one pod in production
schedr standalone [OPTIONS]
Argument |
Description |
|---|---|
|
The address the REST API listens on (default 127.0.0.1); e.g. 0.0.0.0 in a pod behind a Service. The master’s gRPC stays on loopback |
|
Migrate the database at start (as |
|
Serve only the API on its port, not the web UI: one deployment of a |
|
A folder of DAG files, repeated for more; |
|
A folder of scripts, repeated for more; |
schedr db¶
Manage the database schema
schedr db [OPTIONS] <COMMAND>
schedr db migrate¶
Apply the migrations not applied yet, holding the master’s lease (refused while a master holds it)
schedr db migrate [OPTIONS]
Argument |
Description |
|---|---|
|
Wait until no master holds the lease (one stopped, or dead and its lease expiring) instead of refusing |
schedr db status¶
Show whether the schema fits this version of schedr
schedr db status [OPTIONS]
schedr secrets¶
Set, list, read and export the secrets of standalone’s db storage (straight in the database, as db is; values encrypted under SCHEDR_SECRET_KEY)
schedr secrets [OPTIONS] <COMMAND>
schedr secrets set¶
Set keys of the secret at PATH (made if there is none); its other keys are kept
schedr secrets set [OPTIONS] <PATH> <KEY=VALUE>...
Argument |
Description |
|---|---|
|
The secret’s path, e.g. |
|
|
schedr secrets list¶
List the secrets’ paths and key names (never the values)
schedr secrets list [OPTIONS] [PREFIX]
Argument |
Description |
|---|---|
|
Only the paths starting with it, e.g. |
schedr secrets get¶
Print one value (path#key), or a whole secret as a JSON object (path)
schedr secrets get [OPTIONS] <SECRET>
Argument |
Description |
|---|---|
|
|
schedr secrets delete¶
Delete the secret at PATH, all its keys
schedr secrets delete [OPTIONS] <PATH>
Argument |
Description |
|---|---|
|
The secret’s path |
schedr secrets export¶
Write every secret for Vault: DIR/<path>.json each (mode 0600), loaded with vault kv put secret/<path> @DIR/<path>.json. DIR must be empty or missing
schedr secrets export [OPTIONS] --to <DIR>
Argument |
Description |
|---|---|
|
The directory to write (made if missing) |
schedr secrets new-key¶
Print a new random key for SCHEDR_SECRET_KEY
schedr secrets new-key [OPTIONS]
schedr dags¶
List, pause, check and test DAGs
schedr dags [OPTIONS] <COMMAND>
schedr dags list¶
List DAGs
schedr dags list [OPTIONS]
schedr dags pause¶
Stop the scheduler creating runs of a DAG
schedr dags pause [OPTIONS] <DAG>
Argument |
Description |
|---|---|
|
The DAG’s ID |
schedr dags unpause¶
Let the scheduler create runs of a DAG again
schedr dags unpause [OPTIONS] <DAG>
Argument |
Description |
|---|---|
|
The DAG’s ID |
schedr dags check¶
Parse DAG files and schedr.toml files locally and report errors
schedr dags check [OPTIONS] <PATH>
Argument |
Description |
|---|---|
|
A file or directory |
|
Fail if an active worker at this server runs an older schedr (major.minor) than this one |
schedr dags test¶
Run one real run of a DAG locally and report each task (no server)
schedr dags test [OPTIONS] <DAG>
Argument |
Description |
|---|---|
|
The DAG’s ID |
|
The moment the run is for (UTC without an offset) |
|
A run parameter: |
|
All run parameters as one JSON object |
|
A secret value for the run: |
|
For a DAG a trigger starts: the event’s key |
|
And its data: JSON, or |
|
And when it happened (as |
|
A connection’s values for the run, given instead of its own: |
|
Run only this task and its upstream tasks |
|
The DAG files: a directory (a DAG root) or one file; default: the configured DAG roots ( |
schedr runs¶
Trigger, list, show, cancel and backfill runs
schedr runs [OPTIONS] <COMMAND>
schedr runs trigger¶
Trigger a manual run
schedr runs trigger [OPTIONS] <DAG>
Argument |
Description |
|---|---|
|
The DAG’s ID |
|
The moment the run is for (UTC without an offset); default: now |
|
A run parameter: |
|
All run parameters as one JSON object |
|
For a DAG a trigger starts: run again an event it found, by key |
|
Or give an event: its key. It is never stored as an event |
|
And its data: JSON, or |
|
And when it happened (as |
schedr runs list¶
List the runs of a DAG
schedr runs list [OPTIONS] <DAG>
Argument |
Description |
|---|---|
|
The DAG’s ID |
|
Only the runs for this moment |
schedr runs show¶
Show a run and its tasks (a mapped task’s instances as fetch[0], fetch[1], …)
schedr runs show [OPTIONS] <RUN_ID>
Argument |
Description |
|---|---|
|
The run’s ID |
schedr runs cancel¶
Cancel a run, or what’s left of a backfill
schedr runs cancel [OPTIONS] <RUN_ID|--backfill <BACKFILL_ID>>
Argument |
Description |
|---|---|
|
The run’s ID |
|
Cancel the remaining runs of this backfill instead |
schedr runs backfill¶
Create one run per fire time in a range
schedr runs backfill [OPTIONS] --from <TIME> <DAG>
Argument |
Description |
|---|---|
|
The DAG’s ID |
|
The range’s first moment (inclusive; UTC without an offset) |
|
Its last moment (inclusive); default: now, and a later one ends at now |
|
A run for every fire time, also those with a successful, queued or running run |
|
A run parameter, for every run: |
|
All run parameters as one JSON object |
|
Only count the fire times and the runs it would create |
schedr tasks¶
Cancel or retry single tasks of a run, or read their attempts, logs and outputs
schedr tasks [OPTIONS] <COMMAND>
schedr tasks cancel¶
Cancel one running task
schedr tasks cancel [OPTIONS] <RUN_ID> <TASK_ID>
Argument |
Description |
|---|---|
|
The run’s ID |
|
The task’s ID |
|
The instance of a mapped task |
schedr tasks retry¶
Retry an unschedulable task of an unfinished run
schedr tasks retry [OPTIONS] <RUN_ID> <TASK_ID>
Argument |
Description |
|---|---|
|
The run’s ID |
|
The task’s ID |
|
The instance of a mapped task |
schedr tasks logs¶
Print an attempt’s log, read from the worker that ran it
schedr tasks logs [OPTIONS] <RUN_ID> <TASK_ID>
Argument |
Description |
|---|---|
|
The run’s ID |
|
The task’s ID |
|
The instance of a mapped task |
|
The attempt’s try number (the latest by default) |
|
Keep printing the log while the task runs |
schedr tasks attempts¶
List a task’s attempts (of one instance, for a mapped task)
schedr tasks attempts [OPTIONS] <RUN_ID> <TASK_ID>
Argument |
Description |
|---|---|
|
The run’s ID |
|
The task’s ID |
|
The instance of a mapped task |
schedr tasks output¶
Print a task’s output (a mapped task’s gathered list, or one instance’s)
schedr tasks output [OPTIONS] <RUN_ID> <TASK_ID>
Argument |
Description |
|---|---|
|
The run’s ID |
|
The task’s ID |
|
The instance of a mapped task |
schedr connections¶
Check a deployment’s connections, or test one, on a worker
schedr connections [OPTIONS] <COMMAND>
schedr connections check¶
Render every connection of a root (all roots if none is given) with the worker’s storages: each secret present or missing, never a value. Fails when one isn’t
schedr connections check [OPTIONS] [ROOT]
Argument |
Description |
|---|---|
|
The root; every root with connections if not given |
|
Only this connection |
|
The worker to run it on; one having the root’s current code otherwise |
schedr connections test¶
Open a connection on a worker and run its check (or open and close it, without one). Fails when it doesn’t work
schedr connections test [OPTIONS] <NAME>
Argument |
Description |
|---|---|
|
The connection |
|
Its root, when several define one by that name |
|
The worker to run it on; one having the root’s current code otherwise |
|
How long it may take ( |
schedr sensors¶
Wait steps switched off for getting their host killed
schedr sensors [OPTIONS] <COMMAND>
schedr sensors switched-off¶
List the wait steps switched off
schedr sensors switched-off [OPTIONS]
schedr sensors switch-on¶
Switch a wait step back on, forgetting its strikes
schedr sensors switch-on [OPTIONS] <DAG> <SENSOR>
Argument |
Description |
|---|---|
|
Its DAG |
|
The wait step’s task ID |
schedr triggers¶
Event triggers: see them, and start them again
schedr triggers [OPTIONS] <COMMAND>
schedr triggers list¶
List every DAG’s trigger
schedr triggers list [OPTIONS]
schedr triggers show¶
Show a DAG’s trigger
schedr triggers show [OPTIONS] <DAG>
Argument |
Description |
|---|---|
|
Its DAG |
schedr triggers events¶
List what a DAG’s trigger found, newest first
schedr triggers events [OPTIONS] <DAG>
Argument |
Description |
|---|---|
|
Its DAG |
|
How many at most Default: |
schedr triggers restart¶
Start a DAG’s trigger again from its bookmark, whatever stopped it
schedr triggers restart [OPTIONS] <DAG>
Argument |
Description |
|---|---|
|
Its DAG |
schedr triggers skip¶
Pass the run an @trigger(wait_for=...) keeps failing on: it is called for the next
schedr triggers skip [OPTIONS] <DAG>
Argument |
Description |
|---|---|
|
Its DAG |
schedr triggers switch-on¶
Switch a DAG’s trigger back on, forgetting its strikes
schedr triggers switch-on [OPTIONS] <DAG>
Argument |
Description |
|---|---|
|
Its DAG |
schedr events¶
Events posted for EventNamed triggers and waiting steps (decision 354)
schedr events [OPTIONS] <COMMAND>
schedr events post¶
Post an event: a trigger on its name starts a run per key, a step waiting for it in a run goes on
schedr events post [OPTIONS] --key <KEY> <NAME>
Argument |
Description |
|---|---|
|
Its name, written as a DAG ID is |
|
Its key |
|
Its data: JSON, or |
|
When it happened (UTC without an offset); now otherwise |
schedr events list¶
List the events posted, newest first
schedr events list [OPTIONS]
Argument |
Description |
|---|---|
|
Only those of this name |
|
How many at most Default: |
schedr resources¶
A run’s resources
schedr resources [OPTIONS] <COMMAND>
schedr resources list¶
List a run’s resources
schedr resources list [OPTIONS] <RUN>
Argument |
Description |
|---|---|
|
The run |
schedr workers¶
Drain and resume workers
schedr workers [OPTIONS] <COMMAND>
schedr workers list¶
List the workers the master has seen, with their state (gone ones included)
schedr workers list [OPTIONS]
schedr workers drain¶
Drain a worker for maintenance: it finishes its tasks and stays idle
schedr workers drain [OPTIONS] <WORKER>
Argument |
Description |
|---|---|
|
The worker’s ID |
schedr workers resume¶
Let a drained worker take tasks again
schedr workers resume [OPTIONS] <WORKER>
Argument |
Description |
|---|---|
|
The worker’s ID |
schedr task-ctx¶
Inside a running task: cleanup handles, resource values, declared secrets
schedr task-ctx [OPTIONS] <COMMAND>
schedr task-ctx cleanup¶
Cleanup handles of the running attempt
schedr task-ctx cleanup [OPTIONS] <COMMAND>
schedr task-ctx cleanup add¶
Register a handle (key=value, key:=json), before the work it cleans up after
schedr task-ctx cleanup add [OPTIONS] <HANDLE_TYPE> [FIELDS]...
Argument |
Description |
|---|---|
|
The handle’s type name, e.g. |
|
The handle’s fields |
|
The whole handle as one JSON object |
schedr task-ctx cleanup list¶
List the handles, in a cleanup
schedr task-ctx cleanup list [OPTIONS] [HANDLE_TYPE]
Argument |
Description |
|---|---|
|
Only handles of this type |
|
Print this field’s raw values, one per line |
schedr task-ctx resource¶
The value of the resource this setup creates, or this cleanup cleans up
schedr task-ctx resource [OPTIONS] <COMMAND>
schedr task-ctx resource set¶
Report the resource’s value, in its setup
schedr task-ctx resource set [OPTIONS] [FIELDS]...
Argument |
Description |
|---|---|
|
The value’s fields ( |
|
The whole value as JSON, of any type ( |
schedr task-ctx resource get¶
Read the resource’s value, in its cleanup
schedr task-ctx resource get [OPTIONS]
Argument |
Description |
|---|---|
|
Print this field’s raw values, one per line |
schedr task-ctx secret¶
Secrets declared in the task’s secrets=
schedr task-ctx secret [OPTIONS] <COMMAND>
schedr task-ctx secret get¶
Print a declared secret: a key’s value as it is, with no trailing newline; a whole secret (path without #key) as one line of JSON
schedr task-ctx secret get [OPTIONS] <SECRET>
Argument |
Description |
|---|---|
|
|
|
The secret storage, if not the default one |
schedr task-ctx connection¶
A connection the task declares (connections=): its values, its secrets filled in
schedr task-ctx connection [OPTIONS] <NAME>
Argument |
Description |
|---|---|
|
The connection’s name (its function’s) |
|
Print |
|
Print the values as one line of JSON (the default) |
schedr task-ctx api¶
A request to schedr’s REST API, made as this task (open to tasks: POST and GET /api/v1/events); prints the answer’s JSON, fails on an error status
schedr task-ctx api [OPTIONS] <METHOD> <PATH>
Argument |
Description |
|---|---|
|
|
|
The path and its query, e.g. |
|
The body, JSON |
|
Sent again with the same key, the request is the one made the first time |
schedr task-ctx events¶
Events (EventNamed), posted and listed as this task
schedr task-ctx events [OPTIONS] <COMMAND>
schedr task-ctx events post¶
Post an event; prints it as stored, as one line of JSON
schedr task-ctx events post [OPTIONS] --key <KEY> <NAME>
Argument |
Description |
|---|---|
|
Its name, written as a DAG ID is |
|
Its key: a trigger starts one run per key, a waiting step matches its own |
|
Its data: JSON, or |
|
When it happened (UTC without an offset); now otherwise |
|
Sent again with the same key (a retried task), it is the event stored the first time |
schedr task-ctx events list¶
List the events posted, newest first, one line of JSON each
schedr task-ctx events list [OPTIONS]
Argument |
Description |
|---|---|
|
Only those of this name |
|
How many at most (500 at most) Default: |
schedr task-ctx notify¶
Sends a message to a notification channel of the task’s DAG (or a server one); the master fills the channel’s body and delivers it later
schedr task-ctx notify [OPTIONS] <CHANNEL>
Argument |
Description |
|---|---|
|
The channel’s name |
|
Its text (the |
|
Its data (the |
schedr dag-ctx¶
Inside a running task: the run’s parameters and run information
schedr dag-ctx [OPTIONS] <COMMAND>
schedr dag-ctx params¶
The run’s parameters
schedr dag-ctx params [OPTIONS] <COMMAND>
schedr dag-ctx params get¶
Print the values as JSON, or one field’s raw value
schedr dag-ctx params get [OPTIONS]
Argument |
Description |
|---|---|
|
Print this field’s raw values, one per line |
schedr dag-ctx run¶
The run information (id, kind, planned_for, since, …)
schedr dag-ctx run [OPTIONS] <COMMAND>
schedr dag-ctx run get¶
Print the values as JSON, or one field’s raw value
schedr dag-ctx run get [OPTIONS]
Argument |
Description |
|---|---|
|
Print this field’s raw values, one per line |