Documentation
¶
Overview ¶
Package agent runs tasks on differents runtime environments, such as hosts and containers.
Index ¶
- type Agent
- func (a *Agent) Close(ctx context.Context)
- func (a *Agent) GetSender(ctx context.Context, output globals.LogOutputType, prefix string, ...) (send.Sender, error)
- func (a *Agent) SetDefaultLogger(sender send.Sender)
- func (a *Agent) SetHomeDirectory(ctx context.Context)
- func (a *Agent) Start(ctx context.Context) error
- type ContainerHandle
- type Options
- type StatsCollector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent manages the data necessary to run tasks in a runtime environment.
func New ¶
New creates a new Agent with some Options and a client.Communicator. Call the Agent's Start method to begin listening for tasks to run. Users should call Close when the agent is finished.
func (*Agent) GetSender ¶
func (a *Agent) GetSender(ctx context.Context, output globals.LogOutputType, prefix string, taskID string, taskExecution int) (send.Sender, error)
GetSender configures the agent's local logging, which can go to Splunk, a file, or stdout.
func (*Agent) SetDefaultLogger ¶
func (*Agent) SetHomeDirectory ¶
SetHomeDirectory sets the agent's home directory to the user's home directory if it is not already set.
type ContainerHandle ¶
type ContainerHandle interface {
GetID() string
GetName() string
GetEnvFileHostDir() string
Destroy(ctx context.Context) error
}
ContainerHandle is the interface through which the agent manages an active task isolation container. Using an interface lets unit tests inject a fake without requiring a live Docker daemon.
type Options ¶
type Options struct {
// Mode determines which mode the agent will run in.
Mode globals.Mode
// HostID and HostSecret only apply in host mode.
HostID string
HostSecret string
StatusPort int
LogPrefix string
LogOutput globals.LogOutputType
WorkingDirectory string
HeartbeatInterval time.Duration
Cleanup bool
SetupData apimodels.AgentSetupData
CloudProvider string
TraceCollectorEndpoint string
// SendTaskLogsToGlobalSender indicates whether task logs should also be
// sent to the global agent file log.
SendTaskLogsToGlobalSender bool
HomeDirectory string
SingleTaskDistro bool
// ContainerRetainOnFailureSecs is how long an isolation container is kept
// alive after a task failure so on-call can docker exec into it for
// post-mortem inspection. Zero disables retention.
ContainerRetainOnFailureSecs int
// CompatClientPath is the absolute path to the legacy ~/evergreen binary,
// mounted read-only into isolation containers.
CompatClientPath string
}
Options contains startup options for an Agent.
type StatsCollector ¶
type StatsCollector struct {
// Cmds are agent-fixed host diagnostics, never task-controlled.
Cmds []string
// PSCmd is the task-configurable ps command. It runs inside the task's
// isolation container when one exists because its value is
// author-controlled.
PSCmd string
// Container fields locate the task's isolation container, used only to
// run PSCmd.
ContainerID string
WorkDir string
EnvFileHostDir string
ExecUser string
// indicates the sampling frequency
Interval time.Duration
// contains filtered or unexported fields
}
StatsCollector samples machine statistics and logs them back to the API server at regular intervals.
func NewSimpleStatsCollector ¶
func NewSimpleStatsCollector(logger client.LoggerProducer, jpm jasper.Manager, interval time.Duration, cmds ...string) *StatsCollector
NewSimpleStatsCollector creates a StatsCollector that runs the given commands at the given interval and sends the results to the given logger.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package command defines the behavior of commands invoked by project configuration files.
|
Package command defines the behavior of commands invoked by project configuration files. |
|
taskoutput
Task Output Directory
|
Task Output Directory |
|
Package util provides utility methods for the agent.
|
Package util provides utility methods for the agent. |