gaia: github.com/gaia-pipeline/gaia/workers/scheduler Index | Files

package scheduler

import "github.com/gaia-pipeline/gaia/workers/scheduler"

Index

Package Files

create_cmd.go scheduler.go workload.go

type GaiaScheduler Uses

type GaiaScheduler interface {
    Init()
    SchedulePipeline(p *gaia.Pipeline, 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 Uses

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

Scheduler represents the schuler object

func NewScheduler Uses

func NewScheduler(store store.GaiaStore, db memdb.GaiaMemDB, pS plugin.Plugin, ca security.CAAPI, vault security.VaultAPI) (*Scheduler, error)

NewScheduler creates a new instance of Scheduler.

func (*Scheduler) CountScheduledRuns Uses

func (s *Scheduler) CountScheduledRuns() int

CountScheduledRuns returns the number of scheduled runs.

func (*Scheduler) GetFreeWorkers Uses

func (s *Scheduler) GetFreeWorkers() int32

GetFreeWorkers returns the number of free workers.

func (*Scheduler) Init Uses

func (s *Scheduler) Init()

Init initializes the scheduler.

func (*Scheduler) SchedulePipeline Uses

func (s *Scheduler) SchedulePipeline(p *gaia.Pipeline, 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 Uses

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 Uses

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.

Package scheduler imports 16 packages (graph) and is imported by 2 packages. Updated 2019-07-30. Refresh now. Tools for package owners.