sshrunner

package
v0.2.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

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

View Source
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

func Alive(ctx context.Context, user, ip string) (bool, error)

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

func RandomName(prefix string) string

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

func StartedJob(ctx context.Context, user, ip string) (bool, error)

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.

func WaitForSSH

func WaitForSSH(ctx context.Context, user, ip string) error

WaitForSSH blocks until an SSH session to the guest succeeds or SSHTimeout elapses.

Types

type Runner

type Runner struct {
	Version string
	Tar     string
}

Runner is a runner release cached on the host.

func FetchLatest

func FetchLatest(ctx context.Context, dir, keep string) (Runner, error)

Callers must exclude cache updates while copying a cached archive into a guest.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL