Browse Source

Merge branch 'liuzx_trainjob' of https://git.openi.org.cn/OpenI/aiforge into liuzx_trainjob

pull/1071/head
zhoupzh 3 years ago
parent
commit
acc805fd5b
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      routers/repo/modelarts.go

+ 5
- 4
routers/repo/modelarts.go View File

@@ -67,19 +67,20 @@ func DebugJobIndex(ctx *context.Context) {
for i, task := range ciTasks {
if task.Cloudbrain.Type == models.TypeCloudBrainOne {
if task.Status == string(models.JobRunning) && (timestamp-int64(task.Cloudbrain.CreatedUnix) > 10) {
ciTasks[i].CanDebug = true
ciTasks[i].CanDebug = cloudbrain.CanCreateOrDebugJob(ctx)
} else {
ciTasks[i].CanDebug = false
}
ciTasks[i].CanDel = models.CanDelJob(ctx.IsSigned, ctx.User, task)
ciTasks[i].CanDel = cloudbrain.CanDeleteDebugJob(ctx, &task.Cloudbrain)
ciTasks[i].Cloudbrain.ComputeResource = modelarts.GPUResource
}
if task.Cloudbrain.Type == models.TypeCloudBrainTwo {
if task.Status == string(models.JobRunning) {
ciTasks[i].CanDebug = true
ciTasks[i].CanDebug = cloudbrain.CanCreateOrDebugJob(ctx)
} else {
ciTasks[i].CanDebug = false
}
ciTasks[i].CanDel = cloudbrain.CanDeleteDebugJob(ctx, &task.Cloudbrain)
ciTasks[i].Cloudbrain.ComputeResource = modelarts.NPUResource
}

@@ -88,9 +89,9 @@ func DebugJobIndex(ctx *context.Context) {
pager := context.NewPagination(int(count), setting.UI.IssuePagingNum, page, 5)
pager.SetDefaultParams(ctx)
ctx.Data["Page"] = pager

ctx.Data["PageIsCloudBrain"] = true
ctx.Data["Tasks"] = ciTasks
ctx.Data["CanCreate"] = cloudbrain.CanCreateOrDebugJob(ctx)
ctx.HTML(200, tplDebugJobIndex)
}



Loading…
Cancel
Save