controller

package
v1.2.2-0...-a7e234e Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagPrefix          = "nomad-pipeline"
	TagEnabled         = TagPrefix + ".enabled"
	TagCount           = TagPrefix + ".count"
	TagDependencies    = TagPrefix + ".dependencies"
	TagDynamicMemoryMB = TagPrefix + ".dynamic-memory-mb"
	TagDynamicTasks    = TagPrefix + ".dynamic-tasks"
	TagLeader          = TagPrefix + ".leader"
	TagNext            = TagPrefix + ".next"
	TagRoot            = TagPrefix + ".root"

	// internal tags, not  meant to be set by user
	TagInternalPrefix = TagPrefix + ".internal"
	TagParentTask     = TagInternalPrefix + ".parent-task"
	TagParentPipeline = TagInternalPrefix + ".parent-pipeline"
)

Variables

This section is empty.

Functions

func TgDone

func TgDone(allocs []*nomad.AllocationListStub, groups []string, success bool) bool

Types

type Config

type Config struct {
}

type PipelineController

type PipelineController struct {
	JobID     string
	GroupName string
	TaskName  string
	AllocID   string
	Job       *nomad.Job
	Nomad     *nomad.Client
	JobsAPI   *nomad.Jobs
	AllocsAPI *nomad.Allocations
	Config    *Config
	Image     string
}

func NewPipelineController

func NewPipelineController(cPath string) *PipelineController

func (*PipelineController) Init

func (pc *PipelineController) Init() bool

func (*PipelineController) Next

func (pc *PipelineController) Next(groups []string, dynTasks string) bool

func (*PipelineController) ProcessTaskGroups

func (pc *PipelineController) ProcessTaskGroups(filters ...map[string]string) ([]string, error)

func (*PipelineController) UpdateJob

func (pc *PipelineController) UpdateJob() error

func (*PipelineController) Wait

func (pc *PipelineController) Wait(groups []string)

type Task

type Task struct {
	Name         string
	Next         []string
	Dependencies []string
}

type TaskGroups

type TaskGroups []nomad.TaskGroup

type Tasks

type Tasks []Task

func (Tasks) LookupTask

func (ts Tasks) LookupTask(name string) *Task

Jump to

Keyboard shortcuts

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