Documentation
¶
Index ¶
- Variables
- func CancelRunContexts(runID uuid.UUID) int
- func EnumerateLogicalDates(schedule cron.Schedule, start, end time.Time, loc *time.Location) []time.Time
- func FilterDates(store *backfillstore.Store, jobID uuid.UUID, dates []time.Time, ...) ([]time.Time, error)
- func RegisterRunCancel(parent context.Context, runID uuid.UUID) (context.Context, func())
- func RunBackfill(ctx context.Context, b *models.Backfill, j *models.Job, schedule cron.Schedule, ...)
- func SubscribeRunCancellations(ctx context.Context, bus event.Bus)
- type Job
- type JobOption
- func WithAtomPollInterval(interval time.Duration) JobOption
- func WithAtomServiceFactory(factory func(context.Context) asvc.Atom) JobOption
- func WithDispatchRunCallbacks(dispatch func(context.Context, uuid.UUID, uuid.UUID, error) error) JobOption
- func WithDockerEngineFactory(factory func(context.Context) atom.Engine) JobOption
- func WithEnvVariables(variables func() env.Environment) JobOption
- func WithKubernetesEngineFactory(factory func(context.Context) atom.Engine) JobOption
- func WithParams(params map[string]string) JobOption
- func WithPodmanEngineFactory(factory func(context.Context) atom.Engine) JobOption
- func WithPriorityOverride(priority string) JobOption
- func WithRunStoreFactory(factory func() *run.Store) JobOption
- func WithSecretResolver(resolver secret.Resolver) JobOption
- func WithTaskEdgeServiceFactory(factory func(context.Context) taskedge.TaskEdge) JobOption
- func WithTaskServiceFactory(factory func(context.Context) task.Task) JobOption
- func WithTriggerID(id *uuid.UUID) JobOption
Constants ¶
This section is empty.
Variables ¶
var ErrLocalQuarantinedReplayUnsupported = errors.New("replay requires the descriptor-aware executor")
ErrLocalQuarantinedReplayUnsupported is returned when a quarantined replay reaches the in-process executor, which is not descriptor-aware.
Functions ¶
func CancelRunContexts ¶
CancelRunContexts cancels every in-process run context registered for runID and reports how many were cancelled.
func EnumerateLogicalDates ¶
func EnumerateLogicalDates(schedule cron.Schedule, start, end time.Time, loc *time.Location) []time.Time
EnumerateLogicalDates returns all cron fire times in [start, end). loc sets the timezone used when computing schedule boundaries; pass time.UTC when the trigger has no timezone configured.
func FilterDates ¶
func FilterDates(store *backfillstore.Store, jobID uuid.UUID, dates []time.Time, reprocess string) ([]time.Time, error)
FilterDates filters logical dates based on the reprocess policy:
"none" — skip dates that have any existing run "failed" — skip dates whose latest run succeeded "all" — keep all dates
func RegisterRunCancel ¶
RegisterRunCancel derives the cancellable context a detached run must execute under. EVERY `run.WithContext(context.Background(), runID)` kickoff site wraps its parent with this call; missing one leaves that entry point's runs uncancellable, which is the bug in the first place.
ctx, release := job.RegisterRunCancel(context.Background(), r.ID) defer release() job.New(...).Run(runstorage.WithContext(ctx, r.ID))
func RunBackfill ¶
func RunBackfill( ctx context.Context, b *models.Backfill, j *models.Job, schedule cron.Schedule, loc *time.Location, )
RunBackfill executes a backfill by enumerating logical dates, filtering by the reprocess policy, and running each date through the standard job executor with a semaphore controlling max concurrency.
It honours ctx cancellation: when cancelled, no new runs are started but any in-flight runs are allowed to finish.
func SubscribeRunCancellations ¶
SubscribeRunCancellations wires the registry to the in-process event bus: TypeRunCancelled — published by both run.Store.CancelRun and the concurrency `replace` admission, which share cancelRunTx — cancels the run's registered contexts, and the local executor's taskCtx.Done() branch then force-stops the container (internal/job/job.go).
It returns as soon as the subscription is established; the pump runs until ctx is done. A bus that refuses the subscription is logged and ignored rather than fatal: a server that cannot cancel containers is still a server that runs jobs.
Types ¶
type JobOption ¶
type JobOption func(*job)
JobOption configures a job before execution.
func WithAtomPollInterval ¶
WithAtomPollInterval overrides the polling interval for atom completion checks.
func WithAtomServiceFactory ¶
WithAtomServiceFactory overrides the atom service used to look up atoms.
func WithDispatchRunCallbacks ¶
func WithDispatchRunCallbacks(dispatch func(context.Context, uuid.UUID, uuid.UUID, error) error) JobOption
WithDispatchRunCallbacks overrides the callback dispatch function.
func WithDockerEngineFactory ¶
WithDockerEngineFactory overrides the Docker engine constructor.
func WithEnvVariables ¶
func WithEnvVariables(variables func() env.Environment) JobOption
WithEnvVariables overrides the environment configuration.
func WithKubernetesEngineFactory ¶
WithKubernetesEngineFactory overrides the Kubernetes engine constructor.
func WithParams ¶
WithParams attaches run parameters to the job. Parameters are injected into each task's environment as CAESIUM_PARAM_<KEY>=<VALUE> (KEY uppercased).
func WithPodmanEngineFactory ¶
WithPodmanEngineFactory overrides the Podman engine constructor.
func WithPriorityOverride ¶
func WithRunStoreFactory ¶
WithRunStoreFactory overrides the run store used for execution state.
func WithSecretResolver ¶
WithSecretResolver configures secret:// resolution for step environment values. If omitted, Run builds the resolver from the processed environment.
func WithTaskEdgeServiceFactory ¶
WithTaskEdgeServiceFactory overrides the task edge service used to look up edges.
func WithTaskServiceFactory ¶
WithTaskServiceFactory overrides the task service used to look up tasks.