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
e997af2650
1 changed files with 3 additions and 6 deletions
  1. +3
    -6
      modules/cloudbrain/cloudbrain.go

+ 3
- 6
modules/cloudbrain/cloudbrain.go View File

@@ -41,9 +41,6 @@ func isAdminOrOwnerOrJobCreater(ctx *context.Context, job *models.Cloudbrain, er

func CanDeleteDebugJob(ctx *context.Context, job *models.Cloudbrain) bool {

if job.Status != string(models.JobStopped) && job.Status != string(models.JobFailed) && job.Status != string(models.ModelArtsStartFailed) && job.Status != string(models.ModelArtsCreateFailed) {
return false
}
return isAdminOrOwnerOrJobCreater(ctx, job, nil)
}

@@ -113,7 +110,7 @@ func GenerateTask(ctx *context.Context, jobName, image, command, uuid, codePath,
log.Error("no such resourceSpecId(%d)", resourceSpecId, ctx.Data["MsgID"])
return errors.New("no such resourceSpec")
}
jobResult, err := CreateJob(jobName, models.CreateJobParams{
JobName: jobName,
RetryCount: 1,
@@ -198,8 +195,8 @@ func GenerateTask(ctx *context.Context, jobName, image, command, uuid, codePath,
JobName: jobName,
SubTaskName: SubTaskName,
JobType: jobType,
Type: models.TypeCloudBrainOne,
Uuid: uuid,
Type: models.TypeCloudBrainOne,
Uuid: uuid,
})

if err != nil {


Loading…
Cancel
Save