agentpool

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAgentNamePrefix = "serverless-agent"

DefaultAgentNamePrefix serverless agent name prefix used when registering the agent

View Source
const DefaultAgentPoolSize = 5

DefaultAgentPoolSize default agent size if one is not specified

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionFunc

type ActionFunc func(agentInstance *AgentInstance, resultsChan chan *AgentResult)

ActionFunc async agent action function

type AgentInstance

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

AgentInstance instance of the serverless agent

func NewAgentInstance

func NewAgentInstance(cfg *config.Config, index int, tags []string) *AgentInstance

NewAgentInstance create a new agent instance

func (AgentInstance) ConfigKey

func (ai AgentInstance) ConfigKey() string

ConfigKey return the key used to store the agent instances configuration

func (AgentInstance) EnvironmentName

func (ai AgentInstance) EnvironmentName() string

EnvironmentName return the Environment Name of the agent instance

func (AgentInstance) EnvironmentNumber

func (ai AgentInstance) EnvironmentNumber() string

EnvironmentNumber return the Environment Number of the agent instance

func (AgentInstance) Name

func (ai AgentInstance) Name() string

Name return the name of the agent instance

func (AgentInstance) Tags

func (ai AgentInstance) Tags() []string

Tags return the tags for the agent instance

type AgentPool

type AgentPool struct {
	Agents []*AgentInstance
	// contains filtered or unexported fields
}

AgentPool used to store a pool of agents which are created on launch

func New

func New(cfg *config.Config, sess *session.Session, buildkiteAPI bk.API) *AgentPool

New create a new agent pool and populate it based on the poolsize

func (*AgentPool) PollAgents

func (ap *AgentPool) PollAgents(deadline time.Time) error

PollAgents send a heartbeat to all the agents in the pool then check for jobs using ping

func (*AgentPool) RegisterAgents

func (ap *AgentPool) RegisterAgents(deadline time.Time) error

RegisterAgents register all the agents in the pool

type AgentResult

type AgentResult struct {
	Name  string // name of the agent which returned the result
	Error error
}

AgentResult agent result from operation

type BuildkiteWorker

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

BuildkiteWorker handler for lambda events

func NewBuildkiteWorker

func NewBuildkiteWorker(agentPool *AgentPool) *BuildkiteWorker

NewBuildkiteWorker create a new handler

func (*BuildkiteWorker) Handler

func (bkw *BuildkiteWorker) Handler(ctx context.Context, evt *events.CloudWatchEvent) error

Handler process the cloudwatch scheduled event

Jump to

Keyboard shortcuts

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