Documentation
¶
Overview ¶
Package runner is `ward runner`: a check runner that leases check requests from ward, fetches the exact tree, runs the argv of the check in a sandbox and posts the result to ward.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MotteFetcher ¶
MotteFetcher reads trees from motte with a read grant. Grant returns the grant text for each call, so a rotated grant applies at once.
func (MotteFetcher) Fetch ¶
func (m MotteFetcher) Fetch(ctx context.Context, req runnerproto.Request, dir string) error
Fetch writes the files of req.Tree to dir. It reads the commit first and refuses a commit whose tree is another tree.
type Options ¶
type Options struct {
WardURL string
// Token returns a check token for repo.
Token func(repo string, exp time.Time) (string, error)
// Fetch writes the files of req.Tree into dir. It must not follow a link that the tree holds.
Fetch func(ctx context.Context, req runnerproto.Request, dir string) error
Sandbox sandbox.Sandbox
// Concurrency is the most leases that the runner holds at one time.
Concurrency int
WorkDir string
// CacheDir is the root of the durable caches. Each repository and env gets a directory under it, so a check sees only
// the cache of its own repository. Empty means no cache.
CacheDir string
// RunnerToken returns a runner token. Pull reports the isolation of Sandbox with it.
RunnerToken func(exp time.Time) (string, error)
Clock check.Clock
Log *slog.Logger
HTTP *http.Client
}
Options are the parts of a Runner. Every field except Clock, Log, HTTP and WorkDir is required.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner leases check requests and runs them.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package install prepares a Linux host to run `ward runner` in pull mode.
|
Package install prepares a Linux host to run `ward runner` in pull mode. |
|
Package sandbox is the seam between a check runner and the place where check code runs.
|
Package sandbox is the seam between a check runner and the place where check code runs. |
|
container
Package container runs a check in an OCI container through the command line of an engine such as docker or podman.
|
Package container runs a check in an OCI container through the command line of an engine such as docker or podman. |
|
fake
Package fake is the minimal implementation of sandbox.Sandbox for tests.
|
Package fake is the minimal implementation of sandbox.Sandbox for tests. |
|
gvisor
Package gvisor runs a check in an OCI container under the gVisor runtime runsc, through a container engine.
|
Package gvisor runs a check in an OCI container under the gVisor runtime runsc, through a container engine. |
|
sandboxtest
Package sandboxtest is the conformance suite of sandbox.Sandbox.
|
Package sandboxtest is the conformance suite of sandbox.Sandbox. |