Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FailResult ¶
func FailResult(err error) (*model.RunCommandResult, error)
func WriteJobResults ¶
func WriteJobResults(resultsDir string, stdout, stderr io.Reader, exitcode int, err error) (*model.RunCommandResult, error)
WriteJobResults produces files and a model.RunCommandResult in the standard format, including truncating the contents of both where necessary to fit within system-defined limits.
It will consume only the bytes from the passed io.Readers that it needs to correctly form job outputs. Once the command returns, the readers can close.
Types ¶
type Executor ¶
type Executor interface { model.Providable // used to filter and select jobs // tells us if the storage resource is "close" i.e. cheap to access HasStorageLocally(context.Context, model.StorageSpec) (bool, error) // A BidStrategy that should return a positive response if the executor // could run the job or a negative response otherwise. GetBidStrategy(context.Context) (bidstrategy.BidStrategy, error) // tells us how much storage the given volume would consume // which we then use to calculate if there is capacity // alongside cpu & memory usage GetVolumeSize(context.Context, model.StorageSpec) (uint64, error) // GetOutputStream retrieves a muxed stream from the executor GetOutputStream(ctx context.Context, executionID string, withHistory bool, follow bool) (io.ReadCloser, error) // run the given job - it's expected that we have already prepared the job // this will return a local filesystem path to the jobs results Run( ctx context.Context, executionID string, job model.Job, resultsDir string, ) (*model.RunCommandResult, error) }
Executor represents an execution provider, which can execute jobs on some kind of backend, such as a docker daemon.
Click to show internal directories.
Click to hide internal directories.