Documentation
¶
Overview ¶
Package sshrunner holds the SSH-based runner bootstrap shared by the macOS drivers (tart, lume). Every function is driver-agnostic: it operates on a guest user+IP, independent of how the VM was provisioned or named.
Index ¶
- Constants
- func Alive(ctx context.Context, user, ip string) (bool, error)
- func InstallAndStart(ctx context.Context, user, ip string, runner Runner, ...) error
- func RandomName(prefix string) string
- func StartedJob(ctx context.Context, user, ip string) (bool, error)
- func WaitForSSH(ctx context.Context, user, ip string) error
- type Runner
Constants ¶
const SSHTimeout = 60 * time.Second
SSHTimeout bounds WaitForSSH: how long to wait for a freshly booted guest to accept connections before giving up.
Variables ¶
This section is empty.
Functions ¶
func Alive ¶
Alive reports whether the runner's Listener process is up inside the guest. Absence => the job finished (cleanly or otherwise).
func InstallAndStart ¶
func InstallAndStart(ctx context.Context, user, ip string, runner Runner, jitConfig, actionCache string) error
A login shell loads the guest's toolchain environment before starting the runner.
jitConfig is passed as a positional parameter ($1), not interpolated into the script body, so the token can't break out of the shell quoting. The outer shell receives it shell-quoted (one ssh-level reparse) and threads it into the inner login shell via `_ "$1"`.
A non-empty actionCache is the guest path of the action archive cache.
func RandomName ¶
RandomName returns a unique VM name with the given prefix. The prefix lets List() reconcile our VMs from everything else on the host.
func StartedJob ¶
StartedJob reports whether the runner has begun a job, read from its log. A missing log or absent marker counts as not-started (exit 1), so a runner idling after a pre-pickup cancel is reported false rather than erroring.