dag

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: Apache-2.0 Imports: 6 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCandidateTasks added in v0.35.1

func GetCandidateTasks(g *Graph, doneTasks ...string) (sets.String, error)

GetCandidateTasks returns a set of names of PipelineTasks whose ancestors are all completed, given a list of finished doneTasks. If the specified doneTasks are invalid (i.e. if it is indicated that a Task is done, but the previous Tasks are not done), an error is returned.

Types

type Graph added in v0.9.0

type Graph struct {
	// Nodes represent map of PipelineTask name to Node in Pipeline Graph
	Nodes map[string]*Node
}

Graph represents the Pipeline Graph

func Build added in v0.9.0

func Build(tasks Tasks, deps map[string][]string) (*Graph, error)

Build returns a valid pipeline Graph. Returns error if the pipeline is invalid

type Node added in v0.9.0

type Node struct {
	// Key represent a unique name of the node in a graph
	Key string
	// Prev represent all the Previous task Nodes for the current Task
	Prev []*Node
	// Next represent all the Next task Nodes for the current Task
	Next []*Node
}

Node represents a Task in a pipeline.

type Task added in v0.9.0

type Task interface {
	HashKey() string
	Deps() []string
}

Task is an interface for all types that could be in a DAG

type Tasks added in v0.9.0

type Tasks interface {
	Items() []Task
}

Tasks is an interface for lists of types that could be in a DAG

Jump to

Keyboard shortcuts

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