From f63cbcd6c82a8af0e440d66a7021dcd2ca1b620f Mon Sep 17 00:00:00 2001 From: tzwang Date: Mon, 9 Dec 2024 09:24:31 +0800 Subject: [PATCH] updated openi --- internal/scheduler/service/aiService.go | 7 ++++ internal/storeLink/openi.go | 48 +++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/internal/scheduler/service/aiService.go b/internal/scheduler/service/aiService.go index 1af4f282..63588006 100644 --- a/internal/scheduler/service/aiService.go +++ b/internal/scheduler/service/aiService.go @@ -21,6 +21,7 @@ const ( OCTOPUS = "octopus" MODELARTS = "modelarts" SHUGUANGAI = "shuguangAi" + OPENI = "openi" ) type AiService struct { @@ -88,6 +89,12 @@ func InitAiClusterMap(conf *config.Config, clusters []types.ClusterInfo) (map[st collectorMap[c.Id] = sgai executorMap[c.Id] = sgai inferenceMap[c.Id] = sgai + case OPENI: + id, _ := strconv.ParseInt(c.Id, 10, 64) + openi := storeLink.NewOpenI(c.Server, id, c.Username, c.Token) + collectorMap[c.Id] = openi + executorMap[c.Id] = openi + inferenceMap[c.Id] = openi } } diff --git a/internal/storeLink/openi.go b/internal/storeLink/openi.go index 5ee546e2..597d0c06 100644 --- a/internal/storeLink/openi.go +++ b/internal/storeLink/openi.go @@ -4,9 +4,12 @@ import ( "bytes" "context" "encoding/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/schedulers/option" "gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/service/collector" + "gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/service/inference" "gitlink.org.cn/JointCloud/pcm-openi/common" "gitlink.org.cn/JointCloud/pcm-openi/model" + "mime/multipart" "net/http" "strconv" "strings" @@ -42,6 +45,51 @@ func NewOpenI(host string, id int64, name string, token string) *OpenI { } } +func (o OpenI) Execute(ctx context.Context, option *option.AiOption) (interface{}, error) { + //TODO implement me + panic("implement me") +} + +func (o OpenI) GetClusterInferUrl(ctx context.Context, option *option.InferOption) (*inference.ClusterInferUrl, error) { + //TODO implement me + panic("implement me") +} + +func (o OpenI) GetInferDeployInstanceList(ctx context.Context) ([]*inference.DeployInstance, error) { + //TODO implement me + panic("implement me") +} + +func (o OpenI) StartInferDeployInstance(ctx context.Context, id string) bool { + //TODO implement me + panic("implement me") +} + +func (o OpenI) StopInferDeployInstance(ctx context.Context, id string) bool { + //TODO implement me + panic("implement me") +} + +func (o OpenI) GetInferDeployInstance(ctx context.Context, id string) (*inference.DeployInstance, error) { + //TODO implement me + panic("implement me") +} + +func (o OpenI) CreateInferDeployInstance(ctx context.Context, option *option.InferOption) (string, error) { + //TODO implement me + panic("implement me") +} + +func (o OpenI) CheckModelExistence(ctx context.Context, modelName string, modelType string) bool { + //TODO implement me + panic("implement me") +} + +func (o OpenI) GetImageInferResult(ctx context.Context, url string, file multipart.File, fileName string) (string, error) { + //TODO implement me + panic("implement me") +} + func (o OpenI) GetResourceStats(ctx context.Context) (*collector.ResourceStats, error) { //TODO implement me panic("implement me")