local

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "local",
	Short: "Hatchery Local commands: hatchery local --help",
	Long: `Hatchery Local commands: hatchery local <command>
Hatchery starts workers directly as local process.

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

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

	`,
	Run: func(cmd *cobra.Command, args []string) {
		hatchery.Born(hatcheryLocal, viper.GetString("api"), viper.GetString("token"), viper.GetInt("provision"), viper.GetInt("request-api-timeout"), viper.GetBool("insecure"))
	},
	PreRun: func(cmd *cobra.Command, args []string) {
		if hatcheryLocal.basedir == "" {
			sdk.Exit("basedir not provided, aborting. See flag --basedir hatchery local -h\n")
		}
	},
}

Cmd configures comamnd for HatcheryLocal

Functions

This section is empty.

Types

type HatcheryLocal

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

HatcheryLocal implements HatcheryMode interface for local usage

func (*HatcheryLocal) CanSpawn

func (h *HatcheryLocal) CanSpawn(model *sdk.Model, req []sdk.Requirement) bool

CanSpawn return wether or not hatchery can spawn model. requirements are not supported

func (*HatcheryLocal) Hatchery

func (h *HatcheryLocal) Hatchery() *sdk.Hatchery

Hatchery returns hatchery instance

func (*HatcheryLocal) ID

func (h *HatcheryLocal) ID() int64

ID must returns hatchery id

func (*HatcheryLocal) Init

func (h *HatcheryLocal) Init() error

Init register local hatchery with its worker model

func (*HatcheryLocal) KillWorker

func (h *HatcheryLocal) KillWorker(worker sdk.Worker) error

KillWorker kill a local process

func (*HatcheryLocal) SpawnWorker

func (h *HatcheryLocal) SpawnWorker(wm *sdk.Model, req []sdk.Requirement) error

SpawnWorker starts a new worker process

func (*HatcheryLocal) WorkerStarted

func (h *HatcheryLocal) 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