Browse Source

Merge pull request '修复训练任务若干bug' (#973) from liuzx_trainjob into V20211115

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/973
Reviewed-by: lewis <747342561@qq.com>
pull/983/head
lewis 3 years ago
parent
commit
dd7b87fcf3
5 changed files with 19 additions and 12 deletions
  1. +6
    -4
      routers/repo/modelarts.go
  2. +1
    -1
      templates/repo/cloudbrain/index.tmpl
  3. +1
    -1
      templates/repo/modelarts/notebook/index.tmpl
  4. +8
    -3
      templates/repo/modelarts/trainjob/new.tmpl
  5. +3
    -3
      web_src/less/openi.less

+ 6
- 4
routers/repo/modelarts.go View File

@@ -370,6 +370,7 @@ func trainJobNewDataPrepare(ctx *context.Context) error {
ctx.Data["Branches"] = Branches
ctx.Data["BranchesCount"] = len(Branches)
ctx.Data["params"] = ""
ctx.Data["BranchName"] = ctx.Repo.BranchName

configList, err := getConfigList(modelarts.PerPage, 1, modelarts.SortByCreateTime, "desc", "", modelarts.ConfigTypeCustom)
if err != nil {
@@ -903,10 +904,11 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ
// }

//todo: del the codeLocalPath
_, err = ioutil.ReadDir(codeLocalPath)
if err == nil {
os.RemoveAll(codeLocalPath)
}
// _, err = ioutil.ReadDir(codeLocalPath)
// if err == nil {
// os.RemoveAll(codeLocalPath)
// }
os.RemoveAll(codeLocalPath)

gitRepo, _ := git.OpenRepository(repo.RepoPath())
commitID, _ := gitRepo.GetBranchCommitID(branch_name)


+ 1
- 1
templates/repo/cloudbrain/index.tmpl View File

@@ -399,7 +399,7 @@
<form class="ui compact buttons" id="delForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/del" method="post">
{{$.CsrfTokenHtml}}
{{if $.Permission.CanWrite $.UnitTypeCloudBrain}}
<a id="model-delete-{{.JobID}}" class="ui basic blue button {{if not .CanDel}}disabled {{end}}" onclick="assertDelete(this)" style="border-radius: .28571429rem;">
<a id="model-delete-{{.JobID}}" class="ui basic button {{if not .CanDel}}disabled {{else}} blue {{end}}" onclick="assertDelete(this)" style="border-radius: .28571429rem;">
{{$.i18n.Tr "repo.delete"}}
</a>
{{else}}


+ 1
- 1
templates/repo/modelarts/notebook/index.tmpl View File

@@ -352,7 +352,7 @@
<form class="ui compact buttons" id="delForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/del" method="post">
{{$.CsrfTokenHtml}}
{{if $.Permission.CanWrite $.UnitTypeCloudBrain}}
<a id="model-delete-{{.JobID}}" class="ui basic blue button {{if eq .Status "RUNNING" "CREATING" "WAITING" "STARTING" "STOPPING" }}disabled {{end}}" onclick="assertDelete(this)" style="border-radius: .28571429rem;">
<a id="model-delete-{{.JobID}}" class="ui basic button {{if eq .Status "RUNNING" "CREATING" "WAITING" "STARTING" "STOPPING" }}disabled {{else}} blue {{end}}" onclick="assertDelete(this)" style="border-radius: .28571429rem;">
{{$.i18n.Tr "repo.delete"}}
</a>
{{else}}


+ 8
- 3
templates/repo/modelarts/trainjob/new.tmpl View File

@@ -177,10 +177,15 @@
<select class="ui dropdown width80 left2" 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>
{{end}}
{{range $k, $v :=.Branches}}
<option name="branch_name" value="{{$v}}">{{$v}}</option>
{{end}}
</select>
</div>



+ 3
- 3
web_src/less/openi.less View File

@@ -289,7 +289,7 @@ footer .column{margin-bottom:0!important; padding-bottom:0!important;}
.dropdown-menu {
position: relative;
display: inline-block;
margin-top: 4px;
}
.hover_active{
@@ -305,8 +305,8 @@ display: block;
-webkit-box-shadow: none !important;
box-shadow: none !important;
border-radius: .28571429rem .28571429rem 0 0!important;
color: rgba(0,0,0,.95);
border-top-width: 1px;
color: rgba(0,0,0,.95) !important;
border-top-width: 1px !important;
}



Loading…
Cancel
Save