|
|
|
@@ -236,8 +236,6 @@ func GrampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain |
|
|
|
VersionOutputPath := modelarts.GetOutputPathByCount(modelarts.TotalVersionCount) |
|
|
|
displayJobName := form.DisplayJobName |
|
|
|
jobName := util.ConvertDisplayJobNameToJobName(displayJobName) |
|
|
|
//todo:del |
|
|
|
jobName = displayJobName |
|
|
|
uuid := form.Attachment |
|
|
|
description := form.Description |
|
|
|
bootFile := form.BootFile |
|
|
|
@@ -252,8 +250,6 @@ func GrampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain |
|
|
|
VersionCount := modelarts.VersionCount |
|
|
|
EngineName := form.EngineName |
|
|
|
|
|
|
|
log.Info(jobName) |
|
|
|
|
|
|
|
count, err := models.GetGrampusCountByUserID(ctx.User.ID, string(models.JobTypeTrain), models.NPUResource) |
|
|
|
if err != nil { |
|
|
|
log.Error("GetGrampusCountByUserID failed:%v", err, ctx.Data["MsgID"]) |
|
|
|
@@ -387,10 +383,10 @@ func GrampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain |
|
|
|
//PoolID: poolID, |
|
|
|
Uuid: uuid, |
|
|
|
//Parameters: param, |
|
|
|
CommitID: commitID, |
|
|
|
IsLatestVersion: isLatestVersion, |
|
|
|
BranchName: branchName, |
|
|
|
//Params: form.Params, |
|
|
|
CommitID: commitID, |
|
|
|
IsLatestVersion: isLatestVersion, |
|
|
|
BranchName: branchName, |
|
|
|
Params: form.Params, |
|
|
|
FlavorName: FlavorName, |
|
|
|
EngineName: EngineName, |
|
|
|
VersionCount: VersionCount, |
|
|
|
@@ -507,7 +503,6 @@ func deleteGrampusJob(ctx *context.Context) error { |
|
|
|
|
|
|
|
func GrampusTrainJobShow(ctx *context.Context) { |
|
|
|
ctx.Data["PageIsCloudBrain"] = true |
|
|
|
//debugListType := ctx.Query("debugListType") |
|
|
|
|
|
|
|
var task *models.Cloudbrain |
|
|
|
task, err := models.GetCloudbrainByJobIDWithDeleted(ctx.Params(":jobid")) |
|
|
|
@@ -522,9 +517,24 @@ func GrampusTrainJobShow(ctx *context.Context) { |
|
|
|
task.DatasetName = attachment.Name |
|
|
|
} |
|
|
|
|
|
|
|
taskList := make([]*models.Cloudbrain, 0) |
|
|
|
taskList = append(taskList, task) |
|
|
|
ctx.Data["version_list_task"] = taskList |
|
|
|
if len(task.Parameters) > 0 { |
|
|
|
var parameters models.Parameters |
|
|
|
err := json.Unmarshal([]byte(task.Parameters), ¶meters) |
|
|
|
if err != nil { |
|
|
|
log.Error("Failed to Unmarshal Parameters: %s (%v)", task.Parameters, err) |
|
|
|
ctx.ServerError("system error", err) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if len(parameters.Parameter) > 0 { |
|
|
|
paramTemp := "" |
|
|
|
for _, Parameter := range parameters.Parameter { |
|
|
|
param := Parameter.Label + " = " + Parameter.Value + "; " |
|
|
|
paramTemp = paramTemp + param |
|
|
|
} |
|
|
|
task.Parameters = paramTemp[:len(paramTemp)-2] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if task.DeletedAt.IsZero() { //normal record |
|
|
|
result, err := grampus.GetJob(task.JobID) |
|
|
|
@@ -555,6 +565,10 @@ func GrampusTrainJobShow(ctx *context.Context) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
taskList := make([]*models.Cloudbrain, 0) |
|
|
|
taskList = append(taskList, task) |
|
|
|
ctx.Data["version_list_task"] = taskList |
|
|
|
|
|
|
|
ctx.HTML(http.StatusOK, tplGrampusTrainJobShow) |
|
|
|
} |
|
|
|
|
|
|
|
|