|
|
|
@@ -393,19 +393,20 @@ func ModelSafetyGetLog(ctx *context.APIContext) { |
|
|
|
return |
|
|
|
} |
|
|
|
if job.JobType == string(models.JobTypeModelSafety) { |
|
|
|
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 |
|
|
|
log.Info("existStr=" + existStr) |
|
|
|
CloudbrainGetLog(ctx) |
|
|
|
} else if job.Type == models.TypeCloudBrainTwo { |
|
|
|
// 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 |
|
|
|
// // log.Info("existStr=" + existStr) |
|
|
|
// // CloudbrainGetLog(ctx) |
|
|
|
// } else |
|
|
|
if job.Type == models.TypeCloudBrainTwo { |
|
|
|
//TrainJobForModelConvertGetLog(ctx) |
|
|
|
var baseLine = ctx.Query("base_line") |
|
|
|
var order = ctx.Query("order") |
|
|
|
@@ -540,8 +541,22 @@ func CloudbrainGetLog(ctx *context.APIContext) { |
|
|
|
return |
|
|
|
} |
|
|
|
if job.JobType == string(models.JobTypeModelSafety) { |
|
|
|
ModelSafetyGetLog(ctx) |
|
|
|
return |
|
|
|
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 |
|
|
|
log.Info("existStr=" + existStr) |
|
|
|
} else { |
|
|
|
ModelSafetyGetLog(ctx) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
lines := ctx.QueryInt("lines") |
|
|
|
|