Documentation
¶
Overview ¶
Package scaleset implements a Source backed by GitHub's Runner Scale Set API (the mechanism behind actions-runner-controller, via the standalone actions/scaleset client).
Instead of polling repos for queued jobs, each scale set holds a long-poll message session; GitHub pushes the set's desired runner count (statistics.TotalAssignedJobs) and per-job lifecycle events. The source emits one credential-free job per missing runner, labelled with the set name — the scheduler and agents downstream are unchanged — and mints the runner's JIT config only when the server dispatches the job (the Source is the controller's JITMinter in this mode, and its DispatchObserver: agent done-reports clear the supply ledger within seconds, and idle scale-down is controller-driven — agents never idle-reap managed dispatches). GitHub then assigns queued work to whichever runner registers. This removes the whole polling cost class: no repo list scans, no rate-limit breaker, no dedup of re-listed jobs.
A scale set's name doubles as the runs-on label workflows target, and repo scoping is enforced GitHub-side by the runner group the set lives in.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source streams jobs derived from scale set desired-count messages and mints their JIT configs at dispatch (it implements the server's JITMinter and DispatchObserver).
func (*Source) DispatchDone ¶
DispatchDone implements api.DispatchObserver: every terminal agent report clears the runner's ledger slot within seconds, so supply reconciliation runs on real events rather than TTL guesswork.
func (*Source) Mint ¶
Mint implements api.JITMinter: it registers a fresh runner under the offered name in the scale set that emitted the job. Called on server HTTP goroutines.
func (*Source) Name ¶
Name implements api.JITMinter: scale-set runner names are random per dispatch (a re-dispatched job gets a fresh runner, never a name collision), prefixed with the owning set for attribution.
func (*Source) Subscribe ¶
Subscribe ensures every configured scale set exists, then runs one message listener per set. All clients and scale sets are set up before any listener starts, so a failure can't strand live message sessions behind an error return. The channel closes when ctx is cancelled and all listeners have wound down.