Documentation ¶
Index ¶
- type HatcheryConfiguration
- type HatcheryLocal
- func (h *HatcheryLocal) ApplyConfiguration(cfg interface{}) error
- func (h *HatcheryLocal) CanSpawn(ctx context.Context, _ sdk.WorkerStarterWorkerModel, jobID string, ...) bool
- func (h *HatcheryLocal) CheckConfiguration(cfg interface{}) error
- func (h *HatcheryLocal) Configuration() service.HatcheryCommonConfiguration
- func (h *HatcheryLocal) Init(config interface{}) (cdsclient.ServiceConfig, error)
- func (h *HatcheryLocal) InitHatchery(ctx context.Context) error
- func (h *HatcheryLocal) Serve(ctx context.Context) error
- func (h *HatcheryLocal) Signin(ctx context.Context, clientConfig cdsclient.ServiceConfig, ...) error
- func (h *HatcheryLocal) SpawnWorker(ctx context.Context, spawnArgs hatchery.SpawnArguments) error
- func (h *HatcheryLocal) Start(ctx context.Context) error
- func (h *HatcheryLocal) Status(ctx context.Context) *sdk.MonitoringStatus
- func (h *HatcheryLocal) WorkersStarted(ctx context.Context) ([]string, error)
- type LocalWorkerRunner
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HatcheryConfiguration ¶
type HatcheryConfiguration struct { service.HatcheryCommonConfiguration `mapstructure:"commonConfiguration" toml:"commonConfiguration" json:"commonConfiguration"` Basedir string `mapstructure:"basedir" toml:"basedir" default:"/var/lib/cds-engine" comment:"BaseDir for worker workspace" json:"basedir"` }
HatcheryConfiguration is the configuration for local hatchery
type HatcheryLocal ¶
type HatcheryLocal struct { hatcheryCommon.Common Config HatcheryConfiguration sync.Mutex LocalWorkerRunner LocalWorkerRunner // BasedirDedicated = basedir + hatchery.name // this directory contains the worker donwloaded from api at startup BasedirDedicated string // contains filtered or unexported fields }
HatcheryLocal implements HatcheryMode interface for local usage
func (*HatcheryLocal) ApplyConfiguration ¶
func (h *HatcheryLocal) ApplyConfiguration(cfg interface{}) error
ApplyConfiguration apply an object of type HatcheryConfiguration after checking it
func (*HatcheryLocal) CanSpawn ¶
func (h *HatcheryLocal) CanSpawn(ctx context.Context, _ sdk.WorkerStarterWorkerModel, jobID string, requirements []sdk.Requirement) bool
CanSpawn return wether or not hatchery can spawn model. requirements are not supported
func (*HatcheryLocal) CheckConfiguration ¶
func (h *HatcheryLocal) CheckConfiguration(cfg interface{}) error
CheckConfiguration checks the validity of the configuration object
func (*HatcheryLocal) Configuration ¶
func (h *HatcheryLocal) Configuration() service.HatcheryCommonConfiguration
Configuration returns Hatchery CommonConfiguration
func (*HatcheryLocal) Init ¶
func (h *HatcheryLocal) Init(config interface{}) (cdsclient.ServiceConfig, error)
func (*HatcheryLocal) InitHatchery ¶
func (h *HatcheryLocal) InitHatchery(ctx context.Context) error
InitHatchery register local hatchery with its worker model
func (*HatcheryLocal) Serve ¶
func (h *HatcheryLocal) Serve(ctx context.Context) error
Serve start the hatchery server
func (*HatcheryLocal) Signin ¶ added in v0.53.0
func (h *HatcheryLocal) Signin(ctx context.Context, clientConfig cdsclient.ServiceConfig, srvConfig interface{}) error
func (*HatcheryLocal) SpawnWorker ¶
func (h *HatcheryLocal) SpawnWorker(ctx context.Context, spawnArgs hatchery.SpawnArguments) error
SpawnWorker starts a new worker process
func (*HatcheryLocal) Start ¶
func (h *HatcheryLocal) Start(ctx context.Context) error
Start inits client and routines for hatchery
func (*HatcheryLocal) Status ¶
func (h *HatcheryLocal) Status(ctx context.Context) *sdk.MonitoringStatus
Status returns sdk.MonitoringStatus, implements interface service.Service
func (*HatcheryLocal) WorkersStarted ¶
func (h *HatcheryLocal) WorkersStarted(ctx context.Context) ([]string, error)
WorkersStarted returns the number of instances started but not necessarily register on CDS yet