Documentation
¶
Index ¶
- func NewCache(imagesExpirationDelay, serversExpirationDelay int) *cache
- type HatcheryConfiguration
- type HatcheryOpenstack
- func (h *HatcheryOpenstack) ApplyConfiguration(cfg interface{}) error
- func (h *HatcheryOpenstack) CanSpawn(ctx context.Context, _ sdk.WorkerStarterWorkerModel, _ string, ...) bool
- func (h *HatcheryOpenstack) CheckConfiguration(cfg interface{}) error
- func (h *HatcheryOpenstack) Configuration() service.HatcheryCommonConfiguration
- func (h *HatcheryOpenstack) Init(config interface{}) (cdsclient.ServiceConfig, error)
- func (h *HatcheryOpenstack) InitHatchery(ctx context.Context) error
- func (*HatcheryOpenstack) ModelType() string
- func (h *HatcheryOpenstack) NeedRegistration(ctx context.Context, m *sdk.Model) bool
- func (h *HatcheryOpenstack) Serve(ctx context.Context) error
- func (h *HatcheryOpenstack) Signin(ctx context.Context, clientConfig cdsclient.ServiceConfig, ...) error
- func (h *HatcheryOpenstack) SpawnWorker(ctx context.Context, spawnArgs hatchery.SpawnArguments) error
- func (h *HatcheryOpenstack) Start(ctx context.Context) error
- func (h *HatcheryOpenstack) Status(ctx context.Context) *sdk.MonitoringStatus
- func (h *HatcheryOpenstack) WorkerModelSecretList(m sdk.Model) (sdk.WorkerModelSecrets, error)
- func (h *HatcheryOpenstack) WorkerModelsEnabled() ([]sdk.Model, error)
- func (h *HatcheryOpenstack) WorkersStarted(ctx context.Context) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HatcheryConfiguration ¶
type HatcheryConfiguration struct {
service.HatcheryCommonConfiguration `mapstructure:"commonConfiguration" toml:"commonConfiguration" json:"commonConfiguration"`
// Tenant openstack-tenant
Tenant string `` /* 165-byte string literal not displayed */
// Domain openstack-domain
Domain string `` /* 164-byte string literal not displayed */
// User openstack-user
User string `mapstructure:"user" toml:"user" default:"" commented:"false" comment:"Openstack User" json:"user"`
// Address openstack-auth-endpoint
Address string `` /* 145-byte string literal not displayed */
// Password openstack-password
Password string `mapstructure:"password" toml:"password" default:"" commented:"false" comment:"Openstack Password" json:"-"`
// Region openstack-region
Region string `mapstructure:"region" toml:"region" default:"" commented:"false" comment:"Openstack Region" json:"region"`
// NetworkString openstack-network
NetworkString string `` /* 196-byte string literal not displayed */
// IPRange IP Range
IPRange string `` /* 327-byte string literal not displayed */
// DisableCreateImage if true: hatchery does not create openstack image when a worker model is updated
DisableCreateImage bool `` /* 210-byte string literal not displayed */
// CreateImageTimeout max wait for create an openstack image (in seconds)
CreateImageTimeout int `` /* 179-byte string literal not displayed */
// AllowedFlavors if not empty the hatchery will be able to start a model only if its flavor is listed in allowed flavors
AllowedFlavors []string `` /* 169-byte string literal not displayed */
// MaxCPUs if set the hatchery will stop starting new models if its flavors requires more CPUs than availables
MaxCPUs int `` /* 161-byte string literal not displayed */
// CountSmallerFlavorToKeep define the count of smaller flavors that the hatchery should be able to boot when booting a larger flavor.
// This count will prevent big flavor to take all the CPUs available for the hatchery and will keep some available for smaller flavors.
// Ex: if two flavors are available with 8 and 4 cpus and count to keep equals 2 the hatchery will need 8+4*2=16cpus available to start a 8cpus flavor.
CountSmallerFlavorToKeep int `` /* 237-byte string literal not displayed */
// DefaultFlavor, if set the hatchery will use a model with the default flavor in priority to start jobs without model requirement
DefaultFlavor string `` /* 221-byte string literal not displayed */
// DefaultSecurityGroups, if set the VMs spawned by the hatchery will have the given security groups
DefaultSecurityGroups []string `` /* 189-byte string literal not displayed */
Cache struct {
ImagesExpirationDelay int `` /* 197-byte string literal not displayed */
ServersExpirationDelay int `` /* 200-byte string literal not displayed */
} `mapstructure:"cache" toml:"cache" json:"cache"`
}
HatcheryConfiguration is the configuration for hatchery
type HatcheryOpenstack ¶
type HatcheryOpenstack struct {
hatcheryCommon.Common
Config HatcheryConfiguration
// contains filtered or unexported fields
}
HatcheryOpenstack spawns instances of worker model with type 'ISO' by startup up virtual machines on /cloud
func (*HatcheryOpenstack) ApplyConfiguration ¶
func (h *HatcheryOpenstack) ApplyConfiguration(cfg interface{}) error
ApplyConfiguration apply an object of type HatcheryConfiguration after checking it
func (*HatcheryOpenstack) CanSpawn ¶
func (h *HatcheryOpenstack) CanSpawn(ctx context.Context, _ sdk.WorkerStarterWorkerModel, _ string, requirements []sdk.Requirement) bool
CanSpawn return wether or not hatchery can spawn model requirements are not supported
func (*HatcheryOpenstack) CheckConfiguration ¶
func (h *HatcheryOpenstack) CheckConfiguration(cfg interface{}) error
CheckConfiguration checks the validity of the configuration object
func (*HatcheryOpenstack) Configuration ¶
func (h *HatcheryOpenstack) Configuration() service.HatcheryCommonConfiguration
Configuration returns Hatchery CommonConfiguration
func (*HatcheryOpenstack) Init ¶
func (h *HatcheryOpenstack) Init(config interface{}) (cdsclient.ServiceConfig, error)
Init cdsclient config.
func (*HatcheryOpenstack) InitHatchery ¶
func (h *HatcheryOpenstack) InitHatchery(ctx context.Context) error
InitHatchery fetch uri from nova then list available models then list available images
func (*HatcheryOpenstack) ModelType ¶
func (*HatcheryOpenstack) ModelType() string
ModelType returns type of hatchery
func (*HatcheryOpenstack) NeedRegistration ¶
NeedRegistration return true if worker model need regsitration
func (*HatcheryOpenstack) Serve ¶
func (h *HatcheryOpenstack) Serve(ctx context.Context) error
Serve start the hatchery server
func (*HatcheryOpenstack) Signin ¶ added in v0.53.0
func (h *HatcheryOpenstack) Signin(ctx context.Context, clientConfig cdsclient.ServiceConfig, srvConfig interface{}) error
func (*HatcheryOpenstack) SpawnWorker ¶
func (h *HatcheryOpenstack) SpawnWorker(ctx context.Context, spawnArgs hatchery.SpawnArguments) error
SpawnWorker creates a new cloud instances requirements are not supported
func (*HatcheryOpenstack) Start ¶
func (h *HatcheryOpenstack) Start(ctx context.Context) error
Start inits client and routines for hatchery
func (*HatcheryOpenstack) Status ¶
func (h *HatcheryOpenstack) Status(ctx context.Context) *sdk.MonitoringStatus
Status returns sdk.MonitoringStatus, implements interface service.Service
func (*HatcheryOpenstack) WorkerModelSecretList ¶
func (h *HatcheryOpenstack) WorkerModelSecretList(m sdk.Model) (sdk.WorkerModelSecrets, error)
WorkerModelSecretList returns secret for given model.
func (*HatcheryOpenstack) WorkerModelsEnabled ¶
func (h *HatcheryOpenstack) WorkerModelsEnabled() ([]sdk.Model, error)
WorkerModelsEnabled returns Worker model enabled.
func (*HatcheryOpenstack) WorkersStarted ¶
func (h *HatcheryOpenstack) WorkersStarted(ctx context.Context) ([]string, error)
WorkersStarted returns the number of instances started but not necessarily register on CDS yet