Browse Source

Merge pull request 'GPU再次调试问题优化' (#1829) from fix-1718 into V20220415

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/1829
Reviewed-by: ychao_1983 <ychao_1983@sina.com>
tags/v1.22.4.1^2
ychao_1983 3 years ago
parent
commit
65a21dabdd
1 changed files with 18 additions and 0 deletions
  1. +18
    -0
      routers/repo/cloudbrain.go

+ 18
- 0
routers/repo/cloudbrain.go View File

@@ -346,6 +346,24 @@ func CloudBrainRestart(ctx *context.Context) {
break
}

var hasSameResource bool
if gpuInfos == nil {
json.Unmarshal([]byte(setting.GpuTypes), &gpuInfos)
}
for _, resourceType := range gpuInfos.GpuInfo {
if resourceType.Queue == task.GpuQueue {
hasSameResource = true
continue
}
}

if !hasSameResource {
log.Error("has no same resource, can not restart", ctx.Data["MsgID"])
resultCode = "-1"
errorMsg = "the job's version is too old and can not be restarted"
break
}

count, err := models.GetCloudbrainCountByUserID(ctx.User.ID, string(models.JobTypeDebug))
if err != nil {
log.Error("GetCloudbrainCountByUserID failed:%v", err, ctx.Data["MsgID"])


Loading…
Cancel
Save