Documentation
¶
Index ¶
- type Config
- type Driver
- func (d *Driver) Allocate(def types.LabelDefinition, metadata map[string]any) (*types.Resource, error)
- func (d *Driver) AvailableCapacity(node_usage types.Resources, req types.LabelDefinition) int64
- func (d *Driver) Deallocate(res *types.Resource) error
- func (d *Driver) GetTask(name, options string) drivers.ResourceDriverTask
- func (d *Driver) IsRemote() bool
- func (d *Driver) Name() string
- func (d *Driver) Prepare(config []byte) error
- func (d *Driver) Status(res *types.Resource) (string, error)
- func (d *Driver) ValidateDefinition(def types.LabelDefinition) error
- type Factory
- type Options
- type TaskSnapshot
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
WorkspacePath string `json:"workspace_path"` // Where to place the files of running resources
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)
}
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 ¶
Allow Fish to ask the driver about it's capacity (free slots) of a specific definition
func (*Driver) ValidateDefinition ¶
func (d *Driver) ValidateDefinition(def types.LabelDefinition) error
type Factory ¶ added in v0.7.3
type Factory struct{}
Implements drivers.ResourceDriverFactory interface
func (*Factory) NewResourceDriver ¶ added in v0.7.3
func (f *Factory) NewResourceDriver() drivers.ResourceDriver
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)
}
type TaskSnapshot ¶
type TaskSnapshot struct {
*types.ApplicationTask `json:"-"` // Info about the requested task
*types.LabelDefinition `json:"-"` // Info about the used label definition
*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 (t *TaskSnapshot) Clone() drivers.ResourceDriverTask
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, def *types.LabelDefinition, res *types.Resource)
Click to show internal directories.
Click to hide internal directories.