handler

package
v1.1.22 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PhaseInfoUndefined = PhaseInfo{/* contains filtered or unexported fields */}

Functions

This section is empty.

Types

type BranchNodeInfo added in v0.1.13

type BranchNodeInfo struct {
}

type BranchNodeState added in v0.1.13

type BranchNodeState struct {
	FinalizedNodeID *v1alpha1.NodeID
	Phase           v1alpha1.BranchNodePhase
}

type DynamicNodeInfo added in v0.1.13

type DynamicNodeInfo struct {
}

type DynamicNodePhase added in v0.1.13

type DynamicNodePhase uint8

type DynamicNodeState added in v0.1.13

type DynamicNodeState struct {
	Phase  v1alpha1.DynamicNodePhase
	Reason string
	Error  *core.ExecutionError
}

type EPhase added in v0.1.13

type EPhase uint8
const (
	EPhaseUndefined EPhase = iota
	EPhaseNotReady
	EPhaseQueued
	EPhaseRunning
	EPhaseSkip
	EPhaseFailed
	EPhaseRetryableFailure
	EPhaseSuccess
	EPhaseTimedout
	EPhaseFailing
	EPhaseDynamicRunning
	EPhaseRecovered
)

func EPhaseString added in v0.7.0

func EPhaseString(s string) (EPhase, error)

EPhaseString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func EPhaseValues added in v0.7.0

func EPhaseValues() []EPhase

EPhaseValues returns all values of the enum

func (EPhase) IsAEPhase added in v0.7.0

func (i EPhase) IsAEPhase() bool

IsAEPhase returns "true" if the value is listed in the enum definition. "false" otherwise

func (EPhase) IsTerminal added in v0.1.13

func (p EPhase) IsTerminal() bool

func (EPhase) String added in v0.1.13

func (i EPhase) String() string

type ExecutionInfo added in v0.1.13

type ExecutionInfo struct {
	DynamicNodeInfo  *DynamicNodeInfo
	WorkflowNodeInfo *WorkflowNodeInfo
	BranchNodeInfo   *BranchNodeInfo
	OutputInfo       *OutputInfo
	TaskNodeInfo     *TaskNodeInfo
}

type Node added in v0.1.13

type Node interface {
	// Method to indicate that finalize is required for this handler
	FinalizeRequired() bool

	// Setup should be called, before invoking any other methods of this handler in a single thread context
	Setup(ctx context.Context, setupContext SetupContext) error

	// Core method that should handle this node
	Handle(ctx context.Context, executionContext NodeExecutionContext) (Transition, error)

	// This method should be invoked to indicate the node needs to be aborted.
	Abort(ctx context.Context, executionContext NodeExecutionContext, reason string) error

	// This method is always called before completing the node, if FinalizeRequired returns true.
	// It is guaranteed that Handle -> (happens before) -> Finalize. Abort -> finalize may be repeated multiple times
	Finalize(ctx context.Context, executionContext NodeExecutionContext) error
}

Interface that should be implemented for a node type.

type NodeExecutionContext added in v0.1.13

type NodeExecutionContext interface {
	// This path is never read by propeller, but allows using some container or prefix in a specific container for all output from tasks
	// Sandboxes provide exactly once execution semantics and only the successful sandbox wins. Ideally a sandbox should be a path that is
	// available to the task at High Bandwidth (for example the base path of a sharded s3 bucket.
	// This with a prefix based sharded strategy, could improve the throughput from S3 manifold)
	RawOutputPrefix() storage.DataReference

	// Sharding strategy for the output data for this node execution.
	OutputShardSelector() ioutils.ShardSelector

	DataStore() *storage.DataStore
	InputReader() io.InputReader
	EventsRecorder() events.TaskEventRecorder
	NodeID() v1alpha1.NodeID
	Node() v1alpha1.ExecutableNode
	CurrentAttempt() uint32
	TaskReader() TaskReader

	NodeStateReader() NodeStateReader
	NodeStateWriter() NodeStateWriter

	NodeExecutionMetadata() NodeExecutionMetadata
	MaxDatasetSizeBytes() int64

	EnqueueOwnerFunc() func() error

	ContextualNodeLookup() executors.NodeLookup
	ExecutionContext() executors.ExecutionContext
	// TODO We should not need to pass NodeStatus, we probably only need it for DataDir, which should actually be sent using an OutputWriter interface
	// Deprecated
	NodeStatus() v1alpha1.ExecutableNodeStatus
}

type NodeExecutionMetadata added in v0.1.13

type NodeExecutionMetadata interface {
	GetOwnerID() types.NamespacedName
	GetNodeExecutionID() *core.NodeExecutionIdentifier
	GetNamespace() string
	GetOwnerReference() v1.OwnerReference
	GetLabels() map[string]string
	GetAnnotations() map[string]string
	GetK8sServiceAccount() string
	GetSecurityContext() core.SecurityContext
	IsInterruptible() bool
	GetInterruptibleFailureThreshold() uint32
}

type NodeStateReader added in v0.1.13

type NodeStateReader interface {
	GetTaskNodeState() TaskNodeState
	GetBranchNode() BranchNodeState
	GetDynamicNodeState() DynamicNodeState
	GetWorkflowNodeState() WorkflowNodeState
}

type NodeStateWriter added in v0.1.13

type NodeStateWriter interface {
	PutTaskNodeState(s TaskNodeState) error
	PutBranchNode(s BranchNodeState) error
	PutDynamicNodeState(s DynamicNodeState) error
	PutWorkflowNodeState(s WorkflowNodeState) error
}

type OutputInfo added in v0.1.13

type OutputInfo struct {
	OutputURI storage.DataReference
	DeckURI   *storage.DataReference
}

type PhaseInfo added in v0.1.13

type PhaseInfo struct {
	// contains filtered or unexported fields
}

func PhaseInfoDynamicRunning added in v0.10.5

func PhaseInfoDynamicRunning(info *ExecutionInfo) PhaseInfo

func PhaseInfoFailingErr added in v0.7.0

func PhaseInfoFailingErr(err *core.ExecutionError, info *ExecutionInfo) PhaseInfo

func PhaseInfoFailure added in v0.1.13

func PhaseInfoFailure(kind core.ExecutionError_ErrorKind, code, reason string, info *ExecutionInfo) PhaseInfo

func PhaseInfoFailureErr added in v0.1.13

func PhaseInfoFailureErr(err *core.ExecutionError, info *ExecutionInfo) PhaseInfo

func PhaseInfoNotReady added in v0.1.13

func PhaseInfoNotReady(reason string) PhaseInfo

func PhaseInfoQueued added in v0.1.13

func PhaseInfoQueued(reason string) PhaseInfo

func PhaseInfoRecovered added in v0.13.3

func PhaseInfoRecovered(info *ExecutionInfo) PhaseInfo

func PhaseInfoRetryableFailure added in v0.1.13

func PhaseInfoRetryableFailure(kind core.ExecutionError_ErrorKind, code, reason string, info *ExecutionInfo) PhaseInfo

func PhaseInfoRetryableFailureErr added in v0.1.13

func PhaseInfoRetryableFailureErr(err *core.ExecutionError, info *ExecutionInfo) PhaseInfo

func PhaseInfoRunning added in v0.1.13

func PhaseInfoRunning(info *ExecutionInfo) PhaseInfo

func PhaseInfoSkip added in v0.1.13

func PhaseInfoSkip(info *ExecutionInfo, reason string) PhaseInfo

func PhaseInfoSuccess added in v0.1.13

func PhaseInfoSuccess(info *ExecutionInfo) PhaseInfo

func PhaseInfoTimedOut added in v0.1.17

func PhaseInfoTimedOut(info *ExecutionInfo, reason string) PhaseInfo

func (PhaseInfo) GetErr added in v0.1.13

func (p PhaseInfo) GetErr() *core.ExecutionError

func (PhaseInfo) GetInfo added in v0.1.13

func (p PhaseInfo) GetInfo() *ExecutionInfo

func (PhaseInfo) GetOccurredAt added in v0.1.13

func (p PhaseInfo) GetOccurredAt() time.Time

func (PhaseInfo) GetPhase added in v0.1.13

func (p PhaseInfo) GetPhase() EPhase

func (PhaseInfo) GetReason added in v0.1.13

func (p PhaseInfo) GetReason() string

func (PhaseInfo) WithInfo added in v0.7.0

func (p PhaseInfo) WithInfo(i *ExecutionInfo) PhaseInfo

type SetupContext added in v0.1.13

type SetupContext interface {
	EnqueueOwner() func(string)
	OwnerKind() string
	MetricsScope() promutils.Scope
}

type TaskNodeInfo added in v0.1.13

type TaskNodeInfo struct {
	TaskNodeMetadata *event.TaskNodeMetadata
}

Carries any information that should be sent as part of NodeEvents

type TaskNodeState added in v0.1.13

type TaskNodeState struct {
	PluginPhase        pluginCore.Phase
	PluginPhaseVersion uint32
	PluginState        []byte
	PluginStateVersion uint32
	BarrierClockTick   uint32
	LastPhaseUpdatedAt time.Time
}

type TaskReader added in v0.1.13

type TaskReader interface {
	Read(ctx context.Context) (*core.TaskTemplate, error)
	GetTaskType() v1alpha1.TaskType
	GetTaskID() *core.Identifier
}

type Transition added in v0.1.13

type Transition struct {
	// contains filtered or unexported fields
}

func DoTransition added in v0.1.13

func DoTransition(ttype TransitionType, info PhaseInfo) Transition

func (Transition) Info added in v0.1.13

func (t Transition) Info() PhaseInfo

func (Transition) Type added in v0.1.13

func (t Transition) Type() TransitionType

func (Transition) WithInfo added in v0.1.13

func (t Transition) WithInfo(p PhaseInfo) Transition

type TransitionType added in v0.1.13

type TransitionType int
const (
	TransitionTypeEphemeral TransitionType = iota
	TransitionTypeBarrier
)

type WorkflowNodeInfo added in v0.1.13

type WorkflowNodeInfo struct {
	LaunchedWorkflowID *core.WorkflowExecutionIdentifier
}

type WorkflowNodeState added in v0.1.13

type WorkflowNodeState struct {
	Phase v1alpha1.WorkflowNodePhase
	Error *core.ExecutionError
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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