scheduler

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 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 added in v0.2.1

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

GaiaScheduler is a job scheduler for gaia pipeline runs.

type Plugin added in v0.2.1

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

	// Connect initializes the connection with the execution command
	// and the log path wbere the logs should be stored.
	Connect(command *exec.Cmd, logPath *string) 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)

	// 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.

Jump to

Keyboard shortcuts

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