executor

package
v0.3.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

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)
	//    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)

	// 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
	RunShard(
		ctx context.Context,
		shard model.JobShard,
		resultsDir string,
	) (*model.RunCommandResult, error)
}

Executor represents an execution provider, which can execute jobs on some kind of backend, such as a docker daemon.

type ExecutorProvider

type ExecutorProvider interface {
	model.Provider[model.Engine, Executor]
}

Returns a executor for the given engine type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL