primitives

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilesystemName

func FilesystemName(wl *gridtypes.WorkloadWithID) string

FilesystemName return a string to be used as filesystem name from a reservation object

func GetCapacity

func GetCapacity(ctx context.Context) gridtypes.Capacity

GetCapacity gets current capacity from context

func NewStatisticsMessageBus

func NewStatisticsMessageBus(router rmb.Router, stats *Statistics) error

NewStatisticsMessageBus register statistics handlers for message bus

func NewStatisticsStream

func NewStatisticsStream(s *Statistics) pkg.Statistics

Types

type AtomicUnit

type AtomicUnit gridtypes.Unit

AtomicUnit value for safe increment/decrement

func (*AtomicUnit) Current

func (c *AtomicUnit) Current() gridtypes.Unit

Current returns the current value

func (*AtomicUnit) Decrement

func (c *AtomicUnit) Decrement(v gridtypes.Unit) gridtypes.Unit

Decrement counter atomically by one

func (*AtomicUnit) Increment

func (c *AtomicUnit) Increment(v gridtypes.Unit) gridtypes.Unit

Increment counter atomically by one

type Counters

type Counters struct {
	SRU  AtomicUnit // SSD storage in bytes
	HRU  AtomicUnit // HDD storage in bytes
	MRU  AtomicUnit // Memory storage in bytes
	CRU  AtomicUnit // CPU count absolute
	IPv4 AtomicUnit // IPv4 count absolute
}

Counters tracks the amount of primitives workload deployed and the amount of resource unit used

func (*Counters) Decrement

func (c *Counters) Decrement(cap gridtypes.Capacity)

Decrement is called by the provision.Engine when a reservation has been decommissioned

func (*Counters) Increment

func (c *Counters) Increment(cap gridtypes.Capacity)

Increment is called by the provision.Engine when a reservation has been provisionned

type FListInfo

type FListInfo struct {
	Container bool
	Initrd    string
	Kernel    string
	ImagePath string
}

FListInfo virtual machine details

type Primitives

type Primitives struct {
	provision.Provisioner
	// contains filtered or unexported fields
}

Primitives hold all the logic responsible to provision and decomission the different primitives workloads defined by this package

func NewPrimitivesProvisioner

func NewPrimitivesProvisioner(zbus zbus.Client) *Primitives

NewPrimitivesProvisioner creates a new 0-OS provisioner

func (*Primitives) InitializeZDB

func (p *Primitives) InitializeZDB(ctx context.Context) error

InitializeZDB makes sure all required zdbs are running

type Statistics

type Statistics struct {
	// contains filtered or unexported fields
}

Statistics a provisioner interceptor that keeps track of consumed capacity. It also does validate of required capacity and then can report that this capacity can not be fulfilled

func NewStatistics

func NewStatistics(total, initial gridtypes.Capacity, reserved Counters, inner provision.Provisioner) *Statistics

NewStatistics creates a new statistics provisioner interceptor. Statistics provisioner keeps track of used capacity and update explorer when it changes

func (*Statistics) CanUpdate

func (s *Statistics) CanUpdate(ctx context.Context, typ gridtypes.WorkloadType) bool

CanUpdate implements the provisioner interface

func (*Statistics) Current

func (s *Statistics) Current() gridtypes.Capacity

Current returns the current used capacity

func (*Statistics) Decommission

func (s *Statistics) Decommission(ctx context.Context, wl *gridtypes.WorkloadWithID) error

Decommission implements the decomission interface

func (*Statistics) Provision

func (s *Statistics) Provision(ctx context.Context, wl *gridtypes.WorkloadWithID) (result gridtypes.Result, err error)

Provision implements the provisioner interface

func (*Statistics) Total

func (s *Statistics) Total() gridtypes.Capacity

Total returns the node total capacity

func (*Statistics) Update

Update implements the provisioner interface

type ZDB

type ZDB = zos.ZDB

ZDB types

type ZMachine

type ZMachine = zos.ZMachine

ZMachine type

type ZMachineResult

type ZMachineResult = zos.ZMachineResult

ZMachineResult type

type ZMount

type ZMount = zos.ZMount

ZMount defines a mount point

type ZMountResult

type ZMountResult = zos.ZMountResult

ZMountResult types

Jump to

Keyboard shortcuts

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