Documentation
¶
Overview ¶
Package sandbox is the seam between a check runner and the place where check code runs. A Sandbox is the only way that the runner executes the argv of a check, and every implementation must isolate that argv from the host.
Index ¶
Constants ¶
const CacheMount = "/cache"
CacheMount is the path at which a container sandbox shows Spec.Cache.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Sandbox ¶
Sandbox runs a check. Run returns an error only when the sandbox itself fails or when ctx ends before the argv does. A missing argv[0] ends with ExitCode 127. When Run returns, no process of the run is left.
type Spec ¶
type Spec struct {
// Dir is a host directory that holds the tree. The argv runs with the root of Dir as its working directory and may write there.
Dir string
Argv []string
// Timeout is the longest run time. When it passes, the sandbox kills every process that the argv started.
Timeout time.Duration
// Cache is an optional host directory that persists across runs. The argv sees it as read-write at the path in the
// variable WARD_CACHE_DIR, which CacheEnv sets with the Go and XDG cache variables. It never holds the tree.
Cache string
// Output receives the standard output and the standard error of the argv, interleaved.
Output io.Writer
}
Spec is one run.
Directories
¶
| Path | Synopsis |
|---|---|
|
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. |
|
Package fake is the minimal implementation of sandbox.Sandbox for tests.
|
Package fake is the minimal implementation of sandbox.Sandbox for tests. |
|
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. |
|
Package sandboxtest is the conformance suite of sandbox.Sandbox.
|
Package sandboxtest is the conformance suite of sandbox.Sandbox. |