|
|
|
@@ -596,12 +596,24 @@ func CloudbrainGetLog(ctx *context.APIContext) { |
|
|
|
existStr = taskRes.TaskStatuses[0].ExitDiagnostics |
|
|
|
} |
|
|
|
ctx.Data["existStr"] = existStr |
|
|
|
log.Info("existStr=" + existStr) |
|
|
|
} else { |
|
|
|
ModelSafetyGetLog(ctx) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if job.JobType == string(models.JobTypeTrain) { |
|
|
|
if job.Type == models.TypeCloudBrainOne { |
|
|
|
result, err := cloudbrain.GetJob(job.JobID) |
|
|
|
existStr := "" |
|
|
|
if err == nil && result != nil { |
|
|
|
jobRes, _ := models.ConvertToJobResultPayload(result.Payload) |
|
|
|
taskRoles := jobRes.TaskRoles |
|
|
|
taskRes, _ := models.ConvertToTaskPod(taskRoles[cloudbrain.SubTaskName].(map[string]interface{})) |
|
|
|
existStr = taskRes.TaskStatuses[0].ExitDiagnostics |
|
|
|
} |
|
|
|
ctx.Data["existStr"] = existStr |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
lines := ctx.QueryInt("lines") |
|
|
|
@@ -634,7 +646,7 @@ func CloudbrainGetLog(ctx *context.APIContext) { |
|
|
|
endLine += 1 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
result = getLogFromModelDir(job.JobName, startLine, endLine, resultPath) |
|
|
|
if result == nil { |
|
|
|
log.Error("GetJobLog failed: %v", err, ctx.Data["MsgID"]) |
|
|
|
|