Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrLocalExecutionAlreadyExists = errors.New("local execution already exists") ErrProcAcquisitionFailed = errors.New("failed to acquire process handle") )
Functions ¶
This section is empty.
Types ¶
type LocalAttemptBuilder ¶
LocalAttemptBuilder creates or resolves the attempt that a local execution will own.
type LocalPreparation ¶
type LocalPreparation struct {
Attempt dagrun.Attempt
Proc proc.ProcHandle
}
LocalPreparation is the successfully prepared local execution ownership.
func PrepareLocalExecution ¶
func PrepareLocalExecution(ctx context.Context, req LocalRequest) (*LocalPreparation, error)
PrepareLocalExecution creates or resolves the execution attempt, acquires the local process heartbeat, and records a failed status if heartbeat acquisition fails after an attempt was prepared.
type LocalProcRepository ¶ added in v2.14.0
type LocalProcRepository interface {
WithLock(ctx context.Context, groupName string, fn func() error) error
Acquire(ctx context.Context, groupName string, meta proc.ProcMeta) (proc.ProcHandle, error)
}
LocalProcRepository is the process-repository surface needed to claim local execution ownership.
type LocalRequest ¶
type LocalRequest struct {
ProcRepository LocalProcRepository
DAG *ir.DAG
DAGRunID string
DefinitionID string
Root ir.DAGRunRef
Parent ir.DAGRunRef
TriggerType ir.TriggerType
TriggerActor string
ScheduleTime string
ProfileName string
LogBaseDir string
ArtifactBaseDir string
BuildAttempt LocalAttemptBuilder
}
LocalRequest describes local DAG-run intake before execution starts.
type QueueRequest ¶
type QueueRequest struct {
DAGRunRepository *persis.DAGRunRepository
QueueStore queue.QueueStore
DAG *ir.DAG
DAGRunID string
QueueName string
LogBaseDir string
ArtifactBaseDir string
Root ir.DAGRunRef
Parent ir.DAGRunRef
TriggerType ir.TriggerType
TriggerActor string
ParallelItem string
ScheduleTime string
ProfileName string
DefinitionID string
NoReuse bool
AttemptOptions persis.DAGRunCreateAttemptOptions
// ProceedOnStatusCloseErr preserves legacy CLI enqueue behavior: publish
// the queue item after best-effort close so readers can see the queued status.
ProceedOnStatusCloseErr bool
Now func() time.Time
}
QueueRequest describes a DAG-run intake operation that persists a queued attempt before publishing the queue item.
type QueuedRun ¶
type QueuedRun struct {
DAGRun ir.DAGRunRef
Attempt dagrun.Attempt
Status ir.DAGRunStatus
QueueName string
LogFile string
ArtifactDir string
// StatusCloseErr is set only when ProceedOnStatusCloseErr allowed intake
// to continue after the status attempt close failed.
StatusCloseErr error
}
QueuedRun is the result of successful DAG-run queue intake.
func EnqueueRun ¶
func EnqueueRun(ctx context.Context, req QueueRequest) (*QueuedRun, error)
EnqueueRun creates a queued DAG-run attempt, writes the queued status, closes the attempt, then publishes the queue item. If any post-create step fails, the created attempt is rolled back.