Documentation
¶
Overview ¶
Package staging wires the artifact plane into job execution.
It lives apart from the artifact package to break an import cycle: the middleware signature takes a *job.Job, and job imports artifact for its input declarations.
The middleware stages a job's declared inputs before the handler runs, puts an artifact.Accessor in the context, and releases every cache lease afterwards — whether the handler returns, fails, or panics.
Running staging as middleware rather than inside the executor is also the right seam for out-of-process execution: staging happens outside the boundary, so a sandboxed handler receives a directory of files rather than storage credentials.
Index ¶
- func LinkInputs(ctx context.Context, svc *artifact.Service, j *job.Job, bindings Bindings) error
- func Middleware(svc *artifact.Service, c *cache.Cache, lookup SpecLookup, opts ...Option) middleware.Middleware
- func SetBindings(j *job.Job, b Bindings) error
- func TotalBoundSize(b Bindings) int64
- func Validate(specs []artifact.InputSpec, b Bindings) error
- type Bindings
- type Option
- type Options
- type SpecLookup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LinkInputs ¶
LinkInputs records which artifacts a job consumed, so lineage survives after the job finishes.
func Middleware ¶
func Middleware( svc *artifact.Service, c *cache.Cache, lookup SpecLookup, opts ...Option, ) middleware.Middleware
Middleware stages a job's declared inputs, exposes them through an artifact.Accessor on the context, and releases every cache lease when the handler returns.
It slots into the existing middleware chain, so nothing in the executor changes. That also makes it the natural boundary for out-of-process execution later: staging runs outside, and the handler sees files rather than credentials.
func SetBindings ¶
SetBindings encodes bindings onto a job.
They travel in their own field rather than inside Payload because the payload is opaque to the engine: refs buried there would be invisible to the scheduler, which needs the total input size before it picks a worker, and to this middleware, which needs them before the handler runs.
func TotalBoundSize ¶
TotalBoundSize sums the sizes of the bound artifacts, which is the figure the scheduler and the staging budget both care about.
Types ¶
type SpecLookup ¶
SpecLookup resolves a job name to its declared inputs. The engine supplies one backed by the job registry.