|
|
|
@@ -0,0 +1,229 @@ |
|
|
|
{{template "base/head" .}} |
|
|
|
{{template "custom/global_mask" .}} |
|
|
|
<div class="repository"> |
|
|
|
{{template "repo/header" .}} |
|
|
|
<div class="ui container"> |
|
|
|
<div class="cloudbrain-type" style="display: none;" data-cloudbrain-type="{{.datasetType}}" data-repo-link="{{.RepoLink}}" data-flag-model="true"></div> |
|
|
|
{{if eq .NotStopTaskCount 0}} |
|
|
|
{{template "base/alert" .}} |
|
|
|
{{end}} |
|
|
|
<div class="ui negative message" id="messageInfo" style="display: none;"> |
|
|
|
<p></p> |
|
|
|
</div> |
|
|
|
<h4 class="ui top attached header"> |
|
|
|
{{.i18n.Tr "repo.modelarts.train_job.new_debug"}} |
|
|
|
</h4> |
|
|
|
{{template "custom/alert_cb" .}} |
|
|
|
<div class="ui attached segment"> |
|
|
|
<form class="ui form" id="form_id" action="{{.Link}}" method="post"> |
|
|
|
<input type="hidden" name="type" value="2"> |
|
|
|
<input type="hidden" name="image" value=""> |
|
|
|
{{.CsrfTokenHtml}} |
|
|
|
<h4 class="train-job-title ui header ">{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}:</h4> |
|
|
|
<div class="required min_title inline field"> |
|
|
|
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.resource_cluster"}}</label> |
|
|
|
<div class="ui blue mini menu compact selectcloudbrain"> |
|
|
|
<a class="item" href="{{.RepoLink}}/cloudbrain/create"> |
|
|
|
<svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg> |
|
|
|
{{.i18n.Tr "cloudbrain.resource_cluster_openi"}} |
|
|
|
</a> |
|
|
|
<a class="active item" href="{{.RepoLink}}/grampus/notebook/create?type=1"> |
|
|
|
<svg class="svg" sxmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.29-2.333A17.9 17.9 0 0 1 8.027 13H4.062a8.008 8.008 0 0 0 5.648 6.667zM10.03 13c.151 2.439.848 4.73 1.97 6.752A15.905 15.905 0 0 0 13.97 13h-3.94zm9.908 0h-3.965a17.9 17.9 0 0 1-1.683 6.667A8.008 8.008 0 0 0 19.938 13zM4.062 11h3.965A17.9 17.9 0 0 1 9.71 4.333 8.008 8.008 0 0 0 4.062 11zm5.969 0h3.938A15.905 15.905 0 0 0 12 4.248 15.905 15.905 0 0 0 10.03 11zm4.259-6.667A17.9 17.9 0 0 1 15.973 11h3.965a8.008 8.008 0 0 0-5.648-6.667z"></path></svg> |
|
|
|
{{.i18n.Tr "cloudbrain.resource_cluster_c2net"}}(Beta) |
|
|
|
</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="inline required field"> |
|
|
|
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.compute_resource"}}</label> |
|
|
|
<div class="ui blue small menu compact selectcloudbrain"> |
|
|
|
<a class="item" href="{{.RepoLink}}/grampus/notebook/create?type=0"> |
|
|
|
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"> |
|
|
|
<path fill="none" d="M0 0h24v24H0z"/> |
|
|
|
<path d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z"/> |
|
|
|
</svg> |
|
|
|
CPU/GPU</a> |
|
|
|
<a class="item" href="{{.RepoLink}}/grampus/notebook/create?type=1"> |
|
|
|
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"> |
|
|
|
<path fill="none" d="M0 0h24v24H0z"/> |
|
|
|
<path d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z"/> |
|
|
|
</svg> |
|
|
|
Ascend NPU</a> |
|
|
|
<a class="active item" href="{{.RepoLink}}/grampus/notebook/create?type=2"> |
|
|
|
<svg class="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"> |
|
|
|
<path fill="none" d="M0 0h24v24H0z"/> |
|
|
|
<path d="M3 2.992C3 2.444 3.445 2 3.993 2h16.014a1 1 0 0 1 .993.992v18.016a.993.993 0 0 1-.993.992H3.993A1 1 0 0 1 3 21.008V2.992zM19 11V4H5v7h14zm0 2H5v7h14v-7zM9 6h6v2H9V6zm0 9h6v2H9v-2z"/> |
|
|
|
</svg> |
|
|
|
GCU</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="inline field"> |
|
|
|
<label class="label-fix-width" style="font-weight: normal;"></label> |
|
|
|
{{template "custom/task_wait_count" .}} |
|
|
|
</div> |
|
|
|
<div class="inline min_title required field" style="margin-bottom: 0rem !important;"> |
|
|
|
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.task_name"}}</label> |
|
|
|
<input name="display_job_name" id="cloudbrain_job_name" placeholder="任务名称" style="width: 60%;" value="{{.display_job_name}}" tabindex="3" autofocus required maxlength="36" onkeyup="this.value=this.value.replace(/[, ]/g,'')"> |
|
|
|
</div> |
|
|
|
<span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 2rem;">{{.i18n.Tr "repo.cloudbrain_jobname_err"}}</span> |
|
|
|
<div class="inline min_title field"> |
|
|
|
<label class="label-fix-width" style="font-weight: normal;" for="description">{{.i18n.Tr "repo.modelarts.train_job.description"}}</label> |
|
|
|
{{if .description}} |
|
|
|
<textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="255" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}}>{{.description}}</textarea> |
|
|
|
{{else}} |
|
|
|
<textarea style="width: 80%;" id="description" name="description" rows="3" maxlength="255" placeholder={{.i18n.Tr "repo.modelarts.train_job.new_place"}} onchange="this.value=this.value.substring(0, 255)" onkeydown="this.value=this.value.substring(0, 255)" onkeyup="this.value=this.value.substring(0, 255)"></textarea> |
|
|
|
{{end}} |
|
|
|
</div> |
|
|
|
<div class="ui divider"></div> |
|
|
|
<div class="inline min_title required field"> |
|
|
|
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.code_version"}}</label> |
|
|
|
<select class="ui dropdown width80 left2 {{if not .Branches}}error{{end}}" id="code_version" |
|
|
|
name="branch_name"> |
|
|
|
{{if .branch_name}} |
|
|
|
<option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> |
|
|
|
{{range $k, $v :=.Branches}} |
|
|
|
{{ if ne $v $.branch_name }} |
|
|
|
<option name="branch_name" value="{{$v}}">{{$v}}</option> |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
{{else}} |
|
|
|
<option name="branch_name" value="{{.branchName}}">{{.branchName}}</option> |
|
|
|
{{range $k, $v :=.Branches}} |
|
|
|
{{ if ne $v $.branchName }} |
|
|
|
<option name="branch_name" value="{{$v}}">{{$v}}</option> |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
{{end}} |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
{{template "custom/select_model" .}} |
|
|
|
<script> |
|
|
|
var IMAGES = {{ .images}}; |
|
|
|
</script> |
|
|
|
<div class="inline min_title required field"> |
|
|
|
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.mirror"}}</label> |
|
|
|
<select class="ui search dropdown cloudbrain_image width48" placeholder="{{.i18n.Tr "cloudbrain.choose_mirror"}}" style='width:385px' name="image_id"> |
|
|
|
{{range .images}} |
|
|
|
<option name="image_id" value="{{.ID}}">{{.Name}}</option> |
|
|
|
{{end}} |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div id="select-multi-dataset"> |
|
|
|
|
|
|
|
</div> |
|
|
|
<span class="tooltips" style="margin-left: 11.5rem;margin-bottom: 1rem;"></span> |
|
|
|
<div class="inline min_title required field"> |
|
|
|
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "cloudbrain.specification"}}</label> |
|
|
|
<select id="__specs__" class="ui search dropdown width48" ovalue="{{.spec_id}}" |
|
|
|
{{if .CloudBrainPaySwitch}}blance="{{.PointAccount.Balance}}"{{end}} |
|
|
|
placeholder="{{.i18n.Tr "cloudbrain.select_specification"}}" style='width:385px' name="spec_id"></select> |
|
|
|
<span><i class="question circle icon link"></i></span> |
|
|
|
<a href="{{AppSubUrl}}/resource_desc" target="_blank">{{.i18n.Tr "custom.resource_description"}}</a> |
|
|
|
{{if .CloudBrainPaySwitch}} |
|
|
|
<div class="cloudbrain_resource_spec_blance_tip" style="padding:0 5px;margin:6px 0;margin-left:154px;font-size:12px;width:48.5%!important;"> |
|
|
|
<span>{{$.i18n.Tr "points.balance_of_points"}}<span style="color:red;margin: 0 3px">{{.PointAccount.Balance}}</span>{{$.i18n.Tr "points.points"}}</span><span>{{$.i18n.Tr "points.expected_time"}}<span style="color:red;margin: 0 3px" class="can-use-time"></span>{{$.i18n.Tr "points.hours"}}</span> |
|
|
|
<span style="float:right;"> |
|
|
|
<i class="question circle icon link" data-position="right center" data-variation="mini"></i> |
|
|
|
<a href="{{AppSubUrl}}/reward/point/rule" target="_blank">{{$.i18n.Tr "points.points_acquisition_instructions"}}</a> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
{{end}} |
|
|
|
</div> |
|
|
|
<div class="inline field"> |
|
|
|
<label class="label-fix-width" style="font-weight: normal;"></label> |
|
|
|
<button class="ui green button {{if eq .NotStopTaskCount 1}}disabled{{end}}"> |
|
|
|
{{.i18n.Tr "repo.cloudbrain.new"}} |
|
|
|
</button> |
|
|
|
<a class="ui button cancel" href="{{.RepoLink}}/debugjob?debugListType=all">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{{template "base/footer" .}} |
|
|
|
<script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script> |
|
|
|
<script> |
|
|
|
// 判断必填选项是否填写正确 |
|
|
|
let form = document.getElementById('form_id'); |
|
|
|
$('#messageInfo').css('display','none') |
|
|
|
var isValidate = false; |
|
|
|
function validate(){ |
|
|
|
$('.ui.form').form({ |
|
|
|
on: 'blur', |
|
|
|
fields: { |
|
|
|
display_job_name:{ |
|
|
|
identifier : 'display_job_name', |
|
|
|
rules: [ |
|
|
|
{ |
|
|
|
type: 'regExp[/^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/]', |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
spec_id: { |
|
|
|
identifier: 'spec_id', |
|
|
|
rules: [{ type: 'empty' }] |
|
|
|
} |
|
|
|
}, |
|
|
|
onSuccess: function(){ |
|
|
|
isValidate = true; |
|
|
|
}, |
|
|
|
onFailure: function(e){ |
|
|
|
isValidate = false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
validate(); |
|
|
|
let createFlag = false |
|
|
|
form.onsubmit = function(e){ |
|
|
|
if(!isValidate) return false; |
|
|
|
if(createFlag) return false; |
|
|
|
let value_task = $("input[name='display_job_name']").val() |
|
|
|
let re = /^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/ |
|
|
|
let flag = re.test(value_task) |
|
|
|
if(!flag){ |
|
|
|
$('#messageInfo').css('display','block') |
|
|
|
let str = '只能以小写字母或数字开头且只包含小写字母、数字、_和-,不能以_结尾,最长36个字符。' |
|
|
|
$('#messageInfo p').text(str) |
|
|
|
return false |
|
|
|
} |
|
|
|
let min_value_task = value_task.toLowerCase() |
|
|
|
$("input[name='display_job_name']").attr("value",min_value_task) |
|
|
|
document.getElementById("mask").style.display = "block" |
|
|
|
createFlag = true |
|
|
|
} |
|
|
|
// 页面加载完毕后遮罩层隐藏 |
|
|
|
document.onreadystatechange = function() { |
|
|
|
if (document.readyState === "complete") { |
|
|
|
document.getElementById("mask").style.display = "none" |
|
|
|
} |
|
|
|
} |
|
|
|
$(document).ready(function(){ |
|
|
|
$('input[name="image"]').val($('.cloudbrain_image').dropdown('get text')) |
|
|
|
$('.cloudbrain_image.ui.search.dropdown') |
|
|
|
.dropdown({ |
|
|
|
onChange: function(value, text, $selectedItem) { |
|
|
|
$('input[name="image"]').val(text) |
|
|
|
} |
|
|
|
}) |
|
|
|
$(document).keydown(function(event){ |
|
|
|
if(event.keyCode==13){ |
|
|
|
event.preventDefault(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
;(function() { |
|
|
|
var SPECS = {{ .Specs }}; |
|
|
|
var showPoint = {{ .CloudBrainPaySwitch }}; |
|
|
|
window.renderSpecsSelect($('#__specs__'), SPECS, showPoint, { |
|
|
|
gpu_memory: {{$.i18n.Tr "cloudbrain.gpu_memory"}}, |
|
|
|
free: {{$.i18n.Tr "cloudbrain.free"}}, |
|
|
|
point_hr: {{$.i18n.Tr "cloudbrain.point_hr"}}, |
|
|
|
memory: {{$.i18n.Tr "cloudbrain.memory"}}, |
|
|
|
shared_memory: {{$.i18n.Tr "cloudbrain.shared_memory"}}, |
|
|
|
}); |
|
|
|
})(); |
|
|
|
</script> |