applied models changes

This commit is contained in:
pb 2024-03-18 11:25:59 +01:00
parent f35c1f6190
commit 2767ac4158
7 changed files with 29 additions and 16 deletions

View File

@ -21,6 +21,10 @@ For each instance of a computing component we can specify :
- **arguments**, which will be passed to the entrypoint
- **Environment variables**
The fields **input** and **output** list the different links coming in and out of the computing components.
> [!] This is redundant with the Links object that we create when parsing the XML in oc-scheduler, might be better to remove them if proved redundant
## Datacenter
A datacenter is identified by its **DC acronym** which is a very short form of its name.

View File

@ -0,0 +1,5 @@
# Code
- [ ] In most of the components from 'models/' we have a method to add input and output to the model, however this linking of components is already done in oc-schedule when parsing the MxGraph. We need to determine if adding relations between components inside the objects themself is necessary.
- When running in debug mode with a breakpoint inside the first line of computing.addLink it is only called once
- [ ]

View File

@ -27,30 +27,30 @@ type RepositoryModel struct {
}
type ComputingNEWModel struct {
Description string `json:"description,omitempty" required:"true"`
Name string `json:"name,omitempty" required:"true" validate:"required" description:"Name of the computing"`
Description string `json:"description,omitempty" required:"true"`
ShortDescription string `json:"short_description,omitempty" required:"true" validate:"required"`
Logo string `json:"logo,omitempty" required:"true" validate:"required"`
Type string `json:"type,omitempty" required:"true"`
// Type string `json:"type,omitempty" required:"true"`
Owner string `json:"owner,omitempty"`
License string `json:"license,omitempty"`
Price uint `json:"price,omitempty"`
ExecutionRequirements ExecutionRequirementsModel `json:"execution_requirements,omitempty"`
Dinputs []string `json:"dinputs,omitempty"`
Doutputs []string `json:"doutputs,omitempty"`
// Dinputs []string `json:"dinputs,omitempty"` // Possibly redundant with Links object in oc-schedule
// Doutputs []string `json:"doutputs,omitempty"` // Possibly redundant with Links objects in oc-schedule
Image string `json:"image,omitempty"`
Command string `json:"command,omitempty"`
Arguments []string `json:"arguments,omitempty"`
Environment []string `json:"environment,omitempty"`
Ports []string `json:"ports,omitempty"`
// Ports []string `json:"ports,omitempty"`
CustomDeployment string `json:"custom_deployment,omitempty"`
// CustomDeployment string `json:"custom_deployment,omitempty"`
Repository RepositoryModel `json:"repository,omitempty"`
// Repository RepositoryModel `json:"repository,omitempty"`
}
type ComputingModel struct {

View File

@ -11,15 +11,15 @@ import (
// TODO: review why swagger are not using the metadata when we do herarchy
type DataNEWModel struct {
Name string `json:"name,omitempty" required:"true" validate:"required" description:"Name of the data"`
Description string `json:"description" required:"true" validate:"required"`
ShortDescription string `json:"short_description" required:"true" validate:"required"`
Logo string `json:"logo" required:"true" validate:"required"`
Description string `json:"description" required:"true" validate:"required"`
// Dtype string `json:"dtype"`
Type string `json:"type,omitempty" required:"true" validate:"required" description:"Define type of data" example:"file"`
Example string `json:"example" required:"true" validate:"required" description:"base64 encoded data"`
Location string `json:"location" required:"true" validate:"required"`
Dtype string `json:"dtype"`
Protocol []string `json:"protocol"` //TODO Enum type
Location string `json:"location" required:"true" validate:"required"`
}
type DataModel struct {

View File

@ -32,9 +32,9 @@ type DatacenterGpuModel struct {
type DatacenterNEWModel struct {
Name string `json:"name" required:"true"`
Type string `json:"type,omitempty" required:"true"`
// Type string `json:"type,omitempty" required:"true"`
Acronym string `json:"acronym" required:"true" description:"id of the DC"`
Hosts []string `json:"hosts" required:"true" description:"list of host:port"`
// Hosts []string `json:"hosts" required:"true" description:"list of host:port"`
Description string `json:"description" required:"true"`
ShortDescription string `json:"short_description" required:"true" validate:"required"`
Logo string `json:"logo" required:"true" validate:"required"`

View File

@ -12,9 +12,10 @@ type StorageNEWModel struct {
Description string `json:"description" required:"true"`
ShortDescription string `json:"short_description" required:"true" validate:"required"`
Logo string `json:"logo" required:"true" validate:"required"`
Type string `json:"type,omitempty" required:"true"`
// Type string `json:"type,omitempty" required:"true"`
DCacronym string `json:"DCacronym" required:"true" description:"Unique ID of the DC where it is the storage"`
URL string `json:"URL"`
Size uint `json:"size" required:"true"`
Encryption bool `json:"encryption" `

View File

@ -255,7 +255,8 @@
"throughput": "r:200,w:150",
"bookingPrice": 60,
"inputs": [],
"outputs": []
"outputs": [],
"URL" : ""
},
{
"name": "IRT local file storage",
@ -270,7 +271,8 @@
"throughput": "r:300,w:350",
"bookingPrice": 90,
"inputs": [],
"outputs": []
"outputs": [],
"URL" : ""
},
{
"name": "Mosquito server",
@ -285,7 +287,8 @@
"throughput": "r:300,w:350",
"bookingPrice": 90,
"inputs": [],
"outputs": []
"outputs": [],
"URL" : ""
}
]
},