Documentation ¶
Index ¶
- Variables
- type HatcheryLocal
- func (h *HatcheryLocal) CanSpawn(model *sdk.Model, req []sdk.Requirement) bool
- func (h *HatcheryLocal) Hatchery() *sdk.Hatchery
- func (h *HatcheryLocal) ID() int64
- func (h *HatcheryLocal) Init() error
- func (h *HatcheryLocal) KillWorker(worker sdk.Worker) error
- func (h *HatcheryLocal) SpawnWorker(wm *sdk.Model, req []sdk.Requirement) error
- func (h *HatcheryLocal) WorkerStarted(model *sdk.Model) int
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 ¶
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) 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
Click to show internal directories.
Click to hide internal directories.