Documentation
¶
Overview ¶
Package pool maintains N ephemeral runner slots per OS pool, re-provisioning each slot when its runner finishes its single job (the process-exit model).
Index ¶
- type Hooks
- type Launcher
- func (l *Launcher) Allows(job github.QueuedJob) bool
- func (l *Launcher) EnsureImage(ctx context.Context) error
- func (l *Launcher) Labels() []string
- func (l *Launcher) Max() int
- func (l *Launcher) Name() string
- func (l *Launcher) RequiresWorkflowMetadata() bool
- func (l *Launcher) RunJob(ctx context.Context, job github.QueuedJob) (int, error)
- func (l *Launcher) RunOne(ctx context.Context) (int, error)
- func (l *Launcher) RunOneForSlot(ctx context.Context, slot int) (int, error)
- func (l *Launcher) RunOneOn(ctx context.Context, client *github.Client) (int, error)
- type Manager
- type Pool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Launcher ¶
type Launcher struct {
// contains filtered or unexported fields
}
Launcher launches one ephemeral runner for a pool. It is the shared unit used by both the always-on pool model and the webhook autoscaler.
func NewLauncher ¶
func NewLauncher(cfg config.Pool, image string, be backend.Backend, gh github.ClientProvider, env map[string]string, mounts []backend.Mount, logger *slog.Logger, hooks Hooks) *Launcher
NewLauncher builds a Launcher.
func (*Launcher) EnsureImage ¶
EnsureImage makes sure the runner image is present.
func (*Launcher) RequiresWorkflowMetadata ¶
RequiresWorkflowMetadata reports whether this pool authorizes jobs using fields that are available only from the workflow-run record.
func (*Launcher) RunOne ¶
RunOne provisions a fresh JIT runner for warm-pool slot zero and blocks until it finishes its one job. This is the warm-capacity path: there is no queued job to place against. When a specific repo has queued work, call RunOneOn instead.
func (*Launcher) RunOneForSlot ¶
RunOneForSlot provisions a fresh runner for a stable warm-pool slot.
func (*Launcher) RunOneOn ¶
RunOneOn provisions a fresh JIT runner registered to client's repo and blocks until it finishes its one job. A repo-scoped runner binds to exactly one repo, so demand-driven launches must pass the client for the repo that queued the job; otherwise the runner idles on a repo that has no work while the job that triggered the launch stays queued. A nil client is rejected.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager runs multiple pools concurrently.
func NewManager ¶
NewManager builds a Manager.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool keeps a pool's slots filled with ephemeral runners.
func New ¶
func New(cfg config.Pool, image string, be backend.Backend, gh github.ClientProvider, env map[string]string, mounts []backend.Mount, logger *slog.Logger) *Pool
New builds a Pool.