Help us shape the future of Go! Take the 2026 Go Developer Survey

openstack

package
v0.57.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2026 License: BSD-3-Clause Imports: 32 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCache added in v0.53.1

func NewCache(imagesExpirationDelay, serversExpirationDelay int) *cache

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 */

	// Flavors
	Flavors map[string]string `` /* 143-byte string literal not displayed */

	// OldFlavorsMapping support old flavors mapping for backward compatibility (to remove in future)
	OldFlavorsMapping map[string]string `` /* 168-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"`

	// OverrideImagesUsername define the username to use for the specified image.
	OverrideImagesUsername []ImageUsernameOverride `` /* 173-byte string literal not displayed */

	// OverrideImagesBookDelay define the worker book delay to use for the specified image.
	OverrideImagesBookDelay []ImageBookDelayOverride `` /* 182-byte string literal not displayed */

	// InjectSSHPublicKeys define the list of SSH public keys to inject into spawned workers
	InjectSSHPublicKeys []string `` /* 181-byte string literal not displayed */

	RequiredBinariesRequirement []string `` /* 238-byte string literal not displayed */
}

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 New

func New() *HatcheryOpenstack

New instanciates a new Hatchery Openstack

func (*HatcheryOpenstack) ApplyConfiguration

func (h *HatcheryOpenstack) ApplyConfiguration(cfg interface{}) error

ApplyConfiguration apply an object of type HatcheryConfiguration after checking it

func (*HatcheryOpenstack) CanAllocateResources added in v0.56.0

func (h *HatcheryOpenstack) CanAllocateResources(ctx context.Context, model sdk.WorkerStarterWorkerModel, jobID string, requirements []sdk.Requirement) (canSpawn bool, finalErr error)

func (*HatcheryOpenstack) CanSpawn

func (h *HatcheryOpenstack) CanSpawn(ctx context.Context, model sdk.WorkerStarterWorkerModel, jobID 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) ComputeBookDelay added in v0.56.0

func (h *HatcheryOpenstack) ComputeBookDelay(ctx context.Context, model sdk.WorkerStarterWorkerModel) int64

func (*HatcheryOpenstack) Configuration

Configuration returns Hatchery CommonConfiguration

func (*HatcheryOpenstack) GetImageUsername added in v0.55.1

func (h *HatcheryOpenstack) GetImageUsername(ctx context.Context, imageName string) string

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

func (h *HatcheryOpenstack) NeedRegistration(ctx context.Context, m *sdk.Model) bool

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

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

type ImageBookDelayOverride added in v0.56.0

type ImageBookDelayOverride struct {
	Image string `mapstructure:"image" toml:"image" default:"" commented:"true" comment:"The image name regular expression." json:"image"`
	Delay int64  `mapstructure:"delay" toml:"delay" default:"" commented:"true" comment:"The delay to use (in seconds)." json:"delay"`
}

type ImageUsernameOverride added in v0.55.1

type ImageUsernameOverride struct {
	Image    string `mapstructure:"image" toml:"image" default:"" commented:"true" comment:"The image name regular expression." json:"image"`
	Username string `mapstructure:"username" toml:"username" default:"" commented:"true" comment:"The username to use." json:"username"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL