Browse Source

specs useage

tags/v1.22.9.1^2^2
chenshihai 3 years ago
parent
commit
56ca9b6a66
4 changed files with 42 additions and 20 deletions
  1. +17
    -15
      templates/repo/cloudbrain/benchmark/show.tmpl
  2. +2
    -2
      templates/repo/cloudbrain/show.tmpl
  3. +20
    -2
      templates/repo/modelarts/trainjob/version_new.tmpl
  4. +3
    -1
      web_src/js/standalone/specsuse.js

+ 17
- 15
templates/repo/cloudbrain/benchmark/show.tmpl View File

@@ -466,7 +466,7 @@

<td class="ti-text-form-content spec">
<div class="text-span text-span-w">
{{$.resource_spec}}
{{$.resource_spec}}
</div>
</td>
</tr>
@@ -572,7 +572,21 @@
</div>
{{template "base/footer" .}}
<script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>

<script>
;(function() {
var SPEC = {{ $.Spec }};
var showPoint = true;
var specStr = window.renderSpecStr(SPEC, 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"}},
});
$('td.ti-text-form-content.spec div').text(specStr);
$('td.ti-text-form-content.resorce_type div').text(getListValueWithKey(ACC_CARD_TYPE, SPEC.AccCardType));
})();
</script>
<script>
$('.menu .item').tab()

@@ -607,17 +621,5 @@
});
}

;(function() {
var SPEC = {{ .Spec }};
var showPoint = true;
var specStr = window.renderSpecStr(SPEC, 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"}},
});
$('td.ti-text-form-content.spec div').text(specStr);
$('td.ti-text-form-content.resorce_type div').text(getListValueWithKey(ACC_CARD_TYPE, SPEC.AccCardType));
})();
</script>

+ 2
- 2
templates/repo/cloudbrain/show.tmpl View File

@@ -601,7 +601,7 @@
memory: {{$.i18n.Tr "cloudbrain.memory"}},
shared_memory: {{$.i18n.Tr "cloudbrain.shared_memory"}},
});
$('td.ti-text-form-content.spec').text(specStr);
$('td.ti-text-form-content.resorce_type').text(getListValueWithKey(ACC_CARD_TYPE, SPEC.AccCardType));
$('td.ti-text-form-content.spec div').text(specStr);
$('td.ti-text-form-content.resorce_type div').text(getListValueWithKey(ACC_CARD_TYPE, SPEC.AccCardType));
})();
</script>

+ 20
- 2
templates/repo/modelarts/trainjob/version_new.tmpl View File

@@ -217,7 +217,7 @@
</div>
</div>

<div class="required unite min_title inline field" id="flaver_name">
<!--<div class="required unite min_title inline field" id="flaver_name">
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label>
<select class="ui dropdown width81" id="trainjob-flavor" style='width:385px' name="flavor">
{{if .flavor_name}}
@@ -229,6 +229,10 @@
{{end}}
{{end}}
</select>
</div>-->
<div class="required unite min_title inline field" id="flaver_name">
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.standard"}}</label>
<select id="__specs__" class="ui dropdown width81" style='width:385px' name="spec_id"></select>
</div>
<div class="inline required unite min_title field">
<label style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.amount_of_compute_node"}}</label>
@@ -255,6 +259,7 @@
</div>
</div>
{{template "base/footer" .}}
<script src="{{StaticUrlPrefix}}/js/specsuse.js?v={{MD5 AppVer}}" type="text/javascript"></script>

<script>
let url_href = location.pathname.split('/create_version')[0]
@@ -518,10 +523,23 @@
$("input#ai_flaver_name").val(name2)

}

validate()
$('.ui.create_train_job.green.button').click(function(e) {
get_name()
send_run_para()
validate()
})

;(function() {
var SPECS = {{ .Specs }};
var showPoint = true;
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>

+ 3
- 1
web_src/js/standalone/specsuse.js View File

@@ -9,10 +9,12 @@ window.getListValueWithKey = (list, key, k = 'k', v = 'v', defaultV = '') => {
};

window.renderSpecStr = (spec, showPoint, langObj) => {
showPoint = false;
var ngpu = `${spec.ComputeResource}: ${spec.AccCardsNum === 0 ? '0' : spec.AccCardsNum + '*' + getListValueWithKey(ACC_CARD_TYPE, spec.AccCardType)}`;
var gpuMemStr = spec.GPUMemGiB != 0 ? `${langObj.gpu_memory}: ${spec.GPUMemGiB}GB, ` : '';
var sharedMemStr = spec.ShareMemGiB != 0 ? `, ${langObj.shared_memory}: ${spec.ShareMemGiB}GB` : '';
var pointStr = showPoint ? `, ${spec.UnitPrice == 0 ? langObj.free : spec.UnitPrice + langObj.point_hr}` : '';
var specStr = `${ngpu}, CPU: ${spec.CpuCores}, ${gpuMemStr}${langObj.memory}: ${spec.MemGiB}GB, ${langObj.shared_memory}: ${spec.ShareMemGiB}GB${pointStr}`;
var specStr = `${ngpu}, CPU: ${spec.CpuCores}, ${gpuMemStr}${langObj.memory}: ${spec.MemGiB}GB${sharedMemStr}${pointStr}`;
return specStr;
};



Loading…
Cancel
Save