controller

package
v0.0.0-...-9e48b22 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const Separator = "."

Separator used to construct job name.

View Source
const (
	// Number of retry when update execution spec or update execution status.
	UpdateRetries = 3
)

Variables

View Source
var DefaultRetry = wait.Backoff{
	Steps:    UpdateRetries,
	Duration: 10 * time.Millisecond,
	Factor:   1.0,
	Jitter:   0.1,
}

DefaultRetry is a default retry backoff settings when retrying API calls

View Source
var ExceedParallelismError = fmt.Errorf("running jobs have reached the execution parallelism limit")

Functions

func ConvertVars

func ConvertVars(vars []interface{}) []common.Var

func ValidateExecution

func ValidateExecution(execution *genev1alpha1.Execution) error

ValidateExecution accepts a execution and performs validation against it. If lint is specified as true, will skip some validations which is permissible during linting but not submission

Types

type ControllerParameters

type ControllerParameters struct {
	EventRecorder     record.EventRecorder
	KubeClient        clientset.Interface
	ExecutionClient   geneclientset.ExecutionsGetter
	JobInformer       batchinformers.JobInformer
	ExecutionInformer geneinformers.ExecutionInformer
}

ControllerParameters contains arguments for creation of a new ExecutionController.

type Event

type Event struct {
	Type EventType
	// job name, if Type is `NewAdded`, it can be not specified.
	Name string
	// Execution key
	Key string
}

type EventType

type EventType string
const (

	// newly start execute execution jobs
	NewAdded EventType = "NewAdded"
	// start execute jobs that depend on a job
	JobsAfter EventType = "JobsAfter"
)

type ExecutionController

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

func NewExecutionController

func NewExecutionController(p *ControllerParameters) *ExecutionController

func (*ExecutionController) Run

func (c *ExecutionController) Run(workers int, stopCh <-chan struct{})

Run the main goroutine responsible for watching and syncing executions.

type ExecutionJobController

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

func NewExecutionJobController

func NewExecutionJobController(
	kubeClient clientset.Interface,
	jobLister batchv1listers.JobLister,
	executionLister genelisters.ExecutionLister,
	eventQueue workqueue.RateLimitingInterface,
	execGraphBuilder *GraphBuilder,
	execUpdater ExecutionUpdater,
) *ExecutionJobController

func (*ExecutionJobController) Run

func (e *ExecutionJobController) Run(workers int, stopCh <-chan struct{})

type ExecutionUpdater

type ExecutionUpdater interface {
	// UpdateStatefulSetStatus sets the set's Status to status. Implementations are required to retry on conflicts,
	// but fail on other errors. If the returned error is nil set's Status has been successfully set to status.
	UpdateExecutionStatus(modified *genev1alpha1.Execution, original *genev1alpha1.Execution) error
	UpdateExecution(modified *genev1alpha1.Execution, original *genev1alpha1.Execution) error
}

ExecutionStatusUpdater is an interface used to update the ExecutionStatus associated with a Execution.

func NewExecutionStatusUpdater

func NewExecutionStatusUpdater(client geneclientset.ExecutionsGetter) ExecutionUpdater

NewExecutionStatusUpdater returns a ExecutionStatusUpdater that updates the Status of a Execution, using the supplied client and setLister.

type GraphBuilder

type GraphBuilder struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

GraphBuilder: based on the executions supplied by the informers, GraphBuilder updates jobs map, a struct that caches the execution uid to jobs

func NewGraphBuilder

func NewGraphBuilder() *GraphBuilder

func (*GraphBuilder) AddGraph

func (gb *GraphBuilder) AddGraph(execution *genev1alpha1.Execution)

func (*GraphBuilder) DeleteGraph

func (gb *GraphBuilder) DeleteGraph(key string)

func (*GraphBuilder) GetGraph

func (gb *GraphBuilder) GetGraph(key string) *graph.Graph

Jump to

Keyboard shortcuts

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