hardware

package
v0.4.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2018 License: Apache-2.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"`
	NetworkCaps hashableNetworkCapabilities `json:"network_caps"`
}

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_in"`
	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) 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