From 2d249f38ffac86d0088829e36a243a3b8f43f82f Mon Sep 17 00:00:00 2001 From: mr Date: Thu, 7 Nov 2024 11:36:31 +0100 Subject: [PATCH] rebrand oc-datacenter in oc-compute --- models/resources/compute/compute.go | 25 +++++++++++++++++++++++++ models/resources/storage/storage.go | 16 ++++++++-------- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/models/resources/compute/compute.go b/models/resources/compute/compute.go index d487524..5eb1405 100644 --- a/models/resources/compute/compute.go +++ b/models/resources/compute/compute.go @@ -8,12 +8,37 @@ import ( "cloud.o-forge.io/core/oc-lib/tools" ) +type TechnologyEnum int +const( + DOCKER TechnologyEnum = iota + KUBERNETES, + SLURM, + HW, + CONDOR +) + +type AccessEnum int +const( + SSH AccessEnum = iota + SSH_KUBE_API, + SSH_SLURM, + SSH_DOCKER, + OPENCLOUD, + VPN +) + /* * ComputeResource is a struct that represents a compute resource * it defines the resource compute */ type ComputeResource struct { resource_model.AbstractResource + Technology TechnologyEnum `json:"technology,omitempty" bson:"technology,omitempty"` // Technology is the technology + Architecture string `json:"architecture,omitempty" bson:"architecture,omitempty"` // Architecture is the architecture + Access AccessEnum `json:"access,omitempty" bson:"access,omitempty"` // 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 diff --git a/models/resources/storage/storage.go b/models/resources/storage/storage.go index 2e97c36..b173c58 100644 --- a/models/resources/storage/storage.go +++ b/models/resources/storage/storage.go @@ -29,15 +29,15 @@ func (dma StorageType) ToArgo() string { } // enum of a data type -type StorageType string +type StorageType int const ( - FILE = "file" - STREAM = "stream" - API = "api" - DATABASE = "database" - S3 = "s3" - MEMORY = "memory" - HARDWARE = "hardware" + FILE = iota + STREAM + API + DATABASE + S3 + MEMORY + HARDWARE ) /*