types

package
v0.0.0-...-7c4e58c Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCapacity   = errors.New("invalid resource capacity")
	ErrInvalidGPUMap     = errors.New("invalid gpu map")
	ErrInvalidGPU        = errors.New("invalid gpu")
	ErrInvalidGPUProduct = errors.New("invalid gpu product")
)

Functions

This section is empty.

Types

type EngineParams

type EngineParams struct {
	ProdCountMap ProdCountMap `json:"prod_count_map" mapstructure:"prod_count_map"`
}

EngineParams .

func (*EngineParams) Add

func (ep *EngineParams) Add(ep1 *EngineParams)

func (*EngineParams) AsRawParams

func (ep *EngineParams) AsRawParams() resourcetypes.RawParams

func (*EngineParams) Count

func (ep *EngineParams) Count() int

func (*EngineParams) DeepCopy

func (ep *EngineParams) DeepCopy() *EngineParams

func (*EngineParams) Parse

func (ep *EngineParams) Parse(rawParams resourcetypes.RawParams) error

func (*EngineParams) Sub

func (ep *EngineParams) Sub(ep1 *EngineParams)

type NUMA

type NUMA map[string]string

NUMA map[address]nodeID

type NodeResource

type NodeResource struct {
	ProdCountMap ProdCountMap `json:"prod_count_map" mapstructure:"prod_count_map"`
}

NodeResource indicate node cpumem resource

func NewNodeResource

func NewNodeResource(gm ProdCountMap) *NodeResource

func (*NodeResource) Add

func (r *NodeResource) Add(r1 *NodeResource)

Add .

func (*NodeResource) AsRawParams

func (r *NodeResource) AsRawParams() resourcetypes.RawParams

func (*NodeResource) Count

func (r *NodeResource) Count() int

Count

func (*NodeResource) DeepCopy

func (r *NodeResource) DeepCopy() *NodeResource

DeepCopy .

func (*NodeResource) Parse

func (r *NodeResource) Parse(rawParams resourcetypes.RawParams) error

Parse .

func (*NodeResource) Sub

func (r *NodeResource) Sub(r1 *NodeResource)

Sub .

func (*NodeResource) Validate

func (r *NodeResource) Validate() error

type NodeResourceInfo

type NodeResourceInfo struct {
	Capacity *NodeResource `json:"capacity"`
	Usage    *NodeResource `json:"usage"`
}

NodeResourceInfo indicate cpumem capacity and usage

func (*NodeResourceInfo) CapCount

func (n *NodeResourceInfo) CapCount() int

func (*NodeResourceInfo) DeepCopy

func (n *NodeResourceInfo) DeepCopy() *NodeResourceInfo

DeepCopy .

func (*NodeResourceInfo) GetAvailableResource

func (n *NodeResourceInfo) GetAvailableResource() *NodeResource

func (*NodeResourceInfo) UsageCount

func (n *NodeResourceInfo) UsageCount() int

func (*NodeResourceInfo) Validate

func (n *NodeResourceInfo) Validate() error

type NodeResourceRequest

type NodeResourceRequest struct {
	ProdCountMap ProdCountMap `json:"prod_count_map" mapstructure:"prod_count_map"`
}

NodeResourceRequest includes all possible fields passed by eru-core for editing node, it not parsed!

func (*NodeResourceRequest) Count

func (n *NodeResourceRequest) Count() int

func (*NodeResourceRequest) LoadFromOrigin

func (n *NodeResourceRequest) LoadFromOrigin(nodeResource *NodeResource, resourceRequest resourcetypes.RawParams)

Merge fields to NodeResourceRequest.

func (*NodeResourceRequest) Parse

func (n *NodeResourceRequest) Parse(rawParams resourcetypes.RawParams) error

func (*NodeResourceRequest) Validate

func (n *NodeResourceRequest) Validate() error

type ProdCountMap

type ProdCountMap map[string]int

func (ProdCountMap) Add

func (pcm ProdCountMap) Add(g1 ProdCountMap)

func (ProdCountMap) DeepCopy

func (pcm ProdCountMap) DeepCopy() ProdCountMap

func (ProdCountMap) RemoveLTE0

func (pcm ProdCountMap) RemoveLTE0()

func (ProdCountMap) Sub

func (pcm ProdCountMap) Sub(g1 ProdCountMap)

func (ProdCountMap) TotalCount

func (pcm ProdCountMap) TotalCount() int

func (ProdCountMap) Validate

func (pcm ProdCountMap) Validate() error

func (ProdCountMap) ValidateCount

func (pcm ProdCountMap) ValidateCount() error

func (ProdCountMap) ValidateProd

func (pcm ProdCountMap) ValidateProd() error

type WorkloadResource

type WorkloadResource struct {
	ProdCountMap ProdCountMap `json:"prod_count_map" mapstructure:"prod_count_map"`
}

WorkloadResource indicate GPU workload resource

func (*WorkloadResource) Add

func (w *WorkloadResource) Add(w1 *WorkloadResource)

Add .

func (*WorkloadResource) AsRawParams

func (w *WorkloadResource) AsRawParams() resourcetypes.RawParams

func (*WorkloadResource) Count

func (w *WorkloadResource) Count() int

Count

func (*WorkloadResource) DeepCopy

func (w *WorkloadResource) DeepCopy() *WorkloadResource

DeepCopy .

func (*WorkloadResource) Parse

func (w *WorkloadResource) Parse(rawParams resourcetypes.RawParams) error

ParseFromRawParams .

func (*WorkloadResource) Sub

func (w *WorkloadResource) Sub(w1 *WorkloadResource)

Sub .

func (*WorkloadResource) Validate

func (w *WorkloadResource) Validate() error

type WorkloadResourceRequest

type WorkloadResourceRequest struct {
	ProdCountMap ProdCountMap `json:"prod_count_map" mapstructure:"prod_count_map"`
}

WorkloadResourceRaw includes all possible fields passed by eru-core for editing workload for request calculation

func (*WorkloadResourceRequest) Count

func (w *WorkloadResourceRequest) Count() int

func (*WorkloadResourceRequest) DeepCopy

func (*WorkloadResourceRequest) MergeFromResource

func (w *WorkloadResourceRequest) MergeFromResource(r *WorkloadResource)

func (*WorkloadResourceRequest) Parse

func (w *WorkloadResourceRequest) Parse(rawParams resourcetypes.RawParams) (err error)

Parse .

func (*WorkloadResourceRequest) Validate

func (w *WorkloadResourceRequest) Validate() error

func (*WorkloadResourceRequest) ValidateProd

func (w *WorkloadResourceRequest) ValidateProd() error

Validate .

Jump to

Keyboard shortcuts

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