From 440e865bdd8f369feee521ca45d3b88714e3d350 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Mon, 18 Jul 2022 17:24:06 +0800 Subject: [PATCH 01/21] fix issue --- templates/custom/wait_count.tmpl | 5 +-- templates/repo/grampus/trainjob/show.tmpl | 42 ++++++++++---------- templates/repo/modelarts/trainjob/show.tmpl | 61 +++++++++++++++-------------- web_src/js/features/cloudrbanin.js | 26 +++++++++++- 4 files changed, 78 insertions(+), 56 deletions(-) diff --git a/templates/custom/wait_count.tmpl b/templates/custom/wait_count.tmpl index 77c49712d..bef8f1327 100644 --- a/templates/custom/wait_count.tmpl +++ b/templates/custom/wait_count.tmpl @@ -3,13 +3,12 @@ {{$gpuQueue := 0}} {{range $k,$v :=.gpu_types}} {{if eq $k 0}} - {{ $queue := $v.Queue }} + {{ $queue = $v.Queue }} {{ end }} {{ end }} - {{ range $k,$v :=.QueuesDetail }} {{if eq $k $queue}} - {{$gpuQueue :=$v}} + {{$gpuQueue =$v}} {{ end }} {{ end }} {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}: {{.TrainJobDuration}} - + + +
@@ -871,24 +871,24 @@ size = size.toFixed(0);//保留的小数位数 return size + unitArr[index]; } - function refreshStatus(version_name) { - $.get(`/api/v1/repos/${userName}/${repoPath}/grampus/train-job/${jobID}?version_name=${version_name}`, (data) => { - // header status and duration - $(`#${version_name}-duration-span`).text(data.JobDuration) - $(`#${version_name}-status-span span`).text(data.JobStatus) - $(`#${version_name}-status-span i`).attr("class", data.JobStatus) - // detail status and duration - $('#' + version_name + '-duration').text(data.JobDuration) - $('#' + version_name + '-status').text(data.JobStatus) - $('#' + version_name + '-ai_center').text(data.AiCenter) - loadLog(version_name) - - - }).fail(function (err) { - console.log(err); - }); - stopBubbling(arguments.callee.caller.arguments[0]) - } + // function refreshStatus(version_name) { + // $.get(`/api/v1/repos/${userName}/${repoPath}/grampus/train-job/${jobID}?version_name=${version_name}`, (data) => { + // // header status and duration + // $(`#${version_name}-duration-span`).text(data.JobDuration) + // $(`#${version_name}-status-span span`).text(data.JobStatus) + // $(`#${version_name}-status-span i`).attr("class", data.JobStatus) + // // detail status and duration + // $('#' + version_name + '-duration').text(data.JobDuration) + // $('#' + version_name + '-status').text(data.JobStatus) + // $('#' + version_name + '-ai_center').text(data.AiCenter) + // loadLog(version_name) + + + // }).fail(function (err) { + // console.log(err); + // }); + // stopBubbling(arguments.callee.caller.arguments[0]) + // } function deleteVersion(version_name) { stopBubbling(arguments.callee.caller.arguments[0]) let flag = 1; diff --git a/templates/repo/modelarts/trainjob/show.tmpl b/templates/repo/modelarts/trainjob/show.tmpl index 3936aa620..08208a618 100755 --- a/templates/repo/modelarts/trainjob/show.tmpl +++ b/templates/repo/modelarts/trainjob/show.tmpl @@ -270,12 +270,14 @@ {{end}} {{if .CanDel}} - {{$.i18n.Tr "repo.stop"}} + data-jobid="{{.JobID}}" + data-repopath="{{$.RepoRelPath}}/modelarts/train-job" + data-version = "{{.VersionName}}" + >{{$.i18n.Tr "repo.stop"}} {{else}} - {{$.i18n.Tr "repo.stop"}} + {{$.i18n.Tr "repo.stop"}} {{end}} @@ -308,10 +310,9 @@ class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}: {{.TrainJobDuration}} - - + + +
@@ -877,28 +878,28 @@ $('#name').val(modelName) $('#version').val("0.0.1") } - function refreshStatus(version_name) { - $.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}?version_name=${version_name}`, (data) => { - // header status and duration - $(`#${version_name}-duration-span`).text(data.JobDuration) - $(`#${version_name}-status-span span`).text(data.JobStatus) - $(`#${version_name}-status-span i`).attr("class", data.JobStatus) - // detail status and duration - $('#' + version_name + '-duration').text(data.JobDuration) - $('#' + version_name + '-status').text(data.JobStatus) - console.log(data) - if (["KILLED", "FAILED", "START_FAILED", "STOPPED", "COMPLETED"].includes(data.JobStatus)) { - $('#' + version_name + '-stop').addClass('disabled') - } - - loadLog(version_name) - - - }).fail(function (err) { - console.log(err); - }); - stopBubbling(arguments.callee.caller.arguments[0]) - } + // function refreshStatus(version_name) { + // $.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}?version_name=${version_name}`, (data) => { + // // header status and duration + // $(`#${version_name}-duration-span`).text(data.JobDuration) + // $(`#${version_name}-status-span span`).text(data.JobStatus) + // $(`#${version_name}-status-span i`).attr("class", data.JobStatus) + // // detail status and duration + // $('#' + version_name + '-duration').text(data.JobDuration) + // $('#' + version_name + '-status').text(data.JobStatus) + // console.log(data) + // if (["KILLED", "FAILED", "START_FAILED", "STOPPED", "COMPLETED"].includes(data.JobStatus)) { + // $('#' + version_name + '-stop').addClass('disabled') + // } + + // loadLog(version_name) + + + // }).fail(function (err) { + // console.log(err); + // }); + // stopBubbling(arguments.callee.caller.arguments[0]) + // } function deleteVersion(version_name) { stopBubbling(arguments.callee.caller.arguments[0]) let flag = 1; diff --git a/web_src/js/features/cloudrbanin.js b/web_src/js/features/cloudrbanin.js index 86e9577b5..95d88fc0b 100644 --- a/web_src/js/features/cloudrbanin.js +++ b/web_src/js/features/cloudrbanin.js @@ -327,6 +327,23 @@ export default async function initCloudrain() { }); } + $(".stop-show-version").click(function (e) { + const ID = this.dataset.jobid; + const repoPath = this.dataset.repopath; + const version_name = this.dataset.version; + const url = `/api/v1/repos/${repoPath}/${ID}/stop_version`; + $.post(url, { version_name: version_name }, (data) => { + if (data.StatusOK === 0) { + $(`#${version_name}-stop`).removeClass("blue"); + $(`#${version_name}-stop`).addClass("disabled"); + refreshStatusShow(version_name, ID, repoPath); + } + }).fail(function (err) { + console.log(err); + }); + e.stopPropagation(); + }); + $("#refresh-status").click(function (e) { let version_name = $(this).data("version"); let ID = $(`#accordion${version_name}`).data("jobid"); @@ -339,11 +356,16 @@ export default async function initCloudrain() { $.get( `/api/v1/repos/${repoPath}/${ID}?version_name=${version_name}`, (data) => { + //accroding下的状态 $(`#${version_name}-status-span span`).text(data.JobStatus); + //accroding下的状态图标 $(`#${version_name}-status-span i`).attr("class", data.JobStatus); + //accroding下的运行时长 $(`#${version_name}-duration-span`).text(data.JobDuration); - $("#" + versionname + "-duration").text(data.JobDuration); - $("#" + versionname + "-status").text(data.JobStatus); + //配置信息详情页的状态 + $(`#${version_name}-status`).text(data.JobStatus); + //配置信息详情页的状态 + $(`#${version_name}-duration`).text(data.JobDuration); } ).fail(function (err) { console.log(err); From a122f0cc4600715b17ad86d51bf9683073cfff20 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Mon, 18 Jul 2022 17:28:29 +0800 Subject: [PATCH 02/21] fix issue --- templates/repo/grampus/trainjob/show.tmpl | 57 ----------------------------- templates/repo/modelarts/trainjob/show.tmpl | 34 +---------------- 2 files changed, 1 insertion(+), 90 deletions(-) diff --git a/templates/repo/grampus/trainjob/show.tmpl b/templates/repo/grampus/trainjob/show.tmpl index de57a2978..b4d9495dc 100755 --- a/templates/repo/grampus/trainjob/show.tmpl +++ b/templates/repo/grampus/trainjob/show.tmpl @@ -871,64 +871,7 @@ size = size.toFixed(0);//保留的小数位数 return size + unitArr[index]; } - // function refreshStatus(version_name) { - // $.get(`/api/v1/repos/${userName}/${repoPath}/grampus/train-job/${jobID}?version_name=${version_name}`, (data) => { - // // header status and duration - // $(`#${version_name}-duration-span`).text(data.JobDuration) - // $(`#${version_name}-status-span span`).text(data.JobStatus) - // $(`#${version_name}-status-span i`).attr("class", data.JobStatus) - // // detail status and duration - // $('#' + version_name + '-duration').text(data.JobDuration) - // $('#' + version_name + '-status').text(data.JobStatus) - // $('#' + version_name + '-ai_center').text(data.AiCenter) - // loadLog(version_name) - - - // }).fail(function (err) { - // console.log(err); - // }); - // stopBubbling(arguments.callee.caller.arguments[0]) - // } - function deleteVersion(version_name) { - stopBubbling(arguments.callee.caller.arguments[0]) - let flag = 1; - $('.ui.basic.modal').modal({ - onDeny: function () { - flag = false - }, - onApprove: function () { - $.post(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/del_version`, { version_name: version_name }, (data) => { - if (data.VersionListCount === 0) { - location.href = `/${userName}/${repoPath}/modelarts/train-job` - } else { - $('#accordion' + version_name).remove() - } - - }).fail(function (err) { - console.log(err); - }); - flag = true - }, - onHidden: function () { - if (flag == false) { - $('.alert').html('您已取消操作').removeClass('alert-success').addClass('alert-danger').show().delay(1500).fadeOut(); - } - } - }) - .modal('show') - } - function stopVersion(version_name) { - stopBubbling(arguments.callee.caller.arguments[0]) - $.post(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/stop_version`, { version_name: version_name }, (data) => { - if (data.StatusOK === 0) { - $('#' + version_name + '-stop').addClass('disabled') - refreshStatus(version_name) - } - }).fail(function (err) { - console.log(err); - }); - } function loadLog(version_name) { document.getElementById("mask").style.display = "block" $.get(`/api/v1/repos/${userName}/${repoPath}/grampus/train-job/${jobID}/log?version_name=${version_name}&lines=50&order=asc`, (data) => { diff --git a/templates/repo/modelarts/trainjob/show.tmpl b/templates/repo/modelarts/trainjob/show.tmpl index 08208a618..794e42457 100755 --- a/templates/repo/modelarts/trainjob/show.tmpl +++ b/templates/repo/modelarts/trainjob/show.tmpl @@ -878,28 +878,6 @@ $('#name').val(modelName) $('#version').val("0.0.1") } - // function refreshStatus(version_name) { - // $.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}?version_name=${version_name}`, (data) => { - // // header status and duration - // $(`#${version_name}-duration-span`).text(data.JobDuration) - // $(`#${version_name}-status-span span`).text(data.JobStatus) - // $(`#${version_name}-status-span i`).attr("class", data.JobStatus) - // // detail status and duration - // $('#' + version_name + '-duration').text(data.JobDuration) - // $('#' + version_name + '-status').text(data.JobStatus) - // console.log(data) - // if (["KILLED", "FAILED", "START_FAILED", "STOPPED", "COMPLETED"].includes(data.JobStatus)) { - // $('#' + version_name + '-stop').addClass('disabled') - // } - - // loadLog(version_name) - - - // }).fail(function (err) { - // console.log(err); - // }); - // stopBubbling(arguments.callee.caller.arguments[0]) - // } function deleteVersion(version_name) { stopBubbling(arguments.callee.caller.arguments[0]) let flag = 1; @@ -929,17 +907,7 @@ .modal('show') } - function stopVersion(version_name) { - stopBubbling(arguments.callee.caller.arguments[0]) - $.post(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/stop_version`, { version_name: version_name }, (data) => { - if (data.StatusOK === 0) { - $('#' + version_name + '-stop').addClass('disabled') - refreshStatus(version_name) - } - }).fail(function (err) { - console.log(err); - }); - } + function loadLog(version_name) { $.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/log?version_name=${version_name}&lines=50&order=asc`, (data) => { $('input[name=end_line]').val(data.EndLine) From 1beaeeddada314f9c24b109abb9470bc79355e88 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Mon, 18 Jul 2022 17:31:18 +0800 Subject: [PATCH 03/21] fix issue --- templates/repo/grampus/trainjob/show.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/grampus/trainjob/show.tmpl b/templates/repo/grampus/trainjob/show.tmpl index b4d9495dc..53201a467 100755 --- a/templates/repo/grampus/trainjob/show.tmpl +++ b/templates/repo/grampus/trainjob/show.tmpl @@ -236,7 +236,7 @@ {{range $k ,$v := .version_list_task}}
From fb1d1179866f6a53a9e3479ef216344f72bedbb0 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Mon, 18 Jul 2022 19:03:55 +0800 Subject: [PATCH 04/21] fix issue --- templates/repo/cloudbrain/show.tmpl | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/templates/repo/cloudbrain/show.tmpl b/templates/repo/cloudbrain/show.tmpl index 9ae3b9445..f5ad6b5db 100755 --- a/templates/repo/cloudbrain/show.tmpl +++ b/templates/repo/cloudbrain/show.tmpl @@ -257,9 +257,7 @@ {{$.duration}} - +
@@ -588,33 +586,4 @@ } document.getElementById("info_display").innerHTML = html; } - function stopBubbling(e) { - e = window.event || e; - if (e.stopPropagation) { - e.stopPropagation(); //阻止事件 冒泡传播 - } else { - e.cancelBubble = true; //ie兼容 - } - } - - function refreshStatus(version_name) { - $(".ui.accordion.border-according").each((index, job) => { - const jobID = job.dataset.jobid; - const repoPath = job.dataset.repopath; - const versionname = job.dataset.version - $.get(`/api/v1/repos/${repoPath}/cloudbrain/${jobID}?version_name=${versionname}`, (data) => { - // header status and duration - //$(`#${version_name}-duration-span`).text(data.JobDuration) - $(`#${version_name}-status-span span`).text(data.JobStatus) - $(`#${version_name}-status-span i`).attr("class", data.JobStatus) - // detail status and duration - //$('#'+version_name+'-duration').text(data.JobDuration) - $('#' + version_name + '-status').text(data.JobStatus) - parseLog() - }).fail(function (err) { - console.log(err); - }); - stopBubbling(arguments.callee.caller.arguments[0]) - }) - } \ No newline at end of file From 4080ab6f55c225fbdab950ac89c021004fa2b768 Mon Sep 17 00:00:00 2001 From: Gitea Date: Mon, 18 Jul 2022 20:32:07 +0800 Subject: [PATCH 05/21] fix issue --- templates/custom/wait_count_train.tmpl | 4 ++-- templates/repo/debugjob/index.tmpl | 4 ++-- web_src/js/features/cloudrbanin.js | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/templates/custom/wait_count_train.tmpl b/templates/custom/wait_count_train.tmpl index ef6c4ed61..a0e130c61 100644 --- a/templates/custom/wait_count_train.tmpl +++ b/templates/custom/wait_count_train.tmpl @@ -3,13 +3,13 @@ {{$gpuQueue := 0}} {{range $k,$v :=.gpu_types}} {{if eq $k 0}} - {{ $queue := $v.Queue }} + {{ $queue = $v.Queue }} {{ end }} {{ end }} {{ range $k,$v :=.QueuesDetail }} {{if eq $k $queue}} - {{$gpuQueue :=$v}} + {{$gpuQueue =$v}} {{ end }} {{ end }} {{$.i18n.Tr "repo.stop"}} @@ -405,7 +405,7 @@ {{$.CsrfTokenHtml}} {{if .CanDel}} {{$.i18n.Tr "repo.delete"}} diff --git a/web_src/js/features/cloudrbanin.js b/web_src/js/features/cloudrbanin.js index 95d88fc0b..b7a9e4eef 100644 --- a/web_src/js/features/cloudrbanin.js +++ b/web_src/js/features/cloudrbanin.js @@ -123,6 +123,7 @@ export default async function initCloudrain() { "KILLED", "COMPLETED", "SUCCEEDED", + "CREATE_FAILED" ].includes(status) ) { $("#ai-delete-" + ID) @@ -166,6 +167,7 @@ export default async function initCloudrain() { "START_FAILED", "SUCCEEDED", "STOPPED", + "CREATE_FAILED", ].includes(status) ) { return; @@ -177,6 +179,7 @@ export default async function initCloudrain() { "KILLING", "COMPLETED", "SUCCEEDED", + "CREATE_FAILED", "STOPPED", ]; $.get( @@ -385,6 +388,7 @@ export default async function initCloudrain() { "KILLED", "COMPLETED", "SUCCEEDED", + "CREATE_FAILED", ].includes(data.JobStatus) ) { $("#ai-delete-" + ID) From 7bc27d73bc527e223309f2ce87c96472eef3ca78 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 19 Jul 2022 08:48:41 +0800 Subject: [PATCH 06/21] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/cloudbrain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/cloudbrain.go b/models/cloudbrain.go index f40403fdd..af53bad32 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -1803,7 +1803,7 @@ func GetBenchmarkCountByUserID(userID int64) (int, error) { func GetWaitingCloudbrainCount(cloudbrainType int, computeResource string, jobTypes ...JobType) (int64, error) { sess := x.Where("status=? and type=?", JobWaiting, cloudbrainType) if len(jobTypes) > 0 { - sess.In("JobType", jobTypes) + sess.In("job_type", jobTypes) } if computeResource != "" { sess.And("compute_resource=?", computeResource) From e29fafad185b9eac3c009b25307defcdbb0eb61f Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 19 Jul 2022 09:00:51 +0800 Subject: [PATCH 07/21] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/repo/cloudbrain.go | 1 + 1 file changed, 1 insertion(+) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index ddf1c7ff2..7af36641d 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -264,6 +264,7 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { } if !jobNamePattern.MatchString(displayJobName) { + cloudBrainNewDataPrepare(ctx) ctx.RenderWithErr(ctx.Tr("repo.cloudbrain_jobname_err"), tpl, &form) return } From dfdec30bbb1a86e9a89c0c2c85acae76e6558d89 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 19 Jul 2022 11:29:36 +0800 Subject: [PATCH 08/21] fix issue --- templates/custom/wait_count_train.tmpl | 12 ++++++------ templates/repo/cloudbrain/benchmark/new.tmpl | 5 +++-- templates/repo/cloudbrain/inference/new.tmpl | 2 +- templates/repo/cloudbrain/trainjob/new.tmpl | 2 +- templates/repo/grampus/trainjob/gpu/new.tmpl | 2 +- templates/repo/grampus/trainjob/npu/new.tmpl | 2 +- templates/repo/modelarts/inferencejob/new.tmpl | 2 +- templates/repo/modelarts/trainjob/new.tmpl | 2 +- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/templates/custom/wait_count_train.tmpl b/templates/custom/wait_count_train.tmpl index a0e130c61..c31e85fae 100644 --- a/templates/custom/wait_count_train.tmpl +++ b/templates/custom/wait_count_train.tmpl @@ -1,13 +1,13 @@
{{$queue := ""}} {{$gpuQueue := 0}} - {{range $k,$v :=.gpu_types}} + {{range $k,$v :=.type}} {{if eq $k 0}} {{ $queue = $v.Queue }} {{ end }} {{ end }} - {{ range $k,$v :=.QueuesDetail }} + {{ range $k,$v :=.ctx.QueuesDetail }} {{if eq $k $queue}} {{$gpuQueue =$v}} {{ end }} @@ -17,12 +17,12 @@ style="margin-right: 0.5rem; font-size: 16px" > {{.i18n.Tr "repo.wait_count_start"}} - {{if .QueuesDetail}} + >{{.ctx.i18n.Tr "repo.wait_count_start"}} + {{if .type}} {{ $gpuQueue }} {{else}} - {{.WaitCount}} + {{.ctx.WaitCount}} {{ end }} - {{.i18n.Tr "repo.wait_count_end"}}
diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index 0509ce5bc..e964112e0 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -62,7 +62,7 @@ {{.i18n.Tr "repo.cloudbrain.benchmark.model"}}
- {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $ "type" .benchmark_gpu_types}}
- {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $ "type" .benchmark_gpu_types}}
@@ -351,4 +351,5 @@ $('.ui.create_train_job.green.button').click(function (e) { validate() }) + console.log({{$.QueuesDetail}}) \ No newline at end of file diff --git a/templates/repo/cloudbrain/inference/new.tmpl b/templates/repo/cloudbrain/inference/new.tmpl index e42c7240a..223fcfe1c 100644 --- a/templates/repo/cloudbrain/inference/new.tmpl +++ b/templates/repo/cloudbrain/inference/new.tmpl @@ -92,7 +92,7 @@ Ascend NPU
- {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $ "type" .inference_gpu_types}}
diff --git a/templates/repo/cloudbrain/trainjob/new.tmpl b/templates/repo/cloudbrain/trainjob/new.tmpl index 22465492b..c410889b2 100755 --- a/templates/repo/cloudbrain/trainjob/new.tmpl +++ b/templates/repo/cloudbrain/trainjob/new.tmpl @@ -126,7 +126,7 @@ Ascend NPU
- {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $ "type" .train_gpu_types}}
diff --git a/templates/repo/grampus/trainjob/gpu/new.tmpl b/templates/repo/grampus/trainjob/gpu/new.tmpl index 2e365fdc6..75b8bcff2 100755 --- a/templates/repo/grampus/trainjob/gpu/new.tmpl +++ b/templates/repo/grampus/trainjob/gpu/new.tmpl @@ -113,7 +113,7 @@ Ascend NPU
- {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $}}
diff --git a/templates/repo/grampus/trainjob/npu/new.tmpl b/templates/repo/grampus/trainjob/npu/new.tmpl index 1e863ce17..f23942e13 100755 --- a/templates/repo/grampus/trainjob/npu/new.tmpl +++ b/templates/repo/grampus/trainjob/npu/new.tmpl @@ -108,7 +108,7 @@ Ascend NPU
- {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $}}
diff --git a/templates/repo/modelarts/inferencejob/new.tmpl b/templates/repo/modelarts/inferencejob/new.tmpl index 116f53a45..89f4180c0 100644 --- a/templates/repo/modelarts/inferencejob/new.tmpl +++ b/templates/repo/modelarts/inferencejob/new.tmpl @@ -90,7 +90,7 @@ Ascend NPU
- {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $}}
diff --git a/templates/repo/modelarts/trainjob/new.tmpl b/templates/repo/modelarts/trainjob/new.tmpl index 39f9f30f5..e89482dc2 100755 --- a/templates/repo/modelarts/trainjob/new.tmpl +++ b/templates/repo/modelarts/trainjob/new.tmpl @@ -118,7 +118,7 @@ Ascend NPU
- {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $}}
From f3e2aa822f8b0994bcabe6bc7536bca85299feb2 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 19 Jul 2022 11:30:44 +0800 Subject: [PATCH 09/21] fix issue --- templates/repo/cloudbrain/benchmark/new.tmpl | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index e964112e0..fb1296d27 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -351,5 +351,4 @@ $('.ui.create_train_job.green.button').click(function (e) { validate() }) - console.log({{$.QueuesDetail}}) \ No newline at end of file From 05823cd6031a7fa0f0ba976f25c848bf8fd15f0e Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 19 Jul 2022 14:07:45 +0800 Subject: [PATCH 10/21] fix issue --- web_src/js/features/cloudrbanin.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web_src/js/features/cloudrbanin.js b/web_src/js/features/cloudrbanin.js index b7a9e4eef..248692abf 100644 --- a/web_src/js/features/cloudrbanin.js +++ b/web_src/js/features/cloudrbanin.js @@ -123,7 +123,7 @@ export default async function initCloudrain() { "KILLED", "COMPLETED", "SUCCEEDED", - "CREATE_FAILED" + "CREATE_FAILED", ].includes(status) ) { $("#ai-delete-" + ID) @@ -505,6 +505,7 @@ export default async function initCloudrain() { test.set(element.slice(0, -2), parseInt(element.slice(-1))); } }); + console.log("---test", test); $(".ui.search.dropdown.gpu-type").dropdown({ onChange: function (value, text, $selectedItem) { let gpuTypeNums = test.get(value); From da945412df3bda13b539a9e3972b9349a1311fff Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 19 Jul 2022 14:14:53 +0800 Subject: [PATCH 11/21] fix issue --- templates/custom/wait_count_train.tmpl | 2 +- web_src/js/features/cloudrbanin.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/custom/wait_count_train.tmpl b/templates/custom/wait_count_train.tmpl index c31e85fae..fcfadc5be 100644 --- a/templates/custom/wait_count_train.tmpl +++ b/templates/custom/wait_count_train.tmpl @@ -16,7 +16,7 @@ class="ri-error-warning-line" style="margin-right: 0.5rem; font-size: 16px" > - {{.ctx.i18n.Tr "repo.wait_count_start"}} {{if .type}} {{ $gpuQueue }} diff --git a/web_src/js/features/cloudrbanin.js b/web_src/js/features/cloudrbanin.js index 248692abf..a3557f69e 100644 --- a/web_src/js/features/cloudrbanin.js +++ b/web_src/js/features/cloudrbanin.js @@ -509,6 +509,8 @@ export default async function initCloudrain() { $(".ui.search.dropdown.gpu-type").dropdown({ onChange: function (value, text, $selectedItem) { let gpuTypeNums = test.get(value); + console.log("gpuType:", value); + console.log("gpuTypeNums:", gpuTypeNums); let gpuTypeNumString = $(".cloudbrain-type").data("queue-start") + " " + From d37d74f6b991fc68b49dfbc62893f17f765d9c1f Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 19 Jul 2022 14:19:25 +0800 Subject: [PATCH 12/21] fix issue --- web_src/js/features/cloudrbanin.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/web_src/js/features/cloudrbanin.js b/web_src/js/features/cloudrbanin.js index a3557f69e..172e6b0bd 100644 --- a/web_src/js/features/cloudrbanin.js +++ b/web_src/js/features/cloudrbanin.js @@ -505,12 +505,9 @@ export default async function initCloudrain() { test.set(element.slice(0, -2), parseInt(element.slice(-1))); } }); - console.log("---test", test); $(".ui.search.dropdown.gpu-type").dropdown({ onChange: function (value, text, $selectedItem) { let gpuTypeNums = test.get(value); - console.log("gpuType:", value); - console.log("gpuTypeNums:", gpuTypeNums); let gpuTypeNumString = $(".cloudbrain-type").data("queue-start") + " " + From 4cf983156d7630b1cf29cecfd5808eceb86d76a1 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 19 Jul 2022 14:38:59 +0800 Subject: [PATCH 13/21] fix issue --- templates/repo/cloudbrain/benchmark/show.tmpl | 7 +------ templates/repo/cloudbrain/show.tmpl | 7 +------ templates/repo/grampus/trainjob/show.tmpl | 7 +------ templates/repo/modelarts/notebook/show.tmpl | 8 +------- 4 files changed, 4 insertions(+), 25 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/show.tmpl b/templates/repo/cloudbrain/benchmark/show.tmpl index 59ce3c471..ff4e5e7ea 100755 --- a/templates/repo/cloudbrain/benchmark/show.tmpl +++ b/templates/repo/cloudbrain/benchmark/show.tmpl @@ -232,12 +232,7 @@
- {{if not (eq .StartTime 0)}} - {{TimeSinceUnix1 .StartTime}} - {{else}} - {{TimeSinceUnix1 .CreatedUnix}} - - {{end}} + {{TimeSinceUnix1 .CreatedUnix}} {{$.i18n.Tr "repo.modelarts.status"}}: diff --git a/templates/repo/cloudbrain/show.tmpl b/templates/repo/cloudbrain/show.tmpl index f5ad6b5db..e4769c65c 100755 --- a/templates/repo/cloudbrain/show.tmpl +++ b/templates/repo/cloudbrain/show.tmpl @@ -240,12 +240,7 @@
- {{if not (eq .StartTime 0)}} - {{TimeSinceUnix1 .StartTime}} - {{else}} - {{TimeSinceUnix1 .CreatedUnix}} - - {{end}} + {{TimeSinceUnix1 .CreatedUnix}} {{$.i18n.Tr "repo.modelarts.status"}}: diff --git a/templates/repo/grampus/trainjob/show.tmpl b/templates/repo/grampus/trainjob/show.tmpl index 53201a467..0572e9de1 100755 --- a/templates/repo/grampus/trainjob/show.tmpl +++ b/templates/repo/grampus/trainjob/show.tmpl @@ -251,12 +251,7 @@
- - {{if not (eq .StartTime 0)}} - {{TimeSinceUnix1 .StartTime}} - {{else}} - {{TimeSinceUnix1 .CreatedUnix}} - {{end}} + {{TimeSinceUnix1 .CreatedUnix}} {{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}} diff --git a/templates/repo/modelarts/notebook/show.tmpl b/templates/repo/modelarts/notebook/show.tmpl index c36a5b104..6eb93b509 100755 --- a/templates/repo/modelarts/notebook/show.tmpl +++ b/templates/repo/modelarts/notebook/show.tmpl @@ -246,14 +246,8 @@
- {{if not (eq .StartTime 0)}} - {{TimeSinceUnix1 .StartTime}} - {{else}} - {{TimeSinceUnix1 .CreatedUnix}} - - {{end}} + {{TimeSinceUnix1 .CreatedUnix}} - {{$.i18n.Tr "repo.modelarts.status"}}: Date: Tue, 19 Jul 2022 15:39:01 +0800 Subject: [PATCH 14/21] fix issue --- templates/repo/modelarts/trainjob/show.tmpl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/templates/repo/modelarts/trainjob/show.tmpl b/templates/repo/modelarts/trainjob/show.tmpl index 794e42457..464fc9f30 100755 --- a/templates/repo/modelarts/trainjob/show.tmpl +++ b/templates/repo/modelarts/trainjob/show.tmpl @@ -292,11 +292,8 @@
- {{if not (eq .Cloudbrain.StartTime 0)}} - {{TimeSinceUnix1 .Cloudbrain.StartTime}} - {{else}} {{TimeSinceUnix1 .Cloudbrain.CreatedUnix}} - {{end}} + {{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}} From 346db1fd08360e83ae9031e1b96ae9e0460bb141 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 19 Jul 2022 16:30:51 +0800 Subject: [PATCH 15/21] fix issue --- templates/repo/cloudbrain/trainjob/show.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/cloudbrain/trainjob/show.tmpl b/templates/repo/cloudbrain/trainjob/show.tmpl index da7402eb0..c5880a343 100644 --- a/templates/repo/cloudbrain/trainjob/show.tmpl +++ b/templates/repo/cloudbrain/trainjob/show.tmpl @@ -327,7 +327,7 @@
{{TimeSinceUnix1 .CreatedUnix}} + class="">{{TimeSinceUnix1 .StartTime}}
From d2e9e7de8563e0bd196d6831a7a7d9d8d1f54f4f Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 19 Jul 2022 16:49:58 +0800 Subject: [PATCH 16/21] fix issue --- templates/repo/cloudbrain/inference/show.tmpl | 6 +++--- templates/repo/cloudbrain/trainjob/show.tmpl | 9 +++++++-- templates/repo/grampus/trainjob/show.tmpl | 2 +- templates/repo/modelarts/inferencejob/show.tmpl | 6 +++--- templates/repo/modelarts/trainjob/show.tmpl | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/templates/repo/cloudbrain/inference/show.tmpl b/templates/repo/cloudbrain/inference/show.tmpl index 909cde468..00ad25644 100644 --- a/templates/repo/cloudbrain/inference/show.tmpl +++ b/templates/repo/cloudbrain/inference/show.tmpl @@ -317,9 +317,9 @@ {{if not (eq .StartTime 0)}} {{TimeSinceUnix1 .StartTime}} - {{else}} - {{TimeSinceUnix1 .CreatedUnix}} - {{end}} + {{else}} + -- + {{end}}
diff --git a/templates/repo/cloudbrain/trainjob/show.tmpl b/templates/repo/cloudbrain/trainjob/show.tmpl index c5880a343..20e5cb55d 100644 --- a/templates/repo/cloudbrain/trainjob/show.tmpl +++ b/templates/repo/cloudbrain/trainjob/show.tmpl @@ -326,8 +326,13 @@
- {{TimeSinceUnix1 .StartTime}} + + {{if not (eq .StartTime 0)}} + {{TimeSinceUnix1 .StartTime}} + {{else}} + -- + {{end}} +
diff --git a/templates/repo/grampus/trainjob/show.tmpl b/templates/repo/grampus/trainjob/show.tmpl index 0572e9de1..5d4321736 100755 --- a/templates/repo/grampus/trainjob/show.tmpl +++ b/templates/repo/grampus/trainjob/show.tmpl @@ -345,7 +345,7 @@ {{if not (eq .StartTime 0)}} {{TimeSinceUnix1 .StartTime}} {{else}} - {{TimeSinceUnix1 .CreatedUnix}} + -- {{end}}
diff --git a/templates/repo/modelarts/inferencejob/show.tmpl b/templates/repo/modelarts/inferencejob/show.tmpl index 99deee551..14bb5cf24 100644 --- a/templates/repo/modelarts/inferencejob/show.tmpl +++ b/templates/repo/modelarts/inferencejob/show.tmpl @@ -266,9 +266,9 @@ td, th { {{if not (eq .StartTime 0)}} {{TimeSinceUnix1 .StartTime}} - {{else}} - {{TimeSinceUnix1 .CreatedUnix}} - {{end}} + {{else}} + -- + {{end}}
diff --git a/templates/repo/modelarts/trainjob/show.tmpl b/templates/repo/modelarts/trainjob/show.tmpl index 464fc9f30..7a727cf4c 100755 --- a/templates/repo/modelarts/trainjob/show.tmpl +++ b/templates/repo/modelarts/trainjob/show.tmpl @@ -377,7 +377,7 @@ {{if not (eq .Cloudbrain.StartTime 0)}} {{TimeSinceUnix1 .Cloudbrain.StartTime}} {{else}} - {{TimeSinceUnix1 .Cloudbrain.CreatedUnix}} + -- {{end}}
From e3856f7b6325b76546a1027c43ba08e78ca079ef Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 19 Jul 2022 16:53:32 +0800 Subject: [PATCH 17/21] fix issue --- templates/repo/modelarts/notebook/show.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/modelarts/notebook/show.tmpl b/templates/repo/modelarts/notebook/show.tmpl index 6eb93b509..7d49ace86 100755 --- a/templates/repo/modelarts/notebook/show.tmpl +++ b/templates/repo/modelarts/notebook/show.tmpl @@ -407,7 +407,7 @@
- + {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}} From fceebb9e8c429bc1acc8f5b095608c2d825acbdf Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 19 Jul 2022 18:09:44 +0800 Subject: [PATCH 18/21] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/repo/cloudbrain.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 7af36641d..31bf1b887 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -662,14 +662,35 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo if cloudbrain.TrainResourceSpecs == nil { json.Unmarshal([]byte(setting.TrainResourceSpecs), &cloudbrain.TrainResourceSpecs) } + hasSpec := false for _, tmp := range cloudbrain.TrainResourceSpecs.ResourceSpec { if tmp.Id == task.ResourceSpecId { + hasSpec = true ctx.Data["GpuNum"] = tmp.GpuNum ctx.Data["CpuNum"] = tmp.CpuNum ctx.Data["MemMiB"] = tmp.MemMiB ctx.Data["ShareMemMiB"] = tmp.ShareMemMiB } } + + if !hasSpec && cloudbrain.SpecialPools != nil { + for _, specialPool := range cloudbrain.SpecialPools.Pools { + + if specialPool.ResourceSpec != nil { + + for _, spec := range specialPool.ResourceSpec { + if task.ResourceSpecId == spec.Id { + ctx.Data["GpuNum"] = spec.GpuNum + ctx.Data["CpuNum"] = spec.CpuNum + ctx.Data["MemMiB"] = spec.MemMiB + ctx.Data["ShareMemMiB"] = spec.ShareMemMiB + break + } + } + } + } + } + } else if task.JobType == string(models.JobTypeInference) { if cloudbrain.InferenceResourceSpecs == nil { json.Unmarshal([]byte(setting.InferenceResourceSpecs), &cloudbrain.InferenceResourceSpecs) From 38ef62470f012920f4fc689681b4aedb8b2eb36b Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 19 Jul 2022 18:32:11 +0800 Subject: [PATCH 19/21] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/repo/cloudbrain.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 31bf1b887..0d20f83f0 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -731,6 +731,15 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo ctx.Data["resource_type"] = resourceType.Value } } + for _, specialPool := range cloudbrain.SpecialPools.Pools { + + for _, resourceType := range specialPool.Pool { + if resourceType.Queue == jobRes.Config.GpuType { + ctx.Data["resource_type"] = resourceType.Value + } + } + } + } else if task.JobType == string(models.JobTypeInference) { if inferenceGpuInfos == nil { json.Unmarshal([]byte(setting.InferenceGpuTypes), &inferenceGpuInfos) From eeea057bd8c3e0dbb46f513057798c6e8c0f6ec0 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 19 Jul 2022 18:34:04 +0800 Subject: [PATCH 20/21] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/custom_migrations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/custom_migrations.go b/models/custom_migrations.go index 041c4fb93..29c43b29a 100755 --- a/models/custom_migrations.go +++ b/models/custom_migrations.go @@ -17,7 +17,7 @@ type CustomMigrationStatic struct { var customMigrations = []CustomMigration{ //手机号功能可以不启用,不启用时手机号为空串,为了避免启用时唯一性约束报错,定制唯一性约束(对null和空字符串不做唯一性检查) - {"set phone number unique index", setPhoneNumberUniqueIndex}, + //{"set phone number unique index", setPhoneNumberUniqueIndex}, } var customMigrationsStatic []CustomMigrationStatic From 62ea71cb3a1258ffae670d98062e90d598031537 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 19 Jul 2022 18:40:50 +0800 Subject: [PATCH 21/21] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/custom_migrations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/custom_migrations.go b/models/custom_migrations.go index 29c43b29a..041c4fb93 100755 --- a/models/custom_migrations.go +++ b/models/custom_migrations.go @@ -17,7 +17,7 @@ type CustomMigrationStatic struct { var customMigrations = []CustomMigration{ //手机号功能可以不启用,不启用时手机号为空串,为了避免启用时唯一性约束报错,定制唯一性约束(对null和空字符串不做唯一性检查) - //{"set phone number unique index", setPhoneNumberUniqueIndex}, + {"set phone number unique index", setPhoneNumberUniqueIndex}, } var customMigrationsStatic []CustomMigrationStatic