Documentation
¶
Overview ¶
Package localrun executes job DAGs locally without a running server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenEphemeralDB ¶
OpenEphemeralDB creates an in-memory SQLite database with all models migrated. The returned cleanup function closes the database.
Types ¶
type Config ¶
type Config struct {
MaxParallel int
TaskTimeout time.Duration
RunTimeout time.Duration
Env map[string]string // extra env vars injected into every task
OnPrepared func(store *run.Store, db *gorm.DB, jobModel *models.Job) error
// EngineFactory overrides EVERY engine kind (docker, kubernetes, podman)
// job.New dispatches steps through — a step's declared `engine:` picks
// which of job.WithDockerEngineFactory/WithKubernetesEngineFactory/
// WithPodmanEngineFactory job.New actually calls, and this field is wired
// into all three identically, so a test fixture is never silently routed
// to a real runtime just because a step used `engine: podman` or
// `engine: kubernetes` instead of the (default) docker. nil (the default)
// leaves job.New's own defaults in place, which drive real container
// runtimes. Tests that need a hermetic run inject a fake engine here (see
// internal/localrun/runner_test.go).
EngineFactory func(context.Context) atom.Engine
}
Config controls local runner behaviour.
type Display ¶
Display renders task progress to a terminal.
func (*Display) RenderHeader ¶
RenderHeader prints a header line for a dev run.
func (*Display) RenderProgress ¶
func (d *Display) RenderProgress(tasks []TaskProgress)
RenderProgress prints a simple task status table.
type RunResult ¶
type RunResult struct {
RunID uuid.UUID
JobID uuid.UUID
Alias string
Status string
Error string
Tasks []TaskResult
}
RunResult captures the persisted outcome of a local run for harness assertions.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner executes a job definition against an ephemeral in-memory database and the local container runtime.
func (*Runner) RunWithResult ¶
RunWithResult parses, imports, executes, and returns the persisted run result.
type TaskProgress ¶
type TaskProgress struct {
Name string
Status string // pending, running, succeeded, failed, skipped
Duration time.Duration
Error string
}
TaskProgress represents the status of a single task during a local run.
type TaskResult ¶
type TaskResult struct {
TaskID uuid.UUID
Name string
// Partition is set for each materialized instance of a fanned step (one
// TaskResult per partition, Name rendered as "step[partition]"); empty for
// unfanned steps.
Partition string
Status string
Output map[string]string
SchemaViolations []pkgtask.SchemaViolation
LogText string
LogTruncated bool
CacheHit bool
Error string
}
TaskResult captures the persisted outcome of one task execution.