Documentation
¶
Overview ¶
Package workers records each eval worker's check-in and tells the owner whether it is online and on the common sandbox image. Provider keys live on the server, so a worker needs nothing per provider.
Index ¶
Constants ¶
View Source
const StaleAfter = 5 * time.Minute
StaleAfter is how long a worker may be silent before it shows as offline.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store reads and writes check-ins.
type Worker ¶
type Worker struct {
WorkersCheckin
FirstSeen time.Time `json:"first_seen"`
LastSeen time.Time `json:"last_seen"`
// Problems are why the worker cannot run the configured panel. Empty means ready.
Problems []string `json:"problems"`
}
Worker is one worker's last check-in and its readiness.
type WorkersCheckin ¶
type WorkersCheckin struct {
WorkerID string `json:"worker_id" minLength:"1" maxLength:"200"`
Version string `json:"version"`
Driver string `json:"driver"`
HardwareIsolated bool `json:"hardware_isolated"`
NetworkPolicy bool `json:"network_policy"`
Concurrency int `json:"concurrency"`
SandboxImage string `json:"sandbox_image"`
// Harness is the agent CLI and version the sandbox image runs.
Harness string `json:"harness,omitempty"`
}
WorkersCheckin is what a worker reports on each poll.
type WorkersCheckinReply ¶
type WorkersCheckinReply struct {
OK bool `json:"ok"`
}
WorkersCheckinReply acknowledges a check-in.
type WorkersEnvVar ¶
type WorkersKeyBody ¶
type WorkersKeyBody struct {
Name string `json:"name" minLength:"1" maxLength:"64"`
}
type WorkersKeyReply ¶
type WorkersKeyReply struct {
Key string `json:"key"`
// Env is every variable the new worker needs, filled in. Provider keys
// stay on the server.
Env []WorkersEnvVar `json:"env"`
}
type WorkersListBody ¶
type WorkersListBody struct {
Workers []Worker `json:"workers"`
}
Click to show internal directories.
Click to hide internal directories.