diff --git a/routers/api/v1/repo/cloudbrain.go b/routers/api/v1/repo/cloudbrain.go index 7022dc011..68baf3287 100755 --- a/routers/api/v1/repo/cloudbrain.go +++ b/routers/api/v1/repo/cloudbrain.go @@ -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) || job.JobType == string(models.JobTypeInference) { + 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") @@ -646,9 +658,11 @@ func CloudbrainGetLog(ctx *context.APIContext) { if result["Content"] != nil { content = result["Content"].(string) } + if ctx.Data["existStr"] != nil && result["Lines"].(int) < 50 { content = content + ctx.Data["existStr"].(string) } + logFileName := result["FileName"] //Logs can only be downloaded if the file exists diff --git a/templates/repo/cloudbrain/inference/show.tmpl b/templates/repo/cloudbrain/inference/show.tmpl index 3154b8ac6..aee08d659 100644 --- a/templates/repo/cloudbrain/inference/show.tmpl +++ b/templates/repo/cloudbrain/inference/show.tmpl @@ -262,8 +262,6 @@ - -
-
- -
- - - - - -
- -
- -
-

"; - html += "

" + podEventArray[i]["message"] + "

"; - html += "

" + podEventArray[i]["action"] + "

"; - } - } - } - let extras = jsonObj["extras"]; - if (extras != null) { - for (var i = 0; i < extras.length; i++) { - if (extras[i]["reason"] != "") { - html += "

[" + extras[i]["reason"] + "]

"; - html += "

" + extras[i]["message"] + "

"; - html += "

" + extras[i]["action"] + "

"; - } - } - } - } - - let string = document.getElementById("ExitDiagnostics").value; - string = string.replace(/\r\n/g, "
") - string = string.replace(/\n/g, "
"); - string = string.replace(/(\r\n)|(\n)/g, '
'); - - if (string != "") { - html += "

[ExitDiagnostics]

"; - html += "

" + string + "

"; - } - - document.getElementById("info_display").innerHTML = html; - } - ;(function() { var SPEC = {{ .Spec }}; var showPoint = false; diff --git a/templates/repo/cloudbrain/trainjob/show.tmpl b/templates/repo/cloudbrain/trainjob/show.tmpl index 8193e80fc..75cad03b4 100644 --- a/templates/repo/cloudbrain/trainjob/show.tmpl +++ b/templates/repo/cloudbrain/trainjob/show.tmpl @@ -287,9 +287,7 @@ data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}
{{$.i18n.Tr "repo.modelarts.log"}} - - + data-version="{{.VersionName}}">{{$.i18n.Tr "repo.modelarts.log"}} {{$.i18n.Tr "repo.model_download"}}
@@ -427,9 +425,6 @@
- - - {{$.i18n.Tr "repo.modelarts.train_job.run_parameter"}} @@ -543,29 +538,22 @@

                             
- - - -
-
{{$.i18n.Tr "repo.file_limit_100"}}
- @@ -678,11 +666,8 @@ - - - {{template "base/footer" .}} @@ -908,51 +893,7 @@ $('.secondary.menu .item').tab(); }); - - - function parseInfo() { - let jsonValue = document.getElementById("json_value").value; - let jsonObj = JSON.parse(jsonValue); - let podRoleName = jsonObj["podRoleName"]; - let html = ""; - if (podRoleName != null) { - let task0 = podRoleName["task1-0"]; - let podEvents = jsonObj["podEvents"]; - let podEventArray = podEvents[task0]; - if (podEventArray != null) { - for (var i = 0; i < podEventArray.length; i++) { - if (podEventArray[i]["reason"] != "") { - html += "

[" + podEventArray[i]["reason"] + "]

"; - html += "

" + podEventArray[i]["message"] + "

"; - html += "

" + podEventArray[i]["action"] + "

"; - } - } - } - let extras = jsonObj["extras"]; - if (extras != null) { - for (var i = 0; i < extras.length; i++) { - if (extras[i]["reason"] != "") { - html += "

[" + extras[i]["reason"] + "]

"; - html += "

" + extras[i]["message"] + "

"; - html += "

" + extras[i]["action"] + "

"; - } - } - } - } - - let string = document.getElementById("ExitDiagnostics").value; - string = string.replace(/\r\n/g, "
") - string = string.replace(/\n/g, "
"); - string = string.replace(/(\r\n)|(\n)/g, '
'); - - if (string != "") { - html += "

[ExitDiagnostics]

"; - html += "

" + string + "

"; - } - - document.getElementById("info_display").innerHTML = html; - } - + ;(function() { var SPEC = {{ .Spec }}; var showPoint = false;