Browse Source

added createDeployTask apis

Former-commit-id: e3e9a46352
pull/291/head
tzwang 1 year ago
parent
commit
d0dbb2fe99
7 changed files with 55 additions and 0 deletions
  1. +34
    -0
      desc/inference/inference.api
  2. +6
    -0
      desc/pcm.api
  3. +2
    -0
      internal/logic/inference/deployinstancelistlogic.go
  4. +1
    -0
      internal/scheduler/service/inference/inference.go
  5. +4
    -0
      internal/storeLink/modelarts.go
  6. +4
    -0
      internal/storeLink/octopus.go
  7. +4
    -0
      internal/storeLink/shuguangai.go

+ 34
- 0
desc/inference/inference.api View File

@@ -176,4 +176,38 @@ type (
GetDeployTasksByTypeResp {
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"`
}


)

+ 6
- 0
desc/pcm.api View File

@@ -971,6 +971,12 @@ service pcm {

@handler GetDeployTasksByType
get /inference/getDeployTasksByType (GetDeployTasksByTypeReq) returns (GetDeployTasksByTypeResp)

@handler CreateDeployTask
get /inference/createDeployTask (CreateDeployTaskReq) returns (CreateDeployTaskResp)

@handler GetAdaptersByModel
get /inference/getAdaptersByModel (GetAdaptersByModelReq) returns (GetAdaptersByModelResp)
}

@server(


+ 2
- 0
internal/logic/inference/deployinstancelistlogic.go View File

@@ -96,6 +96,7 @@ func (l *DeployInstanceListLogic) GenerateDeployTasks(tasklist []*models.AiDeplo
deployTask := &DeployTask{
Id: t.Id,
Name: t.Name,
Desc: t.Desc,
Instances: list,
}
tasks = append(tasks, deployTask)
@@ -106,5 +107,6 @@ func (l *DeployInstanceListLogic) GenerateDeployTasks(tasklist []*models.AiDeplo
type DeployTask struct {
Id int64 `json:"id,string"`
Name string `json:"name,string"`
Desc string `json:"desc,string"`
Instances []*models.AiInferDeployInstance `json:"instances,string"`
}

+ 1
- 0
internal/scheduler/service/inference/inference.go View File

@@ -18,6 +18,7 @@ type ICluster interface {
StopInferDeployInstance(ctx context.Context, id string) bool
GetInferDeployInstance(ctx context.Context, id string) (*DeployInstance, error)
CreateInferDeployInstance(ctx context.Context, option *option.InferOption) (string, error)
CheckModelExistence(ctx context.Context, name string, mtype string) bool
}

type IInference interface {


+ 4
- 0
internal/storeLink/modelarts.go View File

@@ -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) {
return "", nil
}

func (m *ModelArtsLink) CheckModelExistence(ctx context.Context, name string, mtype string) bool {
return false
}

+ 4
- 0
internal/storeLink/octopus.go View File

@@ -1251,3 +1251,7 @@ func (o *OctopusLink) CreateInferDeployInstance(ctx context.Context, option *opt

return resp.Payload.Id, nil
}

func (o *OctopusLink) CheckModelExistence(ctx context.Context, name string, mtype string) bool {
return false
}

+ 4
- 0
internal/storeLink/shuguangai.go View File

@@ -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) {
return "", nil
}

func (s *ShuguangAi) CheckModelExistence(ctx context.Context, name string, mtype string) bool {
return false
}

Loading…
Cancel
Save