Skip to main content

Crate schedr_bin

Crate schedr_bin 

Source
Expand description

The schedr binary’s library part: everything main.rs runs, kept here so it can be tested.

run takes the arguments, the environment, a file reader and the output streams as inputs, so the whole command line can be exercised in unit tests.

Re-exports§

pub use schedr_client as client;

Modules§

app
Running a parsed command: loading the configuration and dispatching to the command.
cli
The command-line interface: the server roles, db, the user CLI and the in-task CLI (see archive/PROJECT.md, Web UI and CLI; In-task CLI).
ctx
schedr dag-ctx: a command task’s processes reading the run’s parameters and information from the agent, over the task’s context channel (decisions 143-147, see schedr_model::ctx).
interpreter
Which Python the built-in python interpreter is, when [interpreters] doesn’t define it.
local
The DAG author’s local commands: schedr dags check and schedr dags test (see archive/PROJECT.md, Testing DAGs).
logging
schedr’s own logs (see archive/PROJECT.md, Observability): stdout, JSON in pods and readable text in a terminal, with RUST_LOG-style level filters.
node
This process as a node of its deployment, for the Deployments page (decisions 121-123): the process’s ID, its host, and a master’s heartbeat of its row (leader or standby).
ops
The ops port of every role (see archive/PROJECT.md, Observability): plain HTTP on [ops] bind : port with only /healthz, /readyz and /metrics, never data or actions, so probes and Prometheus need no certificate or credentials. It is started first, so /readyz answers while a role starts.
roles
The server roles as processes of their own (M2.1): schedr master, schedr webserver and schedr worker, and the pieces schedr standalone runs together in one process.
secret_storage
[secret_storage] made into the agent’s storages, per role (see archive/PROJECT.md, Secret storage): standalone always has the db storage (its default when nothing else is configured); a worker in a distributed deployment has only what is configured (Vault), and never db (it has no database connection, and a secret never passes through the master).
secrets
schedr secrets ...: the db secret storage, straight in the database as schedr db is (see archive/PROJECT.md, Secret storage). Values are encrypted under SCHEDR_SECRET_KEY; only get prints one, list shows paths and key names, export writes files for Vault (decision 170) and prints none.
standalone
schedr standalone: every role in one process, on localhost, with SQLite by default (see archive/PROJECT.md, Master–worker protocol: standalone uses the same gRPC protocol).
task_api
The REST API as the master runs it for tasks (M4.11h, the user’s B2): the API’s own router, in this process, each request marked proven and named after the task that makes it.
times
Times in the CLI: reading --for and showing a moment in UTC and local time (see archive/PROJECT.md, Web UI and CLI: times and time zones).
user
The user CLI’s commands over the REST API: schedr dags ..., schedr runs ..., schedr tasks ... and schedr workers ....

Constants§

EXIT_USAGE
Exit code for wrong usage (unknown command, bad arguments).
VERSION
The schedr version, shared by the binary and the Python package.

Functions§

run
Runs schedr with the given arguments (including the program name) and returns the process exit code: 0 on success, 1 on an error, 2 on wrong usage.