machines

package
v0.4.159 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateDynamicNtxGpu

func CalculateDynamicNtxGpu(requestedResource, usedResource interface{}) (actualNtx float64)

CalculateDynamicNtxGpu works on the statistics/resource-usage reported by the job which could be different than the actual requested.

func CalculateStaticNtxGpu

func CalculateStaticNtxGpu(depReq models.DeploymentRequest) (estimatedNtx float64)

func DeploymentRequest added in v0.4.159

func DeploymentRequest(ctx, reqCtx context.Context, w http.ResponseWriter, r *http.Request) error

func FilterPeers

func FilterPeers(depReq models.DeploymentRequest, node host.Host) []models.PeerData

FilterPeers searches for available compute providers given specific parameters in depReq.

func RequestService added in v0.4.159

func RequestService(ctx context.Context, depReq models.DeploymentRequest) (*fundingRespToSPD, error)

Types

type AvailableResource

type AvailableResource struct {
	CpuNo     int     `json:"cpu_no"`
	CpuHz     int     `json:"cpu_hz"`
	PriceCpu  float64 `json:"price_cpu"`
	Ram       int     `json:"ram"`
	PriceRam  float64 `json:"price_ram"`
	Vcpu      int     `json:"vcpu"`
	Disk      float64 `json:"disk"`
	PriceDisk float64 `json:"price_disk"`
}

type GpuInfo

type GpuInfo struct {
	Name string `json:"name,omitempty"`
	Vram string `json:"vram,omitempty"`
}

type IP

type IP []any

1. Machines Index

type Machines

type Machines map[string]Peer

type Peer

type Peer struct {
	PeerInfo             PeerInfo          `json:"peer_info,omitempty"`
	IPAddr               IP                `json:"ip_addr,omitempty"`
	AvailableResources   AvailableResource `json:"available_resources,omitempty"`
	TokenomicsAdress     string            `json:"tokenomics_adress,omitempty"`
	TokenomicsBlockchain string            `json:"tokenomics_blockchain,omitempty"`
	HasGpu               string            `json:"has_gpu,omitempty"`
	AllowCardano         string            `json:"allow_cardano,omitempty"`
	GpuInfo              GpuInfo           `json:"gpu_info,omitempty"`
	Timestamp            uint32            `json:"timestamp,omitempty"`
}

type PeerInfo

type PeerInfo struct {
	NodeID    string `json:"nodeID,omitempty"`
	Key       string `json:"key,omitempty"`
	Mid       string `json:"mid,omitempty"`
	PublicKey string `json:"public_key,omitempty"`
	Address   IP     `json:"_address,omitempty"`
}

Jump to

Keyboard shortcuts

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