scheduler

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 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 GaiaScheduler

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

GaiaScheduler is a job scheduler for gaia pipeline runs.

type Plugin

type Plugin interface {
	// NewPlugin creates a new instance of plugin
	NewPlugin(ca security.CAAPI) Plugin

	// Init initializes the go-plugin client and generates a
	// new certificate pair for gaia and the plugin/pipeline.
	Init(command *exec.Cmd, logPath *string) error

	// Validate validates the plugin interface.
	Validate() error

	// Execute executes one job of a pipeline.
	Execute(j *gaia.Job) error

	// GetJobs returns all real jobs from the pipeline.
	GetJobs() ([]gaia.Job, error)

	// FlushLogs flushes the logs.
	FlushLogs() error

	// Close closes the connection and cleansup open file writes.
	Close()
}

Plugin represents the plugin implementation which is used during scheduling and execution.

type Scheduler

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

Scheduler represents the schuler object

func NewScheduler

func NewScheduler(store store.GaiaStore, pS Plugin, ca security.CAAPI, vault security.VaultAPI) *Scheduler

NewScheduler creates a new instance of Scheduler.

func (*Scheduler) Init

func (s *Scheduler) Init() error

Init initializes the scheduler.

func (*Scheduler) SchedulePipeline

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

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