| @@ -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 | |||
| @@ -262,8 +262,6 @@ | |||
| <div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);"> | |||
| <a class="active item" | |||
| data-tab="first">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a> | |||
| <a class="item" data-tab="second" | |||
| onclick="javascript:parseInfo()">{{$.i18n.Tr "repo.cloudbrain.runinfo"}}</a> | |||
| <a class="item log_bottom" data-tab="third" | |||
| data-version="{{.VersionName}}">{{$.i18n.Tr "repo.modelarts.log"}}</a> | |||
| <a class="item load-model-file" data-tab="four" | |||
| @@ -515,25 +513,6 @@ | |||
| </div> | |||
| </div> | |||
| <div class="ui tab" data-tab="second"> | |||
| <div> | |||
| <div class="ui message message{{.VersionName}}" style="display: none;"> | |||
| <div id="header"></div> | |||
| </div> | |||
| <div class="ui attached" | |||
| style="height: 390px !important; overflow: auto;"> | |||
| <input type="hidden" id="json_value" value="{{$.result.JobStatus.AppExitDiagnostics}}"> | |||
| <input type="hidden" id="ExitDiagnostics" value="{{$.ExitDiagnostics}}"> | |||
| <span id="info_display" class="info_text"> | |||
| </span> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="ui tab" data-tab="third"> | |||
| <div class="file-info"> | |||
| <a id="{{.VersionName}}-log-down" | |||
| @@ -616,56 +595,6 @@ | |||
| $(document).ready(function () { | |||
| $('.secondary.menu .item').tab(); | |||
| }); | |||
| let userName | |||
| let repoPath | |||
| let jobID | |||
| let downlaodFlag = {{ $.canDownload }} | |||
| let taskID = {{ $.task.ID }} | |||
| let realJobName = {{ $.task.JobName }} | |||
| 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 += "<p><b>[" + podEventArray[i]["reason"] + "]</b></p>"; | |||
| html += "<p>" + podEventArray[i]["message"] + "</p>"; | |||
| html += "<p>" + podEventArray[i]["action"] + "</p>"; | |||
| } | |||
| } | |||
| } | |||
| let extras = jsonObj["extras"]; | |||
| if (extras != null) { | |||
| for (var i = 0; i < extras.length; i++) { | |||
| if (extras[i]["reason"] != "") { | |||
| html += "<p><b>[" + extras[i]["reason"] + "]</b></p>"; | |||
| html += "<p>" + extras[i]["message"] + "</p>"; | |||
| html += "<p>" + extras[i]["action"] + "</p>"; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| let string = document.getElementById("ExitDiagnostics").value; | |||
| string = string.replace(/\r\n/g, "<br>") | |||
| string = string.replace(/\n/g, "<br>"); | |||
| string = string.replace(/(\r\n)|(\n)/g, '<br>'); | |||
| if (string != "") { | |||
| html += "<p><b>[ExitDiagnostics]</b></p>"; | |||
| html += "<p>" + string + "</p>"; | |||
| } | |||
| document.getElementById("info_display").innerHTML = html; | |||
| } | |||
| ;(function() { | |||
| var SPEC = {{ .Spec }}; | |||
| var showPoint = false; | |||
| @@ -287,9 +287,7 @@ | |||
| data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a> | |||
| <a class="item log_bottom" data-tab="third{{$k}}" | |||
| data-version="{{.VersionName}}">{{$.i18n.Tr "repo.modelarts.log"}}</a> | |||
| data-version="{{.VersionName}}">{{$.i18n.Tr "repo.modelarts.log"}}</a> | |||
| <a class="item load-model-file" data-tab="four{{$k}}" data-gpu-flag="true" data-download-flag="{{$.canDownload}}" data-path="{{$.RepoLink}}/cloudbrain/train-job/{{.JobID}}/model_list" data-version="{{.VersionName}}" data-parents="" data-filename="" data-init="init" >{{$.i18n.Tr "repo.model_download"}}</a> | |||
| </div> | |||
| <div class="ui tab active" data-tab="first{{$k}}"> | |||
| @@ -427,9 +425,6 @@ | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.train_job.run_parameter"}} | |||
| @@ -543,29 +538,22 @@ | |||
| <input type="hidden" name="init_log" value> | |||
| <pre id="log_file{{.VersionName}}"></pre> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="ui tab" data-tab="four{{$k}}"> | |||
| <input type="hidden" name="model{{.VersionName}}" value="-1"> | |||
| <input type="hidden" name="modelback{{.VersionName}}" value="-1"> | |||
| <div class='ui breadcrumb model_file_bread' id='file_breadcrumb{{.VersionName}}'> | |||
| <div class="active section">result</div> | |||
| <div class="divider"> / </div> | |||
| </div> | |||
| <div id="dir_list{{.VersionName}}"> | |||
| </div> | |||
| <div style="display:flex;align-items: center;justify-content: end;color: #f2711c;"> | |||
| <i class="ri-error-warning-line" style="margin-right:0.5rem;"></i> | |||
| <span>{{$.i18n.Tr "repo.file_limit_100"}}</span> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -678,11 +666,8 @@ | |||
| <button class="ui button cancel">{{.i18n.Tr "repo.cloudbrain.cancel"}}</button> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| {{template "base/footer" .}} | |||
| <script type="text/javascript" src="/self/ztree/js/jquery.ztree.core.js"></script> | |||
| @@ -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 += "<p><b>[" + podEventArray[i]["reason"] + "]</b></p>"; | |||
| html += "<p>" + podEventArray[i]["message"] + "</p>"; | |||
| html += "<p>" + podEventArray[i]["action"] + "</p>"; | |||
| } | |||
| } | |||
| } | |||
| let extras = jsonObj["extras"]; | |||
| if (extras != null) { | |||
| for (var i = 0; i < extras.length; i++) { | |||
| if (extras[i]["reason"] != "") { | |||
| html += "<p><b>[" + extras[i]["reason"] + "]</b></p>"; | |||
| html += "<p>" + extras[i]["message"] + "</p>"; | |||
| html += "<p>" + extras[i]["action"] + "</p>"; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| let string = document.getElementById("ExitDiagnostics").value; | |||
| string = string.replace(/\r\n/g, "<br>") | |||
| string = string.replace(/\n/g, "<br>"); | |||
| string = string.replace(/(\r\n)|(\n)/g, '<br>'); | |||
| if (string != "") { | |||
| html += "<p><b>[ExitDiagnostics]</b></p>"; | |||
| html += "<p>" + string + "</p>"; | |||
| } | |||
| document.getElementById("info_display").innerHTML = html; | |||
| } | |||
| ;(function() { | |||
| var SPEC = {{ .Spec }}; | |||
| var showPoint = false; | |||