Merge pull request 'added DeployInstanceList' (#265) from tzwang/pcm-coordinator:master into master
Former-commit-id: dd11146bfca1ca6836730b4fc467e87f534779c2
This commit is contained in:
commit
08bdfd7f1e
|
@ -11,7 +11,7 @@ const (
|
|||
|
||||
type ICluster interface {
|
||||
GetInferUrl(ctx context.Context, option *option.InferOption) ([]*InferUrl, error)
|
||||
//GetInferDeployInstanceList(ctx context.Context, option *option.InferOption)
|
||||
GetInferDeployInstanceList(ctx context.Context, option *option.InferOption) ([]*DeployInstance, error)
|
||||
}
|
||||
|
||||
type IInference interface {
|
||||
|
@ -27,3 +27,6 @@ type InferUrl struct {
|
|||
Url string
|
||||
Card string
|
||||
}
|
||||
|
||||
type DeployInstance struct {
|
||||
}
|
||||
|
|
|
@ -10,8 +10,7 @@ import (
|
|||
type ITextInference interface {
|
||||
SaveAiTask(id int64, adapterName string) error
|
||||
UpdateStatus(aiTaskList []*models.TaskAi, adapterName string) error
|
||||
AppendRoute(urls []*inference.InferUrl) error
|
||||
AiType() string
|
||||
GetAiType() string
|
||||
}
|
||||
|
||||
type FilteredCluster struct {
|
||||
|
@ -73,7 +72,7 @@ func (ti *TextInference) saveTask() (int64, error) {
|
|||
var synergystatus int64
|
||||
var strategyCode int64
|
||||
|
||||
id, err := ti.storage.SaveTask(ti.opt.TaskName, strategyCode, synergystatus, ti.inference.AiType())
|
||||
id, err := ti.storage.SaveTask(ti.opt.TaskName, strategyCode, synergystatus, ti.inference.GetAiType())
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package textInference
|
|||
import (
|
||||
"gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/database"
|
||||
"gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/schedulers/option"
|
||||
"gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/service/inference"
|
||||
"gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/strategy"
|
||||
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/constants"
|
||||
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models"
|
||||
|
@ -36,13 +35,6 @@ func (t *TextToImage) UpdateStatus(aiTaskList []*models.TaskAi, adapterName stri
|
|||
return nil
|
||||
}
|
||||
|
||||
func (t *TextToImage) AppendRoute(urls []*inference.InferUrl) error {
|
||||
for i, _ := range urls {
|
||||
urls[i].Url = urls[i].Url + inference.FORWARD_SLASH + TEXTTOIMAGE
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *TextToImage) AiType() string {
|
||||
func (t *TextToImage) GetAiType() string {
|
||||
return TEXTTOIMAGE_AiTYPE
|
||||
}
|
||||
|
|
|
@ -38,14 +38,7 @@ func NewTextToText(opt *option.InferOption, storage *database.AiStorage, inferAd
|
|||
}, nil
|
||||
}
|
||||
|
||||
func (tt *TextToText) AppendRoute(urls []*inference.InferUrl) error {
|
||||
for i, _ := range urls {
|
||||
urls[i].Url = urls[i].Url + inference.FORWARD_SLASH + CHAT
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (tt *TextToText) AiType() string {
|
||||
func (tt *TextToText) GetAiType() string {
|
||||
return TEXTTOTEXT_AITYPE
|
||||
}
|
||||
|
||||
|
|
|
@ -398,3 +398,7 @@ func (m *ModelArtsLink) GetInferUrl(ctx context.Context, option *option.InferOpt
|
|||
|
||||
return imageUrls, nil
|
||||
}
|
||||
|
||||
func (m *ModelArtsLink) GetInferDeployInstanceList(ctx context.Context, option *option.InferOption) ([]*inference.DeployInstance, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
|
|
@ -903,3 +903,7 @@ func (o *OctopusLink) GetInferUrl(ctx context.Context, option *option.InferOptio
|
|||
}
|
||||
return imageUrls, nil
|
||||
}
|
||||
|
||||
func (o *OctopusLink) GetInferDeployInstanceList(ctx context.Context, option *option.InferOption) ([]*inference.DeployInstance, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
|
|
@ -788,3 +788,7 @@ func (s *ShuguangAi) GetInferUrl(ctx context.Context, option *option.InferOption
|
|||
|
||||
return imageUrls, nil
|
||||
}
|
||||
|
||||
func (s *ShuguangAi) GetInferDeployInstanceList(ctx context.Context, option *option.InferOption) ([]*inference.DeployInstance, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue