Documentation
¶
Overview ¶
Package runner is the container-backend sandbox runner entry point (`boid runner-container`, runner_container_linux.go's RunContainer). See docs/{ja,en}/architecture/sandbox-internals.md for the current launch chain.
This file holds the portable helpers RunContainer uses (spec decoding, signal mapping, the post-namespace-setup file/symlink/PATH/job-done steps) so they can be unit-tested independent of any syscall or container-runtime path.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunContainer ¶ added in v0.1.0
RunContainer is the `boid runner-container` entry point and the entry point of every sandboxed job: the image's own ENTRYPOINT is ["/usr/local/bin/boid","runner-container"] (build/container/Dockerfile). It runs the post-namespace-setup sequence (write spec.Files, materialize spec.Symlinks, run the sandbox-internal clone if declared, resolve PATH, dispatch to the harness adapter, report job-done) via the shared helpers in runner.go.
The container runtime supplies its own network namespace and egress policy (compose network / egress proxy) and already provides process/mount namespace isolation — the image's own rootfs *is* the sandbox root the moment this process starts, so there is no clone/pivot_root sequence to run here. `HostConfig.Init: true` (docker-init/tini) is PID 1: it owns zombie reap and SIGUSR1 delivery to this process, and the harness adapters' own sigutil.ForwardAndWait (internal/adapters/sigutil) translates a received SIGUSR1 into the agent's graceful SIGTERM.
Types ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
State appends NDJSON diagnostic records to /tmp/boid-<id>-runner-state.json. Each write is a single appended line followed by Sync(), so a panic / kill -9 still leaves the last reached phase flushed on disk. Every method is nil-safe.
func OpenState ¶
OpenState opens (creating) the state file for append. A nil *State (returned when path is empty or open fails) makes all subsequent methods no-ops so the diagnostic path never blocks the run.