Browse Source

Merge remote-tracking branch 'origin/grampus-notebook' into gcu

gcu
chenyifan01 2 years ago
parent
commit
e8fa11c79f
6 changed files with 15 additions and 20 deletions
  1. +0
    -10
      modules/grampus/grampus.go
  2. +1
    -0
      options/locale/locale_en-US.ini
  3. +1
    -0
      options/locale/locale_zh-CN.ini
  4. +9
    -9
      routers/repo/grampus.go
  5. +1
    -1
      templates/repo/grampus/notebook/gpu/new.tmpl
  6. +3
    -0
      web_src/vuepages/pages/notebook/debug/index.vue

+ 0
- 10
modules/grampus/grampus.go View File

@@ -189,16 +189,6 @@ func GenerateNotebookJob(ctx *context.Context, req *GenerateNotebookJobReq) (job
ContainerPath: cloudbrain.PretrainModelMountPath,
})
}

datasetGrampus = append(datasetGrampus, models.GrampusDataset{
Name: "modelOutput",
Bucket: setting.Attachment.Minio.Bucket,
EndPoint: setting.Attachment.Minio.Endpoint,
ReadOnly: false,
ObjectKey: req.ModelPath,
ContainerPath: cloudbrain.ModelMountPath,
})

codeGrampus = models.GrampusDataset{
Name: req.CodeName,
Bucket: setting.Attachment.Minio.Bucket,


+ 1
- 0
options/locale/locale_en-US.ini View File

@@ -3303,6 +3303,7 @@ load_code_failed=Fail to load code, please check if the right branch is selected
error.dataset_select = dataset select error:the count exceed the limit or has same name
new_train_gpu_tooltips = The code is storaged in <strong style="color:#010101">%s</strong>, the dataset is storaged in <strong style="color:#010101">%s</strong>, the pre-trained model is storaged in the run parameter <strong style="color:#010101">%s</strong>, and please put your model into <strong style="color:#010101">%s</strong> then you can download it online
new_debug_gpu_tooltips = The code is storaged in <strong style="color:#010101">%s</strong>, the dataset is storaged in <strong style="color:#010101">%s</strong>, the pre-trained model is storaged in the <strong style="color:#010101">%s</strong>, and please put your model into <strong style="color:#010101">%s</strong> then you can download it online
new_debug_gpu_tooltips1 = The code is storaged in <strong style="color:#010101">%s</strong>, the dataset is storaged in <strong style="color:#010101">%s</strong>, the pre-trained model is storaged in the <strong style="color:#010101">%s</strong>.
new_train_npu_tooltips = The code is storaged in <strong style="color:#010101">%s</strong>, the pre-trained model is storaged in the run parameter <strong style="color:#010101">%s</strong>, and please put your model into <strong style="color:#010101">%s</strong> then you can download it online
new_infer_gpu_tooltips = The dataset is stored in <strong style="color:#010101">%s</strong>, the model file is stored in <strong style="color:#010101">%s</strong>, please store the inference output in <strong style="color:#010101">%s</strong> for subsequent downloads.
code_obs_address = Code OBS address


+ 1
- 0
options/locale/locale_zh-CN.ini View File

@@ -3324,6 +3324,7 @@ load_code_failed=代码加载失败,请确认选择了正确的分支。
error.dataset_select = 数据集选择错误:数量超过限制或者有同名数据集
new_train_gpu_tooltips = 训练脚本存储在 <strong style="color:#010101">%s</strong> 中,数据集存储在 <strong style="color:#010101">%s</strong> 中,预训练模型存放在运行参数 <strong style="color:#010101">%s</strong> 中,训练输出请存储在 <strong style="color:#010101">%s</strong> 中以供后续下载。
new_debug_gpu_tooltips = 项目代码存储在 <strong style="color:#010101">%s</strong> 中,数据集存储在 <strong style="color:#010101">%s</strong> 中,选择的模型存储在 <strong style="color:#010101">%s</strong> 中,调试输出请存储在 <strong style="color:#010101">%s</strong> 中以供后续下载。
new_debug_gpu_tooltips1 = 项目代码存储在 <strong style="color:#010101">%s</strong> 中,数据集存储在 <strong style="color:#010101">%s</strong> 中,选择的模型存储在 <strong style="color:#010101">%s</strong> 中。
new_train_npu_tooltips = 训练脚本存储在 <strong style="color:#010101">%s</strong> 中,预训练模型存放在运行参数 <strong style="color:#010101">%s</strong> 中,训练输出请存储在 <strong style="color:#010101">%s</strong> 中以供后续下载。
new_infer_gpu_tooltips = 数据集存储在 <strong style="color:#010101">%s</strong> 中,模型文件存储在 <strong style="color:#010101">%s</strong> 中,推理输出请存储在 <strong style="color:#010101">%s</strong> 中以供后续下载。
code_obs_address = 代码obs地址


+ 9
- 9
routers/repo/grampus.go View File

@@ -112,7 +112,6 @@ func GrampusNotebookCreate(ctx *context.Context, form auth.CreateGrampusNotebook
image := strings.TrimSpace(form.Image)

codeStoragePath := setting.CBCodePathPrefix + jobName + cloudbrain.CodeMountPath + "/"
modelStoragePath := setting.CBCodePathPrefix + jobName + cloudbrain.ModelMountPath + "/"

tpl := tplGrampusNotebookGPUNew
processType := grampus.ProcessorTypeGPU
@@ -235,12 +234,6 @@ func GrampusNotebookCreate(ctx *context.Context, form auth.CreateGrampusNotebook
ctx.RenderWithErr(ctx.Tr("cloudbrain.load_code_failed"), tpl, &form)
return
}
errStr := initModelPath(jobName, cloudbrain.ModelMountPath)
if errStr != "" {
grampusNotebookNewDataPrepare(ctx, processType)
ctx.RenderWithErr(ctx.Tr(errStr), tpl, &form)
return
}

} else {

@@ -270,7 +263,6 @@ func GrampusNotebookCreate(ctx *context.Context, form auth.CreateGrampusNotebook
Spec: spec,
CodeStoragePath: codeStoragePath,
CodeName: strings.ToLower(repo.Name),
ModelPath: modelStoragePath + README,
}

if form.ModelName != "" { //使用预训练模型训练
@@ -1702,7 +1694,13 @@ func GrampusNotebookRestart(ctx *context.Context) {
res, err := grampus.RestartNotebookJob(task.JobID)
if err != nil {
log.Error("ManageNotebook2(%s) failed:%v", task.DisplayJobName, err.Error(), ctx.Data["MsgID"])
errorMsg = err.Error()
errorMsg = ctx.Tr("repo.debug_again_fail")
break
}

if res.GrampusResult.ErrorCode != 0 || res.NewId == "" {
log.Error("ManageNotebook2 failed:" + res.GrampusResult.ErrorMsg)
errorMsg = ctx.Tr("repo.debug_again_fail")
break
}

@@ -1717,6 +1715,8 @@ func GrampusNotebookRestart(ctx *context.Context) {
Type: task.Type,
Uuid: task.Uuid,
Image: task.Image,
BranchName: task.BranchName,
DatasetName: task.DatasetName,
ComputeResource: task.ComputeResource,
Description: task.Description,
CreatedUnix: createTime,


+ 1
- 1
templates/repo/grampus/notebook/gpu/new.tmpl View File

@@ -70,7 +70,7 @@
{{template "custom/task_wait_count" .}}
<div style="display: flex;align-items: center;margin-left: 156px;margin-top: 0.5rem;">
<i class="ri-error-warning-line" style="color: #f2711c;margin-right: 0.5rem;"></i>
<span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.new_debug_gpu_tooltips" "/code" "/dataset" "/pretrainmodel" "/model" | Safe}}</span>
<span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.new_debug_gpu_tooltips1" "/code" "/dataset" "/pretrainmodel" | Safe}}</span>
</div>
</div>
<div class="inline min_title required field" style="margin-bottom: 0rem !important;">


+ 3
- 0
web_src/vuepages/pages/notebook/debug/index.vue View File

@@ -343,6 +343,9 @@ export default {
if(err.response.status===403 && err.response.data.code===1 ){
location.href=`${AppSubUrl}/authentication/wechat/bind`
}
if(err.response.status===401){
location.href=`${AppSubUrl}/user/login`
}
this.btnStatus[index]=0
this.alertCb = false
Message.error(err)


Loading…
Cancel
Save