launch

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package launch joins a run's start to its engine in a process of the run's own (spec 4.1.5, 4.1.9). In the command that starts a run, it has start check and record the run, with what the run's process runs with kept in its record from its first event, then starts that process detached: terrace's own hidden command, handed the run's lease. In that process, it takes the lease up, reads what the run runs with, and has the engine take the run to its close.

What the process runs with is the engine's Spec, mapped from the start: its units, root, policy and its offer's, accounts, source map, parallelism and data-holding types, and whether the delete sign-in is set up (5.1.6), which the AWS config says without signing in.

Index

Constants

View Source
const LeaseFD = 3

LeaseFD is the file the run's process finds the run's lease on: the first after stderr.

View Source
const ProcessCommand = "__run"

ProcessCommand is terrace's hidden command that runs a run in its own process, its Opening's arguments after it.

Variables

This section is empty.

Functions

This section is empty.

Types

type Detacher

type Detacher interface {
	Detach(ctx context.Context, d runner.Detached) (runner.Started, error)
}

Detacher starts a process detached, as runner.Exec does.

type Launcher

type Launcher struct {
	// Starter checks and records each run. Launch has it encode the run's
	// input as the run's process reads it, whatever its own Input says.
	Starter  start.Starter
	Profiles Profiles
	Detacher Detacher
	// Self is terrace's own binary, which the run's process runs.
	Self string
	// Environ is terrace's own environment, which the run's process gets
	// whole, as Terragrunt's runs start from it (spec 6.2).
	Environ []string
}

Launcher starts runs, each in a detached process of terrace's own.

func (Launcher) Launch

func (l Launcher) Launch(ctx context.Context, in start.Input) (record.RunState, error)

Launch starts in's run and detaches its process, and is the run as it stands once that process has started. A refusal is start's, and the run gets no code and no record (4.1.2). Once the run is recorded, a failure is a *RunError carrying the run: a process that couldn't start has left a record whose lease no process holds, which the next command that reads it closes as failed (4.6.6); one that started goes on, and must never be started again. Once the run is recorded, ctx ending doesn't stop its process starting.

type Opening

type Opening struct {
	Code seam.Code
	// Dir, Identity and LongestPlanExpiry open the run's records, as
	// record.Config holds them.
	Dir               string
	Identity          repo.Identity
	LongestPlanExpiry time.Duration
}

Opening is what the run's process opens its run with: its code, and what opens the records it's kept in.

func ParseOpening

func ParseOpening(args []string) (Opening, error)

ParseOpening reads an Opening from the arguments the run's process is started with, after ProcessCommand.

type Process

type Process struct {
	Engine engine.Engine
	// Host is this machine, as machine.This gives it, which the records
	// judge runs' liveness by.
	Host seam.Host
}

Process runs a run in the process launched for it.

func (Process) Run

func (p Process) Run(ctx context.Context, o Opening, lease uintptr) error

Run takes up the run o opens, its lease handed to this process on the file lease, LeaseFD in a process Launch started, reads what it runs with, and has the engine take it to its close, returning once it has, as engine.Engine.Run does.

type Profiles

type Profiles interface {
	Profile(ctx context.Context, name config.ProfileName) (cloud.Profile, bool, error)
}

Profiles says what the AWS config holds of a profile, as cloud.Cloud does.

type RunError

type RunError struct {
	Run     record.RunState
	Started bool
	Err     error
}

RunError is a launch that failed once its run was recorded. Run is the run as it stands, as far as it could be read; Started says whether its process started, so the run goes on.

func (*RunError) Error

func (e *RunError) Error() string

func (*RunError) Unwrap

func (e *RunError) Unwrap() error

Jump to

Keyboard shortcuts

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