Documentation ¶
Index ¶
- Variables
- func Main()
- func NewInfluxDBReporter(logger logger.Logger, influxConf config.InfluxDBConfig, runnerName string) influxDBReporter
- type LXD
- type NoopReporter
- func (_ NoopReporter) CleanShutdown()
- func (_ NoopReporter) DestroyContainerWillRetry()
- func (_ NoopReporter) DestroyedContainer()
- func (_ NoopReporter) Heartbeat()
- func (_ NoopReporter) LongPollLost()
- func (_ NoopReporter) MadeContainer()
- func (_ NoopReporter) PolledFoundWork()
- func (_ NoopReporter) PolledNoWork()
- func (_ NoopReporter) SSHError(error)
- func (_ NoopReporter) Signal(os.Signal)
- func (_ NoopReporter) WaitTime(_ time.Duration)
- type Operation
- type OperationFromDbOrBus
- type Reporter
- type Runnable
- type Runner
Constants ¶
This section is empty.
Variables ¶
var (
ProgramName string = "runner"
)
Functions ¶
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) ContainerExists ¶
func (*LXD) DestroyContainer ¶
func (*LXD) MaintainConnection ¶
func (*LXD) MakeContainer ¶
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 (*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 Runner ¶
type Runner struct {
// contains filtered or unexported fields
}