scheduler

package
v0.75.0-no-limit Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

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.ResourceTypes, []db.BuildInput) (atc.Plan, error)
}

type BuildsDB

type BuildsDB interface {
	LeaseBuildScheduling(buildID int, interval time.Duration) (db.Lease, bool, error)
	ErrorBuild(buildID int, err error) error
	FinishBuild(int, db.Status) error

	GetBuildPreparation(buildID int) (db.BuildPreparation, bool, error)
}

type JobService

type JobService interface {
	CanBuildBeScheduled(logger lager.Logger, build db.Build, buildPrep db.BuildPreparation, versions *algorithm.VersionsDB) ([]db.BuildInput, bool, string, error)
}

func NewJobService

func NewJobService(config atc.JobConfig, jobServiceDB JobServiceDB, scanner Scanner) (JobService, error)

type JobServiceDB

type JobServiceDB interface {
	GetJob(job string) (db.SavedJob, error)
	GetRunningBuildsBySerialGroup(jobName string, serialGroups []string) ([]db.Build, error)
	GetNextPendingBuildBySerialGroup(jobName string, serialGroups []string) (db.Build, bool, error)
	UpdateBuildPreparation(prep db.BuildPreparation) error
	IsPaused() (bool, error)

	LoadVersionsDB() (*algorithm.VersionsDB, error)
	GetLatestInputVersions(versions *algorithm.VersionsDB, job string, inputs []config.JobInput) ([]db.BuildInput, bool, error)
	UseInputsForBuild(buildID int, inputs []db.BuildInput) error
}

type PipelineDB

type PipelineDB interface {
	JobServiceDB
	CreateJobBuild(job string) (db.Build, error)
	CreateJobBuildForCandidateInputs(job string) (db.Build, bool, error)
	UpdateBuildToScheduled(buildID int) (bool, error)

	GetJobBuildForInputs(job string, inputs []db.BuildInput) (db.Build, bool, error)
	GetNextPendingBuild(job string) (db.Build, bool, error)

	SaveResourceVersions(atc.ResourceConfig, []atc.Version) error
}

type Runner

type Runner struct {
	Logger lager.Logger

	DB db.PipelineDB

	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 {
	PipelineDB PipelineDB
	BuildsDB   BuildsDB
	Factory    BuildFactory
	Engine     engine.Engine
	Scanner    Scanner
}

func (*Scheduler) BuildLatestInputs

func (s *Scheduler) BuildLatestInputs(logger lager.Logger, versions *algorithm.VersionsDB, job atc.JobConfig, resources atc.ResourceConfigs, resourceTypes atc.ResourceTypes) error

func (*Scheduler) ScheduleAndResumePendingBuild

func (s *Scheduler) ScheduleAndResumePendingBuild(
	logger lager.Logger,
	versions *algorithm.VersionsDB,
	build db.Build,
	job atc.JobConfig,
	resources atc.ResourceConfigs,
	resourceTypes atc.ResourceTypes,
	jobService JobService,
) engine.Build

func (*Scheduler) TriggerImmediately

func (s *Scheduler) TriggerImmediately(logger lager.Logger, job atc.JobConfig, resources atc.ResourceConfigs, resourceTypes atc.ResourceTypes) (db.Build, Waiter, error)

func (*Scheduler) TryNextPendingBuild

func (s *Scheduler) TryNextPendingBuild(logger lager.Logger, versions *algorithm.VersionsDB, job atc.JobConfig, resources atc.ResourceConfigs, resourceTypes atc.ResourceTypes) Waiter

type Waiter

type Waiter interface {
	Wait()
}

Directories

Path Synopsis
fakes
This file was generated by counterfeiter
This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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