docker

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2017 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "docker",
	Short: "Hatchery docker commands: hatchery docker --help",
	Long: `Hatchery docker commands: hatchery docker <command>
Start worker model instances on a single host.

Hatchery in docker mode looks for worker models of type 'docker' to start.

We will add a worker model to build Go applications:

$ cds worker model add golang docker --image=golang:latest
Add Go binary capability to model:

$ cds worker model capability add golang go binary go

You can generate a token for a given group using the CLI:

$ cds generate token --group shared.infra --expiration persistent
2706bda13748877c57029598b915d46236988c7c57ea0d3808524a1e1a3adef4

$ hatchery docker --api=https://<api.domain> --token=<token>

	`,
	Run: func(cmd *cobra.Command, args []string) {
		hatcheryDocker.addhost = viper.GetString("docker-add-host")
		hatchery.Born(hatcheryDocker, viper.GetString("api"), viper.GetString("token"), viper.GetInt("provision"), viper.GetInt("request-api-timeout"), viper.GetBool("insecure"))
	},
}

Cmd configures comamnd for HatcheryLocal

Functions

This section is empty.

Types

type HatcheryDocker

type HatcheryDocker struct {
	sync.Mutex
	// contains filtered or unexported fields
}

HatcheryDocker spawns instances of worker model with type 'Docker' by directly using available docker daemon

func (*HatcheryDocker) CanSpawn

func (hd *HatcheryDocker) CanSpawn(model *sdk.Model, req []sdk.Requirement) bool

CanSpawn return wether or not hatchery can spawn model requirement are not supported

func (*HatcheryDocker) Hatchery

func (hd *HatcheryDocker) Hatchery() *sdk.Hatchery

Hatchery returns hatchery instance

func (*HatcheryDocker) ID

func (hd *HatcheryDocker) ID() int64

ID must returns hatchery id

func (*HatcheryDocker) Init

func (hd *HatcheryDocker) Init() error

Init starts cleaning routine and check hatchery can run in docker mode with given configuration

func (*HatcheryDocker) KillWorker

func (hd *HatcheryDocker) KillWorker(worker sdk.Worker) error

KillWorker stops a worker locally

func (*HatcheryDocker) SpawnWorker

func (hd *HatcheryDocker) SpawnWorker(wm *sdk.Model, req []sdk.Requirement) error

SpawnWorker starts a new worker in a docker container locally

func (*HatcheryDocker) WorkerStarted

func (hd *HatcheryDocker) WorkerStarted(model *sdk.Model) int

WorkerStarted returns the number of instances of given model started but not necessarily register on CDS yet

Jump to

Keyboard shortcuts

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