2024-12-12 16:25:47 +01:00
|
|
|
package common
|
|
|
|
|
|
|
|
// CPU is a struct that represents a CPU
|
|
|
|
type CPU struct {
|
2025-01-14 11:28:16 +01:00
|
|
|
Model string `bson:"model,omitempty" json:"model,omitempty"`
|
|
|
|
FrequencyGhz float64 `bson:"frequency,omitempty" json:"frequency,omitempty"`
|
2024-12-12 16:25:47 +01:00
|
|
|
Cores int `bson:"cores,omitempty" json:"cores,omitempty"`
|
|
|
|
Architecture string `bson:"architecture,omitempty" json:"architecture,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type RAM struct {
|
|
|
|
SizeGb float64 `bson:"size,omitempty" json:"size,omitempty" description:"Units in MB"`
|
|
|
|
Ecc bool `bson:"ecc" json:"ecc" default:"true"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type GPU struct {
|
2025-01-14 11:28:16 +01:00
|
|
|
Model string `bson:"model,omitempty" json:"model,omitempty"`
|
|
|
|
MemoryGb float64 `bson:"memory,omitempty" json:"memory,omitempty" description:"Units in MB"`
|
|
|
|
Cores map[string]int `bson:"cores,omitempty" json:"cores,omitempty"`
|
2024-12-12 16:25:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type InfrastructureType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
DOCKER InfrastructureType = iota
|
|
|
|
KUBERNETES
|
|
|
|
SLURM
|
|
|
|
HW
|
|
|
|
CONDOR
|
|
|
|
)
|
|
|
|
|
|
|
|
func (t InfrastructureType) String() string {
|
|
|
|
return [...]string{"DOCKER", "KUBERNETES", "SLURM", "HW", "CONDOR"}[t]
|
|
|
|
}
|