hardware

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: GPL-3.0 Imports: 12 Imported by: 3

Documentation

Index

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

func NewHardware() (*Hardware, error)

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 (h *Hardware) FullBenchmarks() (*sonm.Benchmarks, error)

func (*Hardware) GPUIDs added in v0.4.1

func (m *Hardware) GPUIDs(gpuResources *sonm.AskPlanGPU) ([]gpu.GPUID, error)

func (*Hardware) Hash added in v0.4.1

func (h *Hardware) Hash() string

func (*Hardware) HashGPU added in v0.4.1

func (m *Hardware) HashGPU(indexes []uint64) ([]string, error)

func (*Hardware) IntoProto

func (h *Hardware) IntoProto() *sonm.DevicesReply

func (*Hardware) LimitTo added in v0.4.1

func (h *Hardware) LimitTo(resources *sonm.AskPlanResources) (*Hardware, error)

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

func (h *Hardware) LogicalCPUCount() int

LogicalCPUCount returns the number of logical CPUs in the system.

Method is deprecated.

func (*Hardware) ResourcesToBenchmarkMap added in v0.4.1

func (h *Hardware) ResourcesToBenchmarkMap(resources *sonm.AskPlanResources) (benchmarks map[uint64]*sonm.Benchmark, err error)

func (*Hardware) ResourcesToBenchmarks added in v0.4.1

func (h *Hardware) ResourcesToBenchmarks(resources *sonm.AskPlanResources) (*sonm.Benchmarks, error)

func (*Hardware) SetDevicesFromBenches added in v0.4.1

func (h *Hardware) SetDevicesFromBenches()

func (*Hardware) SetNetworkIncoming added in v0.4.1

func (h *Hardware) SetNetworkIncoming(IPs []string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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