compute

package
v0.0.0-...-b49685a Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *computeMongoAccessor

New creates a new instance of the computeMongoAccessor

Types

type AccessEnum

type AccessEnum int
const (
	SSH AccessEnum = iota
	SSH_KUBE_API
	SSH_SLURM
	SSH_DOCKER
	OPENCLOUD
	VPN
)

func (AccessEnum) String

func (a AccessEnum) String() string

type CPU

type CPU struct {
	Cores         uint   `bson:"cores,omitempty" json:"cores,omitempty"`               //TODO: validate
	Architecture  string `bson:"architecture,omitempty" json:"architecture,omitempty"` //TOOD: enum
	Shared        bool   `bson:"shared,omitempty" json:"shared,omitempty"`
	MinimumMemory uint   `bson:"minimum_memory,omitempty" json:"minimum_memory,omitempty"`
	Platform      string `bson:"platform,omitempty" json:"platform,omitempty"`
}

CPU is a struct that represents a CPU

type ComputeResource

type ComputeResource struct {
	resource_model.AbstractResource
	Technology   TechnologyEnum `json:"technology" bson:"technology" default:"0"`             // Technology is the technology
	Architecture string         `json:"architecture,omitempty" bson:"architecture,omitempty"` // Architecture is the architecture
	Access       AccessEnum     `json:"access" bson:"access default:"0"`                      // Access is the access

	Localisation string `json:"localisation,omitempty" bson:"localisation,omitempty"` // Localisation is the localisation

	CPUs []*CPU `bson:"cpus,omitempty" json:"cpus,omitempty"` // CPUs is the list of CPUs
	RAM  *RAM   `bson:"ram,omitempty" json:"ram,omitempty"`   // RAM is the RAM
	GPUs []*GPU `bson:"gpus,omitempty" json:"gpus,omitempty"` // GPUs is the list of GPUs
}

* ComputeResource is a struct that represents a compute resource * it defines the resource compute

func (*ComputeResource) Deserialize

func (dma *ComputeResource) Deserialize(j map[string]interface{}) utils.DBObject

func (*ComputeResource) GetAccessor

func (d *ComputeResource) GetAccessor(caller *tools.HTTPCaller) utils.Accessor

func (*ComputeResource) Serialize

func (dma *ComputeResource) Serialize() map[string]interface{}

type GPU

type GPU struct {
	CudaCores   uint   `bson:"cuda_cores,omitempty" json:"cuda_cores,omitempty"`
	Model       string `bson:"model,omitempty" json:"model,omitempty"`
	Memory      uint   `bson:"memory,omitempty" json:"memory,omitempty" description:"Units in MB"`
	TensorCores uint   `bson:"tensor_cores,omitempty" json:"tensor_cores,omitempty"`
}

type RAM

type RAM struct {
	Size uint `bson:"size,omitempty" json:"size,omitempty" description:"Units in MB"`
	Ecc  bool `bson:"ecc,omitempty" json:"ecc,omitempty"`
}

type TechnologyEnum

type TechnologyEnum int
const (
	DOCKER TechnologyEnum = iota
	KUBERNETES
	SLURM
	HW
	CONDOR
)

func (TechnologyEnum) String

func (t TechnologyEnum) String() string

Jump to

Keyboard shortcuts

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