From 4e63d24aa4413e8fd32b753aac20f8836879ca45 Mon Sep 17 00:00:00 2001 From: tzwang Date: Thu, 18 Jul 2024 11:05:19 +0800 Subject: [PATCH] added DeployInstanceList Former-commit-id: 8c76d8c87f1217a635dffb0c6720da9622ebade3 --- internal/scheduler/service/inference/inference.go | 5 ++++- .../service/inference/textInference/textInference.go | 5 ++--- .../service/inference/textInference/textToImage.go | 10 +--------- .../service/inference/textInference/textToText.go | 9 +-------- internal/storeLink/modelarts.go | 4 ++++ internal/storeLink/octopus.go | 4 ++++ internal/storeLink/shuguangai.go | 4 ++++ 7 files changed, 20 insertions(+), 21 deletions(-) diff --git a/internal/scheduler/service/inference/inference.go b/internal/scheduler/service/inference/inference.go index 88539a31..23b2dbc2 100644 --- a/internal/scheduler/service/inference/inference.go +++ b/internal/scheduler/service/inference/inference.go @@ -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 { +} diff --git a/internal/scheduler/service/inference/textInference/textInference.go b/internal/scheduler/service/inference/textInference/textInference.go index 42afa5d7..c0709c21 100644 --- a/internal/scheduler/service/inference/textInference/textInference.go +++ b/internal/scheduler/service/inference/textInference/textInference.go @@ -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 } diff --git a/internal/scheduler/service/inference/textInference/textToImage.go b/internal/scheduler/service/inference/textInference/textToImage.go index fc1e41c4..7fe2496c 100644 --- a/internal/scheduler/service/inference/textInference/textToImage.go +++ b/internal/scheduler/service/inference/textInference/textToImage.go @@ -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 } diff --git a/internal/scheduler/service/inference/textInference/textToText.go b/internal/scheduler/service/inference/textInference/textToText.go index 0319bda7..9d9beb71 100644 --- a/internal/scheduler/service/inference/textInference/textToText.go +++ b/internal/scheduler/service/inference/textInference/textToText.go @@ -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 } diff --git a/internal/storeLink/modelarts.go b/internal/storeLink/modelarts.go index b907707b..fc48c8ea 100644 --- a/internal/storeLink/modelarts.go +++ b/internal/storeLink/modelarts.go @@ -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 +} diff --git a/internal/storeLink/octopus.go b/internal/storeLink/octopus.go index 38408ca6..e3b4c73e 100644 --- a/internal/storeLink/octopus.go +++ b/internal/storeLink/octopus.go @@ -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 +} diff --git a/internal/storeLink/shuguangai.go b/internal/storeLink/shuguangai.go index e2e405d2..b6647f84 100644 --- a/internal/storeLink/shuguangai.go +++ b/internal/storeLink/shuguangai.go @@ -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 +}