Merge pull request 'fix octopus imageinfer url bugs' (#243) from tzwang/pcm-coordinator:master into master
Former-commit-id: 883c58b1d16c242c04d91c1c29acbc67edf545c9
This commit is contained in:
commit
8e81dc9390
|
@ -884,7 +884,7 @@ func (o *OctopusLink) GetImageInferUrl(ctx context.Context, option *option.Infer
|
||||||
|
|
||||||
var imageUrls []*collector.ImageInferUrl
|
var imageUrls []*collector.ImageInferUrl
|
||||||
for _, notebook := range list.Payload.GetNotebooks() {
|
for _, notebook := range list.Payload.GetNotebooks() {
|
||||||
if strings.Contains(notebook.AlgorithmName, option.ModelName) {
|
if strings.Contains(notebook.AlgorithmName, 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.AlgorithmName, UNDERSCORE)
|
||||||
imageUrl := &collector.ImageInferUrl{
|
imageUrl := &collector.ImageInferUrl{
|
||||||
|
@ -896,5 +896,9 @@ func (o *OctopusLink) GetImageInferUrl(ctx context.Context, option *option.Infer
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(imageUrls) == 0 {
|
||||||
|
return nil, errors.New("no infer url available")
|
||||||
|
}
|
||||||
return imageUrls, nil
|
return imageUrls, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue