test

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	IsRemote bool `json:"is_remote"` // Pretend to be remote or not to check the local node limits

	CpuLimit uint `json:"cpu_limit"` // Number of available virtual CPUs, 0 - unlimited
	RamLimit uint `json:"ram_limit"` // Amount of available virtual RAM (GB), 0 - unlimited

	CpuOverbook uint `json:"cpu_overbook"` // How many CPUs available for overbook
	RamOverbook uint `json:"ram_overbook"` // How much RAM (GB) available for overbook

	FailConfigApply    uint8 `json:"fail_config_apply"`    // Fail on config Apply (0 - not, 1-254 random, 255-yes)
	FailConfigValidate uint8 `json:"fail_config_validate"` // Fail on config Validation (0 - not, 1-254 random, 255-yes)
	FailStatus         uint8 `json:"fail_status"`          // Fail on Status (0 - not, 1-254 random, 255-yes)
	FailSnapshot       uint8 `json:"fail_snapshot"`        // Fail on Snapshot (0 - not, 1-254 random, 255-yes)
	FailDeallocate     uint8 `json:"fail_deallocate"`      // Fail on Deallocate (0 - not, 1-254 random, 255-yes)
}

func (*Config) Apply

func (c *Config) Apply(config []byte) error

func (*Config) Validate

func (c *Config) Validate() (err error)

type Driver

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

Implements drivers.ResourceDriver interface

func (*Driver) Allocate

func (d *Driver) Allocate(def types.LabelDefinition, metadata map[string]any) (*types.Resource, error)

*

  • Pretend to Allocate (actually not) the Resource

func (*Driver) AvailableCapacity

func (d *Driver) AvailableCapacity(node_usage types.Resources, req types.LabelDefinition) int64

Allow Fish to ask the driver about it's capacity (free slots) of a specific definition

func (*Driver) Deallocate

func (d *Driver) Deallocate(res *types.Resource) error

func (*Driver) GetTask

func (d *Driver) GetTask(name, options string) drivers.ResourceDriverTask

func (*Driver) IsRemote

func (d *Driver) IsRemote() bool

func (*Driver) Name

func (d *Driver) Name() string

func (*Driver) Prepare

func (d *Driver) Prepare(config []byte) error

func (*Driver) Status

func (d *Driver) Status(res *types.Resource) (string, error)

func (*Driver) ValidateDefinition

func (d *Driver) ValidateDefinition(def types.LabelDefinition) error

type Options

type Options struct {
	FailOptionsApply      uint8 `json:"fail_options_apply"`      // Fail on options Apply (0 - not, 1-254 random, 255-yes)
	FailOptionsValidate   uint8 `json:"fail_options_validate"`   // Fail on options Validate (0 - not, 1-254 random, 255-yes)
	FailAvailableCapacity uint8 `json:"fail_available_capacity"` // Fail on executing AvailableCapacity (0 - not, 1-254 random, 255-yes)
	FailAllocate          uint8 `json:"fail_allocate"`           // Fail on Allocate (0 - not, 1-254 random, 255-yes)
}

func (*Options) Apply

func (o *Options) Apply(options util.UnparsedJson) error

func (*Options) Validate

func (o *Options) Validate() error

type TaskSnapshot

type TaskSnapshot struct {
	*types.ApplicationTask `json:"-"` // Info about the requested task
	*types.Resource        `json:"-"` // Info about the processed resource

	Full bool `json:"full"` // Make full (all disks including OS image), or just the additional disks snapshot
	// contains filtered or unexported fields
}

func (*TaskSnapshot) Clone

func (*TaskSnapshot) Execute

func (t *TaskSnapshot) Execute() (result []byte, err error)

func (*TaskSnapshot) Name

func (t *TaskSnapshot) Name() string

func (*TaskSnapshot) SetInfo

func (t *TaskSnapshot) SetInfo(task *types.ApplicationTask, res *types.Resource)

Jump to

Keyboard shortcuts

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