Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster interface { pool.Pool // Allocate reserves an alloc of at least min, and at most max resources. // The cluster may scale elastically in order to meet this demand. // Labels are passed down to the underlying pool. // Progress is reported to the provided status object. Allocate(ctx context.Context, req reflow.Requirements, labels pool.Labels) (pool.Alloc, error) }
Cluster is a kind of pool.Pool that also allows the user to directly reserve an alloc. This way, the cluster can be responsive to demand.
type Runner ¶
type Runner struct { // State contains the state of the run. The user can serialize // this in order to resume runs. State reflow.EvalConfig // Cluster is the main cluster from which Allocs are allocated. Cluster Cluster // ClusterAux defines the cluster from which capacity // for auxilliary workers is allocated. If nil, Cluster is used // instead. ClusterAux Cluster // Flow is the flow to be evaluated. Flow *reflow.Flow // Type is the type of output. When Type is nil, it is taken to be // (legacy) reflow.Fileset. Type *types.T // Transferer is the transfer manager used for node-to-node data // transfers. Transferer reflow.Transferer // Retain is the amount of time the primary alloc should be retained // after failure. Retain time.Duration // Alloc is the primary alloc in which the flow is evaluated. Alloc pool.Alloc // Labels are the set of labels affiliated with this run. Labels pool.Labels }
A Runner is responsible for evaluating a reflow.Flow on a cluster. Runners also launch and maintain auxilliary work-stealing allocs, and manages data transfer and failure handling between the primary evaluation alloc and the auxilliary workers.
TODO(marius): introduce a "stealer-only" mode where there is no primary alloc, but with a shared repository (e.g., S3) attached to the Eval.
type State ¶
type State struct { // ID is this run's global ID. ID digest.Digest // Program stores the reflow program name. Program string // Params is the run parameters Params map[string]string // Args stores the run arguments Args []string // Phase holds the current phase of the run. Phase Phase // AllocID is the full URI for the run's alloc. AllocID string // AllocInspect is the alloc's inspect output. AllocInspect pool.AllocInspect // Value contains the result of the evaluation, // rendered as a string. // TODO(marius): serialize the value into JSON. Result string // Err contains runtime errors. Err *errors.Error // NumTries is the number of evaluation attempts // that have been made. NumTries int // LastTry is the timestamp of the last evaluation attempt. LastTry time.Time // Created is the time of the run's creation. Created time.Time // Completion is the time of the run's completion. Completion time.Time // TotalResources stores the total amount of resources used // by this run. Note that the resources are in resource-minutes. TotalResources reflow.Resources }
State contains the full state of a run. A State can be serialized and later recovered in order to resume a run.
type StaticCluster ¶
A StaticCluster implements a pass-through Cluster on top of a pool.Pool.
type Stealer ¶
Stealer is a work-stealer. It periodically queries additional resource requirements from an Eval, attempts to allocate additional allocs from a cluster, and then launches workers that steal work from the same Eval. Work stealers free their allocs when there is no more work to be stolen.
type TracingCluster ¶
type TracingCluster struct {
Cluster
}
TracingCluster is a cluster that traces the actions of an underlying cluster manager.