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, seeschedr_model::ctx).- interpreter
- Which Python the built-in
pythoninterpreter is, when[interpreters]doesn’t define it. - local
- The DAG author’s local commands:
schedr dags checkandschedr 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:portwith only/healthz,/readyzand/metrics, never data or actions, so probes and Prometheus need no certificate or credentials. It is started first, so/readyzanswers while a role starts. - roles
- The server roles as processes of their own (M2.1):
schedr master,schedr webserverandschedr worker, and the piecesschedr standaloneruns 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 thedbstorage (its default when nothing else is configured); a worker in a distributed deployment has only what is configured (Vault), and neverdb(it has no database connection, and a secret never passes through the master).- secrets
schedr secrets ...: thedbsecret storage, straight in the database asschedr dbis (see archive/PROJECT.md, Secret storage). Values are encrypted underSCHEDR_SECRET_KEY; onlygetprints one,listshows paths and key names,exportwrites 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
--forand 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 ...andschedr 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
schedrwith the given arguments (including the program name) and returns the process exit code: 0 on success, 1 on an error, 2 on wrong usage.