Documentation
¶
Overview ¶
Package scheduler provides the core interface that Empire uses when interacting with a cluster of machines to run tasks.
Index ¶
- func Env(app *App, process *Process) map[string]string
- func Labels(app *App, process *Process) map[string]string
- type App
- type AttachedRunner
- type Exposure
- type ExposureType
- type FakeScheduler
- func (m *FakeScheduler) Instances(ctx context.Context, appID string) ([]*Instance, error)
- func (m *FakeScheduler) Remove(ctx context.Context, appID string) error
- func (m *FakeScheduler) Run(ctx context.Context, app *App, p *Process, in io.Reader, out io.Writer) error
- func (m *FakeScheduler) Scale(ctx context.Context, app string, ptype string, instances uint) error
- func (m *FakeScheduler) Stop(ctx context.Context, instanceID string) error
- func (m *FakeScheduler) Submit(ctx context.Context, app *App) error
- type HTTPExposure
- type HTTPSExposure
- type Instance
- type Process
- type Runner
- type Scaler
- type Scheduler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct { // The id of the app. ID string // An identifier that represents the version of this release. Release string // The name of the app. Name string // The application environment. Env map[string]string // The application labels. Labels map[string]string // Process that belong to this app. Processes []*Process }
type AttachedRunner ¶
AttachedRunner wraps a Manager to run attached processes using docker directly to get access to stdin and stdout.
type Exposure ¶
type Exposure struct { // External means that this process will be exposed to internet facing // traffic, as opposed to being internal. How this is used is // implementation specific. For ECS, this means that the attached ELB // will be "internet-facing". External bool // The exposure type (e.g. HTTPExposure, HTTPSExposure, TCPExposure). Type ExposureType }
Exposure controls the exposure settings for a process.
type ExposureType ¶ added in v0.10.1
type ExposureType interface {
Protocol() string
}
Exposure represents a service that a process exposes, like HTTP/HTTPS/TCP or SSL.
type FakeScheduler ¶
type FakeScheduler struct {
// contains filtered or unexported fields
}
func NewFakeScheduler ¶
func NewFakeScheduler() *FakeScheduler
func (*FakeScheduler) Remove ¶
func (m *FakeScheduler) Remove(ctx context.Context, appID string) error
type HTTPExposure ¶ added in v0.10.1
type HTTPExposure struct{}
HTTPExposure represents an HTTP exposure.
func (*HTTPExposure) Protocol ¶ added in v0.10.1
func (e *HTTPExposure) Protocol() string
type HTTPSExposure ¶ added in v0.10.1
type HTTPSExposure struct { // The certificate to attach to the process. Cert string }
HTTPSExposure represents an HTTPS exposure
func (*HTTPSExposure) Protocol ¶ added in v0.10.1
func (e *HTTPSExposure) Protocol() string
type Instance ¶
type Instance struct { Process *Process // The instance ID. ID string // The State that this Instance is in. State string // The time that this instance was last updated. UpdatedAt time.Time }
Instance represents an Instance of a Process.
type Process ¶
type Process struct { // The type of process. Type string // The Image to run. Image image.Image // The Command to run. Command []string // Environment variables to set. Env map[string]string // Labels to set on the container. Labels map[string]string // Exposure is the level of exposure for this process. Exposure *Exposure // Instances is the desired instances of this service to run. Instances uint // The amount of RAM to allocate to this process in bytes. MemoryLimit uint // the --cpu-shares flag for docker. CPUShares uint // ulimit -u Nproc uint }
type Scheduler ¶
type Scheduler interface { Scaler Runner // Submit submits an app, creating it or updating it as necessary. Submit(context.Context, *App) error // Remove removes the App. Remove(ctx context.Context, app string) error // Instance lists the instances of a Process for an app. Instances(ctx context.Context, app string) ([]*Instance, error) // Stop stops an instance. The scheduler will automatically start a new // instance. Stop(ctx context.Context, instanceID string) error }
Scheduler is an interface for interfacing with Services.
Directories
¶
Path | Synopsis |
---|---|
Package cloudformation implements the Scheduler interface for ECS by using CloudFormation to provision and update resources.
|
Package cloudformation implements the Scheduler interface for ECS by using CloudFormation to provision and update resources. |
Package docker implements the Scheduler interface backed by the Docker API.
|
Package docker implements the Scheduler interface backed by the Docker API. |
Pacakge ecs provides an implementation of the Scheduler interface that uses Amazon EC2 Container Service.
|
Pacakge ecs provides an implementation of the Scheduler interface that uses Amazon EC2 Container Service. |
lb
package lb provides an abstraction around creating load balancers.
|
package lb provides an abstraction around creating load balancers. |
Package kubernetes implements the Scheduler interface backed by Kubernetes.
|
Package kubernetes implements the Scheduler interface backed by Kubernetes. |
Click to show internal directories.
Click to hide internal directories.