|
|
@@ -877,6 +877,7 @@ func (o *OctopusLink) GetInferUrl(ctx context.Context, option *option.InferOptio |
|
|
Platform: o.platform, |
|
|
Platform: o.platform, |
|
|
PageIndex: o.pageIndex, |
|
|
PageIndex: o.pageIndex, |
|
|
PageSize: o.pageSize, |
|
|
PageSize: o.pageSize, |
|
|
|
|
|
SearchKey: DEPLOY_INSTANCE_PREFIEX, |
|
|
} |
|
|
} |
|
|
list, err := o.octopusRpc.GetNotebookList(ctx, req) |
|
|
list, err := o.octopusRpc.GetNotebookList(ctx, req) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
@@ -885,9 +886,9 @@ func (o *OctopusLink) GetInferUrl(ctx context.Context, option *option.InferOptio |
|
|
|
|
|
|
|
|
var imageUrls []*inference.InferUrl |
|
|
var imageUrls []*inference.InferUrl |
|
|
for _, notebook := range list.Payload.GetNotebooks() { |
|
|
for _, notebook := range list.Payload.GetNotebooks() { |
|
|
if strings.Contains(notebook.AlgorithmName, option.ModelName) && notebook.Status == "running" { |
|
|
|
|
|
|
|
|
if strings.Contains(notebook.Desc, option.ModelName) && notebook.Status == "running" { |
|
|
url := strings.Replace(notebook.Tasks[0].Url, FORWARD_SLASH, "", -1) |
|
|
url := strings.Replace(notebook.Tasks[0].Url, FORWARD_SLASH, "", -1) |
|
|
names := strings.Split(notebook.AlgorithmName, UNDERSCORE) |
|
|
|
|
|
|
|
|
names := strings.Split(notebook.Desc, FORWARD_SLASH) |
|
|
imageUrl := &inference.InferUrl{ |
|
|
imageUrl := &inference.InferUrl{ |
|
|
Url: DOMAIN + url, |
|
|
Url: DOMAIN + url, |
|
|
Card: names[2], |
|
|
Card: names[2], |
|
|
@@ -955,5 +956,23 @@ func (o *OctopusLink) StopInferDeployInstance(ctx context.Context, id string) bo |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func (o *OctopusLink) GetInferDeployInstance(ctx context.Context, id string) (*inference.DeployInstance, error) { |
|
|
func (o *OctopusLink) GetInferDeployInstance(ctx context.Context, id string) (*inference.DeployInstance, error) { |
|
|
return nil, nil |
|
|
|
|
|
|
|
|
ins := &inference.DeployInstance{} |
|
|
|
|
|
|
|
|
|
|
|
req := &octopus.GetNotebookReq{ |
|
|
|
|
|
Platform: o.platform, |
|
|
|
|
|
Id: id, |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
resp, err := o.octopusRpc.GetNotebook(ctx, req) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil, err |
|
|
|
|
|
} |
|
|
|
|
|
if resp.Payload == nil { |
|
|
|
|
|
return nil, errors.New("instance does not exist") |
|
|
|
|
|
} |
|
|
|
|
|
ins.InstanceName = resp.Payload.Notebook.Name |
|
|
|
|
|
ins.InstanceId = resp.Payload.Notebook.Id |
|
|
|
|
|
ins.ClusterName = o.platform |
|
|
|
|
|
ins.Status = resp.Payload.Notebook.Status |
|
|
|
|
|
return ins, nil |
|
|
} |
|
|
} |