launcher

package
v0.0.0-...-ff26d5d Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotExist = errors.New("entry not exist")

Functions

This section is empty.

Types

type ImageProvider

type ImageProvider interface {
	GetServiceInfo(serviceID string) (imagemanager.ServiceInfo, error)
	GetLayerInfo(digest string) (imagemanager.LayerInfo, error)
	RevertService(serviceID string) error
}

ImageProvider provides image information.

type InstanceInfo

type InstanceInfo struct {
	aostypes.InstanceIdent
	UID int
}

type Launcher

type Launcher struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Launcher service instances launcher.

func New

func New(
	config *config.Config, storage Storage, nodeManager NodeManager, imageProvider ImageProvider,
	resourceManager ResourceManager, storageStateProvider StorageStateProvider, networkManager NetworkManager,
) (launcher *Launcher, err error)

New creates launcher instance.

func (*Launcher) Close

func (launcher *Launcher) Close()

Close closes launcher.

func (*Launcher) GetNodesConfiguration

func (launcher *Launcher) GetNodesConfiguration() []cloudprotocol.NodeInfo

GetNodesConfiguration gets nodes configuration.

func (*Launcher) GetRunStatusesChannel

func (launcher *Launcher) GetRunStatusesChannel() <-chan unitstatushandler.RunInstancesStatus

GetRunStatusesChannel gets channel with run status instances status.

func (*Launcher) RestartInstances

func (launcher *Launcher) RestartInstances() error

RestartInstances performs restart service instances.

func (*Launcher) RunInstances

func (launcher *Launcher) RunInstances(instances []cloudprotocol.InstanceInfo, newServices []string) error

RunInstances performs run service instances.

type NetworkManager

type NetworkManager interface {
	PrepareInstanceNetworkParameters(
		instanceIdent aostypes.InstanceIdent, networkID string,
		params networkmanager.NetworkParameters) (aostypes.NetworkParameters, error)
	RemoveInstanceNetworkParameters(instanceIdent aostypes.InstanceIdent, networkID string)
	RestartDNSServer() error
	GetInstances() []aostypes.InstanceIdent
	UpdateProviderNetwork(providers []string, nodeID string) error
}

NetworkManager network manager interface.

type NodeInfo

type NodeInfo struct {
	cloudprotocol.NodeInfo
	RemoteNode    bool
	RunnerFeature []string
}

NodeConfiguration node static configuration.

type NodeManager

type NodeManager interface {
	GetNodeConfiguration(nodeID string) (NodeInfo, error)
	RunInstances(
		nodeID string, services []aostypes.ServiceInfo, layers []aostypes.LayerInfo, instances []aostypes.InstanceInfo,
		forceRestart bool,
	) error
	GetRunInstancesStatusChannel() <-chan NodeRunInstanceStatus
	GetSystemLimitAlertChannel() <-chan cloudprotocol.SystemQuotaAlert
	GetNodeMonitoringData(nodeID string) (data cloudprotocol.NodeMonitoringData, err error)
}

NodeManager nodes controller.

type NodeRunInstanceStatus

type NodeRunInstanceStatus struct {
	NodeID    string
	NodeType  string
	Instances []cloudprotocol.InstanceStatus
}

NodeRunInstanceStatus instance run status for the node.

type ResourceManager

type ResourceManager interface {
	GetUnitConfiguration(nodeType string) aostypes.NodeUnitConfig
}

ResourceManager provides node resources.

type Storage

type Storage interface {
	AddInstance(instanceInfo InstanceInfo) error
	RemoveInstance(instanceIdent aostypes.InstanceIdent) error
	GetInstanceUID(instance aostypes.InstanceIdent) (int, error)
	GetInstances() ([]InstanceInfo, error)
	SetDesiredInstances(instances json.RawMessage) error
	GetDesiredInstances() (json.RawMessage, error)
	SetNodeState(nodeID string, state json.RawMessage) error
	GetNodeState(nodeID string) (json.RawMessage, error)
}

Storage storage interface.

type StorageStateProvider

type StorageStateProvider interface {
	Setup(params storagestate.SetupParams) (storagePath string, statePath string, err error)
	Cleanup(instanceIdent aostypes.InstanceIdent) error
	GetInstanceCheckSum(instance aostypes.InstanceIdent) string
}

StorageStateProvider instances storage state provider.

Jump to

Keyboard shortcuts

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