Documentation
¶
Overview ¶
Package executionruntime fences actual executor compatibility at lease entry and carries resolved demand through ordinary workflow reschedules. It does not change JobDB's lease selection or add a separate persistence store.
Index ¶
- type Runtime
- func (r *Runtime) CreateDelegation(ctx context.Context, parent jobdb.ExecutionLease, ...) (jobdb.RenewableExecutionLease, error)
- func (r *Runtime) GetJobLease(ctx context.Context, req jobdb.GetJobLeaseRequest) (jobdb.ExecutionLease, error)
- func (r *Runtime) PollWork(ctx context.Context, req jobdb.PollWorkRequest) ([]jobdb.ExecutionLease, error)
- func (r *Runtime) RunWithLease(ctx context.Context, supplied jobdb.ExecutionLease, ...) (jobworkflow.JobRunOutcome, error)
- func (r *Runtime) Stage(key jobdb.JobKey, demand execution.Demand)
- func (r *Runtime) WrapTaskWorker(worker jobworkflow.TaskWorker) jobworkflow.TaskWorker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runtime ¶
type Runtime struct {
jobdb.WorkflowRuntime
// Issuer translates recipe grants into task-scoped delegation requests.
Issuer permissions.Issuer
Allocation execution.Allocation
// contains filtered or unexported fields
}
func New ¶
func New(runtime jobdb.WorkflowRuntime, allocation execution.Allocation) *Runtime
func (*Runtime) CreateDelegation ¶ added in v0.0.93
func (r *Runtime) CreateDelegation(ctx context.Context, parent jobdb.ExecutionLease, req jobdb.CreateDelegationRequest) (jobdb.RenewableExecutionLease, error)
CreateDelegation forwards the optional runtime capability hidden by embedding WorkflowRuntime. Preserve the exact parent chosen by the engine and unwrap our admission wrapper so the remote runtime can export its original capability.
func (*Runtime) GetJobLease ¶
func (r *Runtime) GetJobLease(ctx context.Context, req jobdb.GetJobLeaseRequest) (jobdb.ExecutionLease, error)
func (*Runtime) PollWork ¶
func (r *Runtime) PollWork(ctx context.Context, req jobdb.PollWorkRequest) ([]jobdb.ExecutionLease, error)
func (*Runtime) RunWithLease ¶ added in v0.0.56
func (r *Runtime) RunWithLease(ctx context.Context, supplied jobdb.ExecutionLease, req jobworkflow.GetJobForRunRequest, listener jobworkflow.JobRunListener) (jobworkflow.JobRunOutcome, error)
RunWithLease executes exactly one supplied lease using JobDB's shared runner. It validates and renews before application work, and never acquires replacement work. Configure the recipe worker with this runtime's Stage and WrapTaskWorker, as for ordinary claim-and-run execution. Allocation checks use context Yield so acceptance is reported in the outcome. WorkerID should normally be left empty to retain the supplied lease owner.
func (*Runtime) WrapTaskWorker ¶
func (r *Runtime) WrapTaskWorker(worker jobworkflow.TaskWorker) jobworkflow.TaskWorker
WrapTaskWorker checks needs only when JobDB actually invokes a task worker, after looking up completed results. Use it for every worker in the workset.