Documentation ¶
Index ¶
- type DeviceMapping
- type Hardware
- func (h *Hardware) AskPlanResources() *sonm.AskPlanResources
- func (h *Hardware) FullBenchmarks() (*sonm.Benchmarks, error)
- func (m *Hardware) GPUIDs(gpuResources *sonm.AskPlanGPU) ([]gpu.GPUID, error)
- func (h *Hardware) Hash() string
- func (m *Hardware) HashGPU(indexes []uint64) ([]string, error)
- func (h *Hardware) IntoProto() *sonm.DevicesReply
- func (h *Hardware) LimitTo(resources *sonm.AskPlanResources) (*Hardware, error)
- func (h *Hardware) LogicalCPUCount() int
- func (h *Hardware) ResourcesToBenchmarkMap(resources *sonm.AskPlanResources) (benchmarks map[uint64]*sonm.Benchmark, err error)
- func (h *Hardware) ResourcesToBenchmarks(resources *sonm.AskPlanResources) (*sonm.Benchmarks, error)
- func (h *Hardware) SetDevicesFromBenches()
- func (h *Hardware) SetNetworkIncoming(IPs []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceMapping ¶ added in v0.4.1
type DeviceMapping struct { CPU *sonm.CPUDevice `json:"cpu"` GPU []*sonm.GPUDevice `json:"gpu"` RAM hashableRAM `json:"ram"` NetworkIn uint64 `json:"network_in"` NetworkOut uint64 `json:"network_out"` Storage *sonm.StorageDevice `json:"storage"` NetFlags *sonm.NetFlags `json:"netflags"` }
DeviceMapping maps hardware capabilities to device description, hashing-friendly
func (*DeviceMapping) Hash ¶ added in v0.4.1
func (dm *DeviceMapping) Hash() string
type Hardware ¶
type Hardware struct { CPU *sonm.CPU `json:"cpu"` GPU []*sonm.GPU `json:"gpu"` RAM *sonm.RAM `json:"ram"` Network *sonm.Network `json:"network"` Storage *sonm.Storage `json:"storage"` }
Hardware accumulates the finest hardware information about system the worker is running on.
func NewHardware ¶ added in v0.4.1
NewHardware returns initial hardware capabilities for Worker's host. Parts of the struct may be filled later by HW-plugins.
func (*Hardware) AskPlanResources ¶ added in v0.4.1
func (h *Hardware) AskPlanResources() *sonm.AskPlanResources
func (*Hardware) FullBenchmarks ¶ added in v0.4.1
func (*Hardware) LimitTo ¶ added in v0.4.1
This one is very similar to ResourcesToBenchmarkMap except it stores corresponding benchmarks in corresponding devices. This can not be simply reused due to MIN splitting algorithm (e.g. GPU mem - in this case it is stored separately) TODO: find a way to refactor all this shit.
func (*Hardware) LogicalCPUCount ¶
LogicalCPUCount returns the number of logical CPUs in the system.
Method is deprecated.
func (*Hardware) ResourcesToBenchmarkMap ¶ added in v0.4.1
func (*Hardware) ResourcesToBenchmarks ¶ added in v0.4.1
func (*Hardware) SetDevicesFromBenches ¶ added in v0.4.1
func (h *Hardware) SetDevicesFromBenches()