adding inputs output struct based on argo naming for now
This commit is contained in:
@@ -17,11 +17,9 @@ import (
|
||||
"cloud.o-forge.io/core/oc-lib/models"
|
||||
"cloud.o-forge.io/core/oc-lib/models/collaborative_area"
|
||||
"cloud.o-forge.io/core/oc-lib/models/collaborative_area/rules/rule"
|
||||
mm "cloud.o-forge.io/core/oc-lib/models/common/models"
|
||||
"cloud.o-forge.io/core/oc-lib/models/order"
|
||||
"cloud.o-forge.io/core/oc-lib/models/peer"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources/resource_model"
|
||||
"cloud.o-forge.io/core/oc-lib/models/utils"
|
||||
w2 "cloud.o-forge.io/core/oc-lib/models/workflow"
|
||||
"cloud.o-forge.io/core/oc-lib/models/workflow_execution"
|
||||
@@ -198,56 +196,6 @@ func SetConfig(mongoUrl string, database string, natsUrl string, lokiUrl string,
|
||||
}()
|
||||
logs.CreateLogger("main")
|
||||
mongo.MONGOService.Init(models.GetModelsNames(), config.GetConfig()) // init the mongo service
|
||||
/*
|
||||
Here we will check if the resource model is already stored in the database
|
||||
If not we will store it
|
||||
Resource model is the model that will define the structure of the resources
|
||||
*/
|
||||
accessor := (&resource_model.ResourceModel{}).GetAccessor(nil)
|
||||
for _, model := range []string{tools.DATA_RESOURCE.String(), tools.PROCESSING_RESOURCE.String(), tools.STORAGE_RESOURCE.String(), tools.COMPUTE_RESOURCE.String(), tools.WORKFLOW_RESOURCE.String()} {
|
||||
data, code, _ := accessor.Search(nil, model, true)
|
||||
if code == 404 || len(data) == 0 {
|
||||
var modelref map[string]map[string]resource_model.Model
|
||||
outputs := []mm.Param{}
|
||||
// for now only processing is specified here (not an elegant way)
|
||||
if model == tools.DATA_RESOURCE.String() || model == tools.STORAGE_RESOURCE.String() {
|
||||
outputs = []mm.Param{
|
||||
{
|
||||
Attr: "source",
|
||||
Readonly: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
if model == tools.PROCESSING_RESOURCE.String() {
|
||||
m := map[string]resource_model.Model{}
|
||||
m["command"] = resource_model.Model{
|
||||
Type: "string",
|
||||
ReadOnly: false,
|
||||
}
|
||||
m["args"] = resource_model.Model{
|
||||
Type: "string",
|
||||
ReadOnly: false,
|
||||
}
|
||||
m["env"] = resource_model.Model{
|
||||
Type: "string",
|
||||
ReadOnly: false,
|
||||
}
|
||||
m["volumes"] = resource_model.Model{
|
||||
Type: "map[string]string",
|
||||
ReadOnly: false,
|
||||
}
|
||||
modelref = map[string]map[string]resource_model.Model{
|
||||
"container": m,
|
||||
}
|
||||
}
|
||||
|
||||
accessor.StoreOne(&resource_model.ResourceModel{
|
||||
ResourceType: model,
|
||||
Outputs: outputs,
|
||||
Model: modelref,
|
||||
})
|
||||
}
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user