docker

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2017 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package docker implements the Scheduler interface backed by the Docker API.

Index

Constants

View Source
const (
	Attached = "attached"
	Detached = "detached"
)

Values for `runLabel`.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachedScheduler

type AttachedScheduler struct {
	// If set, attached run instances will be merged in with instances
	// returned from the wrapped scheduler. This is currently an
	// experimental feature, since it requires that multiple Empire
	// processes interact with a single Docker daemon.
	ShowAttached bool

	twelvefactor.Scheduler
	// contains filtered or unexported fields
}

AttachedScheduler wraps a Scheduler to run attached processes using the Docker scheduler.

func RunAttachedWithDocker

func RunAttachedWithDocker(s twelvefactor.Scheduler, client *dockerutil.Client) *AttachedScheduler

RunAttachedWithDocker wraps a Scheduler to run attached Run's using a Docker client.

func (*AttachedScheduler) Run

Run runs attached processes using the docker scheduler, and detached processes using the wrapped scheduler.

func (*AttachedScheduler) Stop

func (s *AttachedScheduler) Stop(ctx context.Context, maybeContainerID string) error

Stop checks if there's an attached run matching the given id, and stops that container if there is. Otherwise, it delegates to the wrapped Scheduler.

func (*AttachedScheduler) Tasks added in v0.13.0

func (s *AttachedScheduler) Tasks(ctx context.Context, app string) ([]*twelvefactor.Task, error)

Tasks returns a combination of instances from the wrapped scheduler, as well as instances from attached runs.

type Scheduler

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

Scheduler provides an implementation of the scheduler.Scheduler interface backed by Docker.

func NewScheduler

func NewScheduler(client *dockerutil.Client) *Scheduler

NewScheduler returns a new Scheduler instance that uses the given client to interact with Docker.

func (*Scheduler) Instances

func (s *Scheduler) Instances(ctx context.Context, app string) ([]*twelvefactor.Task, error)

func (*Scheduler) InstancesFromAttachedRuns

func (s *Scheduler) InstancesFromAttachedRuns(ctx context.Context, app string) ([]*twelvefactor.Task, error)

InstancesFromAttachedRuns returns Instances that were started from attached runs.

func (*Scheduler) Run

func (s *Scheduler) Run(ctx context.Context, app *twelvefactor.Manifest) error

func (*Scheduler) Stop

func (s *Scheduler) Stop(ctx context.Context, containerID string) error

Stop stops the given container.

Jump to

Keyboard shortcuts

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