gaiascheduler

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependencies

type Dependencies struct {
	Store store.GaiaStore
	DB    memdb.GaiaMemDB
	PS    plugin.Plugin
	CA    security.CAAPI
	Vault security.GaiaVault
}

Dependencies defines the dependencies of the scheduler service.

type GaiaScheduler

type GaiaScheduler interface {
	Init()
	SchedulePipeline(p *gaia.Pipeline, startedBy string, args []*gaia.Argument) (*gaia.PipelineRun, error)
	SetPipelineJobs(p *gaia.Pipeline) error
	StopPipelineRun(p *gaia.Pipeline, runID int) error
	GetFreeWorkers() int32
	CountScheduledRuns() int
}

GaiaScheduler is a job scheduler for gaia pipeline runs.

type Scheduler

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

Scheduler represents the schuler object

func NewScheduler

func NewScheduler(deps Dependencies) (*Scheduler, error)

NewScheduler creates a new Scheduler service.

func (*Scheduler) CountScheduledRuns

func (s *Scheduler) CountScheduledRuns() int

CountScheduledRuns returns the number of scheduled runs.

func (*Scheduler) GetFreeWorkers

func (s *Scheduler) GetFreeWorkers() int32

GetFreeWorkers returns the number of free workers.

func (*Scheduler) Init

func (s *Scheduler) Init()

Init initializes the scheduler.

func (*Scheduler) SchedulePipeline

func (s *Scheduler) SchedulePipeline(p *gaia.Pipeline, startedReason string, args []*gaia.Argument) (*gaia.PipelineRun, error)

SchedulePipeline schedules a pipeline. We create a new schedule object and save it in our store. The scheduler will later pick this up and will continue the work.

func (*Scheduler) SetPipelineJobs

func (s *Scheduler) SetPipelineJobs(p *gaia.Pipeline) error

SetPipelineJobs uses the plugin system to get all jobs from the given pipeline. This function is blocking and might take some time.

func (*Scheduler) StopPipelineRun

func (s *Scheduler) StopPipelineRun(p *gaia.Pipeline, runID int) error

StopPipelineRun will prematurely cancel a pipeline run by killing all of its jobs and running processes immediately.

Jump to

Keyboard shortcuts

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