|
|
@@ -46,6 +46,22 @@ const ( |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
func DebugJobIndex(ctx *context.Context) { |
|
|
func DebugJobIndex(ctx *context.Context) { |
|
|
|
|
|
//到任务首页时将DisplayJobName更新, |
|
|
|
|
|
allTasks, count, err := models.Cloudbrains(&models.CloudbrainsOptions{}) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
ctx.ServerError("Get allTasks faild:", err) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
for i, task := range allTasks { |
|
|
|
|
|
if task.Cloudbrain.DisplayJobName == "" { |
|
|
|
|
|
task.Cloudbrain.DisplayJobName = allTasks[i].Cloudbrain.JobName |
|
|
|
|
|
err = models.UpdateDisplayJobName(&allTasks[i].Cloudbrain) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
log.Error("Update DisplayJobName failed:", err) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
debugListType := ctx.Query("debugListType") |
|
|
debugListType := ctx.Query("debugListType") |
|
|
ctx.Data["ListType"] = debugListType |
|
|
ctx.Data["ListType"] = debugListType |
|
|
MustEnableCloudbrain(ctx) |
|
|
MustEnableCloudbrain(ctx) |
|
|
@@ -479,9 +495,6 @@ func TrainJobIndex(ctx *context.Context) { |
|
|
tasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain) |
|
|
tasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain) |
|
|
tasks[i].CanModify = cloudbrain.CanModifyJob(ctx, &task.Cloudbrain) |
|
|
tasks[i].CanModify = cloudbrain.CanModifyJob(ctx, &task.Cloudbrain) |
|
|
tasks[i].ComputeResource = models.NPUResource |
|
|
tasks[i].ComputeResource = models.NPUResource |
|
|
if tasks[i].DisplayJobName == "" { |
|
|
|
|
|
tasks[i].DisplayJobName = tasks[i].JobName |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
pager := context.NewPagination(int(count), setting.UI.IssuePagingNum, page, 5) |
|
|
pager := context.NewPagination(int(count), setting.UI.IssuePagingNum, page, 5) |
|
|
@@ -676,8 +689,7 @@ func trainJobNewVersionDataPrepare(ctx *context.Context) error { |
|
|
return err |
|
|
return err |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
t := time.Now() |
|
|
|
|
|
var jobName = cutString(ctx.User.Name, 5) + t.Format("2006010215") + strconv.Itoa(int(t.Unix()))[5:] |
|
|
|
|
|
|
|
|
ctx.Data["display_job_name"] = task.DisplayJobName |
|
|
ctx.Data["job_name"] = task.JobName |
|
|
ctx.Data["job_name"] = task.JobName |
|
|
|
|
|
|
|
|
attachs, err := models.GetModelArtsTrainAttachments(ctx.User.ID) |
|
|
attachs, err := models.GetModelArtsTrainAttachments(ctx.User.ID) |
|
|
@@ -722,8 +734,8 @@ func trainJobNewVersionDataPrepare(ctx *context.Context) error { |
|
|
} |
|
|
} |
|
|
ctx.Data["params"] = Parameters.Parameter |
|
|
ctx.Data["params"] = Parameters.Parameter |
|
|
|
|
|
|
|
|
outputObsPath := "/" + setting.Bucket + modelarts.JobPath + jobName + modelarts.OutputPath |
|
|
|
|
|
ctx.Data["train_url"] = outputObsPath |
|
|
|
|
|
|
|
|
// outputObsPath := "/" + setting.Bucket + modelarts.JobPath + jobName + modelarts.OutputPath |
|
|
|
|
|
// ctx.Data["train_url"] = outputObsPath |
|
|
|
|
|
|
|
|
branches, _, err := ctx.Repo.GitRepo.GetBranches(0, 0) |
|
|
branches, _, err := ctx.Repo.GitRepo.GetBranches(0, 0) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
@@ -1065,6 +1077,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ |
|
|
} |
|
|
} |
|
|
VersionOutputPath := modelarts.GetOutputPathByCount(latestTask.TotalVersionCount + 1) |
|
|
VersionOutputPath := modelarts.GetOutputPathByCount(latestTask.TotalVersionCount + 1) |
|
|
|
|
|
|
|
|
|
|
|
displayJobName := form.DisplayJobName |
|
|
jobName := form.JobName |
|
|
jobName := form.JobName |
|
|
uuid := form.Attachment |
|
|
uuid := form.Attachment |
|
|
description := form.Description |
|
|
description := form.Description |
|
|
@@ -1226,7 +1239,8 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
req := &modelarts.GenerateTrainJobReq{ |
|
|
req := &modelarts.GenerateTrainJobReq{ |
|
|
JobName: task.JobName, |
|
|
|
|
|
|
|
|
JobName: jobName, |
|
|
|
|
|
DisplayJobName: displayJobName, |
|
|
DataUrl: dataPath, |
|
|
DataUrl: dataPath, |
|
|
Description: description, |
|
|
Description: description, |
|
|
CodeObsPath: codeObsPath, |
|
|
CodeObsPath: codeObsPath, |
|
|
@@ -1450,9 +1464,6 @@ func TrainJobShow(ctx *context.Context) { |
|
|
|
|
|
|
|
|
VersionListTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain) |
|
|
VersionListTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain) |
|
|
VersionListTasks[i].CanModify = cloudbrain.CanModifyJob(ctx, &task.Cloudbrain) |
|
|
VersionListTasks[i].CanModify = cloudbrain.CanModifyJob(ctx, &task.Cloudbrain) |
|
|
if VersionListTasks[i].DisplayJobName == "" { |
|
|
|
|
|
VersionListTasks[i].DisplayJobName = VersionListTasks[i].JobName |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
pager := context.NewPagination(VersionListCount, setting.UI.IssuePagingNum, page, 5) |
|
|
pager := context.NewPagination(VersionListCount, setting.UI.IssuePagingNum, page, 5) |
|
|
|