sshbootstrap

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package sshbootstrap installs and enrolls a per-user Jobman agent through the user's OpenSSH client. SSH is never used for steady-state execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecRunner

type ExecRunner struct{}

ExecRunner invokes the installed OpenSSH client without changing its config, host-key policy, authentication agent, or jump-host behavior.

func (ExecRunner) Run

func (ExecRunner) Run(ctx context.Context, executable string, arguments []string, input io.Reader) ([]byte, error)

Run invokes OpenSSH with bounded combined output and context cancellation.

type Options

type Options struct {
	Host                 string
	AgentBinary          string
	SSHExecutable        string
	RemoteBinary         string
	RemoteStateDirectory string
	ServerURL            string
	ServerCAFile         string
	TargetGenerationID   string
	EnrollmentToken      string
	ExpectedVersion      string
	PollInterval         time.Duration
	ArtifactStoreName    string
	ArtifactStoreVersion int64
	ArtifactRoot         string
	ArtifactS3Bucket     string
	ArtifactS3Prefix     string
	ArtifactS3Region     string
	ArtifactS3Owner      string
	AWSExecutable        string
	ContainerEngine      string
	ContainerExecutable  string
	ContainerHostNetwork bool
	MaximumLogBytes      int64
	MaximumArtifactBytes int64
	Slurm                bool
	SlurmRoot            string
	SlurmRunner          string
	Runner               Runner
	// contains filtered or unexported fields
}

Options configures one bounded, noninteractive bootstrap operation.

type Result

type Result struct {
	Host               string `json:"host"`
	AgentID            string `json:"agentId"`
	TargetGenerationID string `json:"targetGenerationId"`
	AgentVersion       string `json:"agentVersion"`
	ReusedEnrollment   bool   `json:"reusedEnrollment"`
}

Result identifies the enrolled installation without exposing credentials.

func Bootstrap

func Bootstrap(ctx context.Context, options Options) (Result, error)

Bootstrap validates, transfers, enrolls, and starts a Linux user agent. The enrollment token is supplied only on the remote process's standard input.

type Runner

type Runner interface {
	Run(context.Context, string, []string, io.Reader) ([]byte, error)
}

Runner is the narrow local process boundary used for OpenSSH invocations.

Jump to

Keyboard shortcuts

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