coordinator

package
Version: v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinator

type Coordinator struct {

	// Stage related to this pod.
	Stage *v1alpha1.Stage
	// Wfr represents the WorkflowRun which triggered this pod.
	Wfr *v1alpha1.WorkflowRun
	// OutputResources represents output resources the related stage configured.
	OutputResources []*v1alpha1.Resource
	// contains filtered or unexported fields
}

Coordinator is a struct which contains infomations will be used in workflow sidecar named coordinator.

func NewCoordinator

func NewCoordinator(ctx context.Context, client k8s.Interface) (*Coordinator, error)

NewCoordinator create a coordinator instance.

func (*Coordinator) CollectArtifacts

func (co *Coordinator) CollectArtifacts() error

CollectArtifacts collects workload artifacts.

func (*Coordinator) CollectExecutionResults added in v0.9.6

func (co *Coordinator) CollectExecutionResults() error

CollectExecutionResults collects execution results (key-values) and store them in pod's annotation

func (*Coordinator) CollectLogs

func (co *Coordinator) CollectLogs() error

CollectLogs collects all containers' logs.

func (*Coordinator) GetExitCodes

func (co *Coordinator) GetExitCodes(selectors ...common.ContainerSelector) (map[string]int32, error)

GetExitCodes gets exit codes of containers passed the selector

func (*Coordinator) MarkLogEOF added in v0.9.8

func (co *Coordinator) MarkLogEOF() error

MarkLogEOF marks end of stage logs.

func (*Coordinator) NotifyResolvers

func (co *Coordinator) NotifyResolvers() error

NotifyResolvers create a file to notify output resolvers to start working.

func (*Coordinator) StageSuccess

func (co *Coordinator) StageSuccess() bool

StageSuccess checks if the workload and resolver containers are succeeded.

func (*Coordinator) WaitAllOthersTerminate

func (co *Coordinator) WaitAllOthersTerminate() error

WaitAllOthersTerminate waits all containers except for the coordinator container itself to become Terminated status.

func (*Coordinator) WaitRunning

func (co *Coordinator) WaitRunning() error

WaitRunning waits all containers to start run.

func (*Coordinator) WaitWorkloadTerminate

func (co *Coordinator) WaitWorkloadTerminate() error

WaitWorkloadTerminate waits all workload containers to be Terminated status.

func (*Coordinator) WorkLoadSuccess

func (co *Coordinator) WorkLoadSuccess() bool

WorkLoadSuccess checks if the workload containers are succeeded.

type RuntimeExecutor

type RuntimeExecutor interface {
	// WaitContainers waits selected containers to state.
	WaitContainers(state common.ContainerState, selectors ...common.ContainerSelector) error
	// CollectLog collects container logs to cyclone server.
	CollectLog(container, wrorkflowrun, stage string, close <-chan struct{}) error
	// MarkLogEOF marks end of stage logs.
	MarkLogEOF(workflowrun, stage string, close <-chan struct{}) error
	// CopyFromContainer copy a file or directory from container:path to dst.
	CopyFromContainer(container, path, dst string) error
	// GetPod get the stage related pod.
	GetPod() (*core_v1.Pod, error)
	// SetResults set results (key-values) to the pod, workflow controller would sync this result
	// to WorkflowRun status.
	SetResults(values []v1alpha1.KeyValue) error
}

RuntimeExecutor is an interface defined some methods to communicate with k8s container runtime.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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