| @@ -176,4 +176,38 @@ type ( | |||||
| GetDeployTasksByTypeResp { | GetDeployTasksByTypeResp { | ||||
| List interface{} `json:"list"` | List interface{} `json:"list"` | ||||
| } | } | ||||
| CreateDeployTaskReq { | |||||
| TaskName string `form:"taskName"` | |||||
| TaskDesc string `form:"taskDesc"` | |||||
| ModelName string `form:"modelName"` | |||||
| ModelType string `form:"modelType"` | |||||
| AdapterClusterMap map[string]string `form:"adapterClusterMap"` | |||||
| } | |||||
| CreateDeployTaskResp { | |||||
| } | |||||
| GetAdaptersByModelReq { | |||||
| ModelName string `form:"modelName"` | |||||
| ModelType string `form:"modelType"` | |||||
| } | |||||
| GetAdaptersByModelResp { | |||||
| Adapters []AdapterAvail `json:"adapters"` | |||||
| } | |||||
| AdapterAvail { | |||||
| AdapterId string `json:"adapterId"` | |||||
| AdapterName string `json:"taskName"` | |||||
| Clusters []ClusterAvail `json:"clusters"` | |||||
| } | |||||
| ClusterAvail { | |||||
| ClusterId string `json:"clusterId"` | |||||
| ClusterName string `json:"clusterName"` | |||||
| } | |||||
| ) | ) | ||||
| @@ -971,6 +971,12 @@ service pcm { | |||||
| @handler GetDeployTasksByType | @handler GetDeployTasksByType | ||||
| get /inference/getDeployTasksByType (GetDeployTasksByTypeReq) returns (GetDeployTasksByTypeResp) | get /inference/getDeployTasksByType (GetDeployTasksByTypeReq) returns (GetDeployTasksByTypeResp) | ||||
| @handler CreateDeployTask | |||||
| get /inference/createDeployTask (CreateDeployTaskReq) returns (CreateDeployTaskResp) | |||||
| @handler GetAdaptersByModel | |||||
| get /inference/getAdaptersByModel (GetAdaptersByModelReq) returns (GetAdaptersByModelResp) | |||||
| } | } | ||||
| @server( | @server( | ||||
| @@ -96,6 +96,7 @@ func (l *DeployInstanceListLogic) GenerateDeployTasks(tasklist []*models.AiDeplo | |||||
| deployTask := &DeployTask{ | deployTask := &DeployTask{ | ||||
| Id: t.Id, | Id: t.Id, | ||||
| Name: t.Name, | Name: t.Name, | ||||
| Desc: t.Desc, | |||||
| Instances: list, | Instances: list, | ||||
| } | } | ||||
| tasks = append(tasks, deployTask) | tasks = append(tasks, deployTask) | ||||
| @@ -106,5 +107,6 @@ func (l *DeployInstanceListLogic) GenerateDeployTasks(tasklist []*models.AiDeplo | |||||
| type DeployTask struct { | type DeployTask struct { | ||||
| Id int64 `json:"id,string"` | Id int64 `json:"id,string"` | ||||
| Name string `json:"name,string"` | Name string `json:"name,string"` | ||||
| Desc string `json:"desc,string"` | |||||
| Instances []*models.AiInferDeployInstance `json:"instances,string"` | Instances []*models.AiInferDeployInstance `json:"instances,string"` | ||||
| } | } | ||||
| @@ -18,6 +18,7 @@ type ICluster interface { | |||||
| StopInferDeployInstance(ctx context.Context, id string) bool | StopInferDeployInstance(ctx context.Context, id string) bool | ||||
| GetInferDeployInstance(ctx context.Context, id string) (*DeployInstance, error) | GetInferDeployInstance(ctx context.Context, id string) (*DeployInstance, error) | ||||
| CreateInferDeployInstance(ctx context.Context, option *option.InferOption) (string, error) | CreateInferDeployInstance(ctx context.Context, option *option.InferOption) (string, error) | ||||
| CheckModelExistence(ctx context.Context, name string, mtype string) bool | |||||
| } | } | ||||
| type IInference interface { | type IInference interface { | ||||
| @@ -543,3 +543,7 @@ func (m *ModelArtsLink) GetInferResult(ctx context.Context, url string, file mul | |||||
| func (m *ModelArtsLink) CreateInferDeployInstance(ctx context.Context, option *option.InferOption) (string, error) { | func (m *ModelArtsLink) CreateInferDeployInstance(ctx context.Context, option *option.InferOption) (string, error) { | ||||
| return "", nil | return "", nil | ||||
| } | } | ||||
| func (m *ModelArtsLink) CheckModelExistence(ctx context.Context, name string, mtype string) bool { | |||||
| return false | |||||
| } | |||||
| @@ -1251,3 +1251,7 @@ func (o *OctopusLink) CreateInferDeployInstance(ctx context.Context, option *opt | |||||
| return resp.Payload.Id, nil | return resp.Payload.Id, nil | ||||
| } | } | ||||
| func (o *OctopusLink) CheckModelExistence(ctx context.Context, name string, mtype string) bool { | |||||
| return false | |||||
| } | |||||
| @@ -885,3 +885,7 @@ func (s *ShuguangAi) GetInferResult(ctx context.Context, url string, file multip | |||||
| func (s *ShuguangAi) CreateInferDeployInstance(ctx context.Context, option *option.InferOption) (string, error) { | func (s *ShuguangAi) CreateInferDeployInstance(ctx context.Context, option *option.InferOption) (string, error) { | ||||
| return "", nil | return "", nil | ||||
| } | } | ||||
| func (s *ShuguangAi) CheckModelExistence(ctx context.Context, name string, mtype string) bool { | |||||
| return false | |||||
| } | |||||