Improved models' structure

This commit is contained in:
pb
2024-07-17 17:17:37 +02:00
parent f0eec45836
commit 3732187678
6 changed files with 69 additions and 65 deletions

View File

@@ -1,28 +1,28 @@
package oclib
type Processing struct {
Resource
Container string `json:"Container"` // We could create a specific class for container, that could check if the name exists/is available
Repository string `json:"Repository"` // Indicate where to find the container image => Could add a struct handling authentication to the repo
Command string `json:"Command"`
Arguments []string `json:"Arguments"`
Environment []map[string]string `json:"Environment"` // a key/value struct is what ressembles the most a NAME=VALUE struct
AbstractResource `json:"resource" required:"true"`
Container string `json:"container,omitempty"` // We could create a specific class for container, that could check if the name exists/is available
Repository string `json:"repository,omitempty"` // Indicate where to find the container image => Could add a struct handling authentication to the repo
Command string `json:"command,omitempty"`
Arguments []string `json:"arguments,omitempty"`
Environment []map[string]string `json:"environment,omitempty"` // a key/value struct is what ressembles the most a NAME=VALUE struct
ExecutionRequirements ExecutionRequirementsModel `json:"ExecutionRequirements"`
ExecutionRequirements ExecutionRequirementsModel `json:"execution_requirements,omitempty"`
Price uint `json:"price,omitempty"`
License string `json:"license,omitempty"`
Price uint `json:"Price"`
License string `json:"License"`
}
type ExecutionRequirementsModel struct {
CPUs uint `json:"cpus" required:"true"`
GPUs uint `json:"gpus" description:"Amount of GPUs needed"`
RAM uint `json:"ram" required:"true" description:"Units in MB"`
CPUs uint `json:"cp_us,omitempty"`
GPUs uint `json:"gp_us,omitempty"`
RAM uint `json:"ram,omitempty"`
Parallel bool `json:"parallel"`
ScalingModel uint `json:"scaling_model"`
DiskIO string `json:"disk_io"`
Parallel bool `json:"parallel,omitempty"`
ScalingModel uint `json:"scaling_model,omitempty"`
DiskIO string `json:"disk_io,omitempty"`
}
func (p *Processing) GetType() ResourceType{