Expand description
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).
The master’s gRPC service, the REST API, the master’s loop and one worker agent with its log
endpoint run side by side; the agent talks to the master over gRPC on localhost like any
worker, and the API reads logs from the endpoint (no TLS: neither listens beyond
localhost, whatever [tls] says). --migrate migrates the database at start (a laptop);
without it, a schema that isn’t up to date is refused (production migrates as a step of its
own, schedr db migrate). When the master fails (another took the lease over), the whole
process ends, its tasks interrupted: restarted, it waits as a standby.
In one pod (for testing on a cluster, see archive/PROJECT.md): --listen 0.0.0.0 opens the REST
API to a Service, SIGTERM stops it cleanly, and a lock in the data directory refuses a
second standalone on the same data (two pods on one volume would schedule every run twice).
Structs§
- Listening
- The addresses standalone listens on, once it does.
- Standalone
- Everything
schedr standaloneruns, read from the configuration.
Constants§
- LOCK_
FILE - The name of the lock file in the data directory.
Functions§
- banner
- The line standalone prints once it listens.
- command
- Runs
schedr standaloneuntil Ctrl-C or SIGTERM, the REST API onlisten(127.0.0.1 when not given); the banner goes to the log once it listens. - ended_
within - Runs
workto its end, or untilboundafterfailedturned true: whether it ended.failedclosing without turning true bounds nothing. - lock_
data_ dir - Takes the data directory’s lock for as long as the returned file is open: one standalone per data directory (and its SQLite database).
- plan
- Reads the standalone setup from the configuration and the environment (
envgives the data directory’s default, the host name and what tasks may inherit). - run
- Runs standalone until asked to stop (
shutdowncounts the requests): its worker drains first (a second request interrupts its tasks at once), then the master and the API stop, so interrupted tasks are recorded;listeninggets the addresses once bound. A failing master ends it too, its worker’s tasks interrupted at once (nothing can record them). - sqlite_
file - Standalone’s SQLite file in the data directory, without
[database] url.