cleanup and refactor

This commit is contained in:
Timur Gordon
2025-11-13 14:41:30 +01:00
parent 4b516d9d7e
commit 2625534152
29 changed files with 2662 additions and 3276 deletions

View File

@@ -1,8 +1,10 @@
# Supervisor
A job execution supervisor that queues jobs to runners over redis and returns their output. It provides an OpenRPC server for remote job dispatching. The openrpc server requires authorization via a shared secret key. Secret keys are scoped to grant one of three levels of access: Admin, Registrar (can register runners), User (can use supervisor).
A job execution supervisor that queues jobs to runners over Redis and returns their output. It provides an OpenRPC server for remote job dispatching. The OpenRPC server requires authorization via API keys. API keys are scoped to grant one of three levels of access: Admin, Registrar (can register runners), User (can dispatch jobs).
Jobs contain scripts, some env vars, an identifier of the runner to execute the script and signatures. The supervisor also verifies the signatures, however access control based on who the signatories of a script is handled by the runner logic.
Jobs contain scripts, environment variables, an identifier of the runner to execute the script, and signatures. The supervisor verifies the signatures, however access control based on who the signatories of a script is handled by the runner logic.
**Note:** Runners are expected to be started and managed externally. The supervisor only tracks which runners are registered and queues jobs to them via Redis.
## Usage
@@ -16,7 +18,13 @@ The scripts directory also offers other scripts for building testing etc.
## Functionality
Beyond the job functionality, the supervisor also provides functionality for managing keys and registering runners. Runner registration simply means the supervisor becomes aware that a certain runner is being run and listening to it's queue. The The full spec can be seen in `openrpc.json`.
Beyond job dispatching, the supervisor provides:
- **API Key Management**: Create, list, and remove API keys with different permission scopes
- **Runner Registration**: Register runners so the supervisor knows which queues are available
- **Job Lifecycle**: Create, start, stop, and monitor jobs
- **Job Queuing**: Queue jobs to specific runners via Redis
Runner registration simply means the supervisor becomes aware that a certain runner is listening to its queue. The full API specification can be seen in `docs/openrpc.json`.
## OpenRPC