Browse Source

Merge pull request '取消GPU训练任务运行时长限制' (#2015) from fix-2014 into V20220428

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/2015
Reviewed-by: ychao_1983 <ychao_1983@sina.com>
tags/v1.22.4.2^2
ychao_1983 3 years ago
parent
commit
f64c561698
1 changed files with 7 additions and 8 deletions
  1. +7
    -8
      routers/repo/cloudbrain.go

+ 7
- 8
routers/repo/cloudbrain.go View File

@@ -40,13 +40,11 @@ const (
tplCloudBrainBenchmarkNew base.TplName = "repo/cloudbrain/benchmark/new"
tplCloudBrainBenchmarkShow base.TplName = "repo/cloudbrain/benchmark/show"

tplCloudBrainImageSubmit base.TplName = "repo/cloudbrain/image/submit"
tplCloudBrainImageEdit base.TplName = "repo/cloudbrain/image/edit"

tplCloudBrainImageSubmit base.TplName = "repo/cloudbrain/image/submit"
tplCloudBrainImageEdit base.TplName = "repo/cloudbrain/image/edit"

tplCloudBrainTrainJobNew base.TplName = "repo/cloudbrain/trainjob/new"
tplCloudBrainTrainJobShow base.TplName = "repo/cloudbrain/trainjob/show"

)

var (
@@ -1402,11 +1400,11 @@ func SyncCloudbrainStatus() {
maxDuration = setting.MaxDuration
}

if task.Duration >= maxDuration {
log.Info("begin to stop job(%s), because of the duration", task.JobName)
if task.Duration >= maxDuration && task.JobType != string(models.JobTypeTrain) {
log.Info("begin to stop job(%s), because of the duration", task.DisplayJobName)
err = cloudbrain.StopJob(task.JobID)
if err != nil {
log.Error("StopJob(%s) failed:%v", task.JobName, err)
log.Error("StopJob(%s) failed:%v", task.DisplayJobName, err)
continue
}
task.Status = string(models.JobStopped)
@@ -1416,7 +1414,8 @@ func SyncCloudbrainStatus() {
task.ComputeAndSetDuration()
err = models.UpdateJob(task)
if err != nil {
log.Error("UpdateJob(%s) failed:%v", task.JobName, err)
log.Error("UpdateJob(%s) failed:%v", task.DisplayJobName, err)
continue
}
}
}


Loading…
Cancel
Save