runner

package
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IsolationMode

type IsolationMode string

IsolationMode controls how each job's working tree is materialized.

  • IsolationAuto: stage per-job when effective concurrency > 1 (default)
  • IsolationWorkspace: always stage per job
  • IsolationNone: share the source tree across all jobs (legacy behavior)
const (
	IsolationAuto      IsolationMode = "auto"
	IsolationWorkspace IsolationMode = "workspace"
	IsolationNone      IsolationMode = "none"
)

type JobState

type JobState = state.JobState

type Runner

type Runner struct {
	WorkDir            string
	UseWorkDirOverride bool
	Stdout             io.Writer
	Stderr             io.Writer
	DryRun             bool
	JobID              string
	Retry              bool
	Verbose            bool
	Color              bool
	Executor           executor.Executor
	Runtime            executor.RuntimeContext
	Store              *state.Store
	ExecID             string
	// PlanID is the plan checksum short-form, injected as ORUN_PLAN_ID into
	// every step environment. Also used to build ORUN_JOB_RUN_ID.
	PlanID           string
	Concurrency      int
	FilterComponents []string
	FilterEnv        string
	Isolation        IsolationMode
	KeepWorkspaces   bool
	// SkipLocalDepsForJob disables the local dependency-completion check when
	// running a single --job in remote mode. The remote backend's claim API
	// already enforces dependency ordering.
	SkipLocalDepsForJob bool
	// Hooks wires external lifecycle callbacks (remote state, log upload, etc.).
	Hooks *RunnerHooks

	ComponentConcurrency int
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(
	workDir string,
	useWorkDirOverride bool,
	stdout, stderr io.Writer,
	dryRun bool,
	jobID string,
	retry bool,
	verbose bool,
	exec executor.Executor,
	runtime executor.RuntimeContext,
	store *state.Store,
	execID string,
	concurrency int,
	filterComponents []string,
	filterEnv string,
) *Runner

func (*Runner) Run

func (r *Runner) Run(plan *model.Plan) (runErr error)

type RunnerHooks added in v1.12.0

type RunnerHooks struct {
	// AfterStepLog is called after each step completes with the step output.
	// It is called synchronously; implementations should be non-blocking or
	// fast to avoid delaying execution.
	AfterStepLog func(jobID, stepID, output string)
	// AfterJobTerminal is called when a job reaches a terminal state.
	AfterJobTerminal func(jobID string, success bool, errText string)
	// BeforeJob is called before a job starts. If it returns (true, nil) the job
	// is treated as already complete and execution is skipped. An error cancels
	// the run.
	BeforeJob func(jobID string) (skipExec bool, err error)
}

RunnerHooks allow external code to observe step and job lifecycle events without coupling the runner to a specific backend implementation.

type State

type State = state.ExecState

State is kept for backwards compat with tests referencing old types.

Jump to

Keyboard shortcuts

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