scheduler

package
v4.2.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: Apache-2.0 Imports: 12 Imported by: 202

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildFactory

type BuildFactory interface {
	Create(atc.JobConfig, atc.ResourceConfigs, atc.VersionedResourceTypes, []db.BuildInput) (atc.Plan, error)
}

type BuildScheduler

type BuildScheduler interface {
	Schedule(
		logger lager.Logger,
		versions *algorithm.VersionsDB,
		jobs []db.Job,
		resources db.Resources,
		resourceTypes atc.VersionedResourceTypes,
	) (map[string]time.Duration, error)

	TriggerImmediately(
		logger lager.Logger,
		job db.Job,
		resources db.Resources,
		resourceTypes atc.VersionedResourceTypes,
	) (db.Build, Waiter, error)

	SaveNextInputMapping(logger lager.Logger, job db.Job, resource db.Resources) error
}

type BuildStarter

type BuildStarter interface {
	TryStartPendingBuildsForJob(
		logger lager.Logger,
		job db.Job,
		resources db.Resources,
		resourceTypes atc.VersionedResourceTypes,
		nextPendingBuilds []db.Build,
	) error
}

func NewBuildStarter

func NewBuildStarter(
	pipeline db.Pipeline,
	maxInFlightUpdater maxinflight.Updater,
	factory BuildFactory,
	scanner Scanner,
	inputMapper inputmapper.InputMapper,
	execEngine engine.Engine,
) BuildStarter

type Runner

type Runner struct {
	Logger    lager.Logger
	Pipeline  db.Pipeline
	Scheduler BuildScheduler
	Noop      bool
	Interval  time.Duration
}

func (*Runner) Run

func (runner *Runner) Run(signals <-chan os.Signal, ready chan<- struct{}) error

type Scanner

type Scanner interface {
	Scan(lager.Logger, string) error
}

type Scheduler

type Scheduler struct {
	Pipeline     db.Pipeline
	InputMapper  inputmapper.InputMapper
	BuildStarter BuildStarter
	Scanner      Scanner
}

func (*Scheduler) SaveNextInputMapping

func (s *Scheduler) SaveNextInputMapping(logger lager.Logger, job db.Job, resources db.Resources) error

func (*Scheduler) Schedule

func (s *Scheduler) Schedule(
	logger lager.Logger,
	versions *algorithm.VersionsDB,
	jobs []db.Job,
	resources db.Resources,
	resourceTypes atc.VersionedResourceTypes,
) (map[string]time.Duration, error)

func (*Scheduler) TriggerImmediately

func (s *Scheduler) TriggerImmediately(
	logger lager.Logger,
	job db.Job,
	resources db.Resources,
	resourceTypes atc.VersionedResourceTypes,
) (db.Build, Waiter, error)

type Waiter

type Waiter interface {
	Wait()
}

Directories

Path Synopsis
factoryfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
inputconfig/inputconfigfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
inputmapperfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
maxinflightfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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