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