runner

package
v0.0.0-...-a8e4d9d Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProgramName string = "runner"
)

Functions

func Main

func Main()

func NewInfluxDBReporter

func NewInfluxDBReporter(logger logger.Logger, influxConf config.InfluxDBConfig, runnerName string) influxDBReporter

Types

type LXD

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

func (*LXD) CheckContainerNetworking

func (lxd *LXD) CheckContainerNetworking() error

func (*LXD) ContainerExists

func (lxd *LXD) ContainerExists() (bool, error)

func (*LXD) DestroyContainer

func (lxd *LXD) DestroyContainer() error

func (*LXD) MaintainConnection

func (lxd *LXD) MaintainConnection(lost chan<- error)

func (*LXD) MakeContainer

func (lxd *LXD) MakeContainer() error

func (*LXD) WaitForContainerNetworking

func (lxd *LXD) WaitForContainerNetworking(d time.Duration) error

type NoopReporter

type NoopReporter struct{}

func (NoopReporter) CleanShutdown

func (_ NoopReporter) CleanShutdown()

func (NoopReporter) DestroyContainerWillRetry

func (_ NoopReporter) DestroyContainerWillRetry()

func (NoopReporter) DestroyedContainer

func (_ NoopReporter) DestroyedContainer()

func (NoopReporter) Heartbeat

func (_ NoopReporter) Heartbeat()

func (NoopReporter) LongPollLost

func (_ NoopReporter) LongPollLost()

func (NoopReporter) MadeContainer

func (_ NoopReporter) MadeContainer()

func (NoopReporter) PolledFoundWork

func (_ NoopReporter) PolledFoundWork()

func (NoopReporter) PolledNoWork

func (_ NoopReporter) PolledNoWork()

func (NoopReporter) SSHError

func (_ NoopReporter) SSHError(error)

func (NoopReporter) Signal

func (_ NoopReporter) Signal(os.Signal)

func (NoopReporter) WaitTime

func (_ NoopReporter) WaitTime(_ time.Duration)

type Operation

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

func (*Operation) RunLocally

func (o *Operation) RunLocally(notifierType string)

func (*Operation) RunOnLXDHost

func (o *Operation) RunOnLXDHost()

type OperationFromDbOrBus

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

func (*OperationFromDbOrBus) Next

func (ofdob *OperationFromDbOrBus) Next() (*domain.Operation, error)

Next uses it's own transaction to atomically select the next unstarted operation from the database. It uses a single transaction to get the lock, as if this transaction would be shared for the status message updates ("waiting for vm...", etc) then the status messages would be delayed until the end of the operation.

The method will call itself if it retrieves an outdated operation, after marking the initially selected operation as timed out. (Blue in the UI, probably)

The locks used here are advisory, database sessions without a transaction may still be able to get a handle on this row and update other fields.

func (*OperationFromDbOrBus) NextOn

func (ofdob *OperationFromDbOrBus) NextOn(quit chan bool, ch chan<- *domain.Operation) error

Next on can immediately return an error, else it will eventually send an operation when one becomes available on the channel given

func (*OperationFromDbOrBus) WaitForNew

func (ofdob *OperationFromDbOrBus) WaitForNew(quit chan bool) bool

type Reporter

type Reporter interface {
	// Waiting/polling
	PolledNoWork()
	PolledFoundWork()

	// how long is our backlog?
	WaitTime(time.Duration)

	// did we fail to connect to the host?
	SSHError(error)

	// Heartbeats
	Heartbeat()
	LongPollLost()

	// Containers
	MadeContainer()
	DestroyedContainer()
	DestroyContainerWillRetry()

	// What're we doing operationally?
	Signal(os.Signal)
	CleanShutdown()
}

Reporter is the generic reporter for metrics

type Runnable

type Runnable interface {
	Next() (*domain.Operation, error)
}

type Runner

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

func (*Runner) MakeContainer

func (r *Runner) MakeContainer(uuid string, res chan error)

func (*Runner) SetLXDConnStr

func (r *Runner) SetLXDConnStr(connStr string) (err error)

func (*Runner) Start

func (r *Runner) Start()

func (*Runner) Stop

func (r *Runner) Stop(reason string)

Jump to

Keyboard shortcuts

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