Browse Source

updated openi

pull/355/head
tzwang 11 months ago
parent
commit
f63cbcd6c8
2 changed files with 55 additions and 0 deletions
  1. +7
    -0
      internal/scheduler/service/aiService.go
  2. +48
    -0
      internal/storeLink/openi.go

+ 7
- 0
internal/scheduler/service/aiService.go View File

@@ -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
}
}



+ 48
- 0
internal/storeLink/openi.go View File

@@ -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")


Loading…
Cancel
Save