| @@ -184,7 +184,7 @@ func AdminOrImageCreaterRight(ctx *context.Context) { | |||
| } | |||
| func GenerateTask(ctx *context.Context, displayJobName, jobName, image, command, uuid, codePath, modelPath, benchmarkPath, snn4imagenetPath, brainScorePath, jobType, gpuQueue, description, branchName, bootFile, params string, benchmarkTypeID, benchmarkChildTypeID, resourceSpecId int) error { | |||
| func GenerateTask(ctx *context.Context, displayJobName, jobName, image, command, uuid, codePath, modelPath, benchmarkPath, snn4imagenetPath, brainScorePath, jobType, gpuQueue, description, branchName, bootFile, params, commitID string, benchmarkTypeID, benchmarkChildTypeID, resourceSpecId int) error { | |||
| dataActualPath := setting.Attachment.Minio.RealPath + | |||
| setting.Attachment.Minio.Bucket + "/" + | |||
| @@ -333,6 +333,7 @@ func GenerateTask(ctx *context.Context, displayJobName, jobName, image, command, | |||
| Parameters: params, | |||
| CreatedUnix: createTime, | |||
| UpdatedUnix: createTime, | |||
| CommitID: commitID, | |||
| }) | |||
| if err != nil { | |||
| @@ -97,7 +97,7 @@ func saveModelByParameters(jobId string, versionName string, name string, versio | |||
| UserId: ctx.User.ID, | |||
| CodeBranch: aiTask.BranchName, | |||
| CodeCommitID: aiTask.CommitID, | |||
| Engine: aiTask.EngineID, | |||
| Engine: int64(engine), | |||
| TrainTaskInfo: string(aiTaskJson), | |||
| Accuracy: string(accuracyJson), | |||
| } | |||
| @@ -284,11 +284,13 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { | |||
| mkModelPath(modelPath) | |||
| uploadCodeToMinio(modelPath, jobName, cloudbrain.ModelMountPath+"/") | |||
| commitID, _ := ctx.Repo.GitRepo.GetBranchCommitID(branchName) | |||
| err = cloudbrain.GenerateTask(ctx, displayJobName, jobName, image, command, uuid, storage.GetMinioPath(jobName, cloudbrain.CodeMountPath+"/"), | |||
| storage.GetMinioPath(jobName, cloudbrain.ModelMountPath+"/"), | |||
| storage.GetMinioPath(jobName, cloudbrain.BenchMarkMountPath+"/"), storage.GetMinioPath(jobName, cloudbrain.Snn4imagenetMountPath+"/"), | |||
| storage.GetMinioPath(jobName, cloudbrain.BrainScoreMountPath+"/"), jobType, gpuQueue, form.Description, branchName, form.BootFile, form.Params, | |||
| 0, 0, resourceSpecId) | |||
| commitID, 0, 0, resourceSpecId) | |||
| if err != nil { | |||
| cloudBrainNewDataPrepare(ctx) | |||
| ctx.RenderWithErr(err.Error(), tpl, &form) | |||
| @@ -2012,7 +2014,7 @@ func BenchMarkAlgorithmCreate(ctx *context.Context, form auth.CreateCloudBrainFo | |||
| storage.GetMinioPath(jobName, cloudbrain.ModelMountPath+"/"), | |||
| storage.GetMinioPath(jobName, cloudbrain.BenchMarkMountPath+"/"), storage.GetMinioPath(jobName, cloudbrain.Snn4imagenetMountPath+"/"), | |||
| storage.GetMinioPath(jobName, cloudbrain.BrainScoreMountPath+"/"), string(models.JobTypeBenchmark), gpuQueue, form.Description, cloudbrain.DefaultBranchName, "", "", | |||
| benchmarkTypeID, benchmarkChildTypeID, resourceSpecId) | |||
| "", benchmarkTypeID, benchmarkChildTypeID, resourceSpecId) | |||
| if err != nil { | |||
| cloudBrainNewDataPrepare(ctx) | |||
| ctx.RenderWithErr(err.Error(), tplCloudBrainBenchmarkNew, &form) | |||
| @@ -2110,7 +2112,7 @@ func ModelBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainForm) | |||
| storage.GetMinioPath(jobName, cloudbrain.ModelMountPath+"/"), | |||
| storage.GetMinioPath(jobName, cloudbrain.BenchMarkMountPath+"/"), storage.GetMinioPath(jobName, cloudbrain.Snn4imagenetMountPath+"/"), | |||
| storage.GetMinioPath(jobName, cloudbrain.BrainScoreMountPath+"/"), jobType, gpuQueue, form.Description, branchName, form.BootFile, form.Params, | |||
| 0, benchmarkChildTypeID, resourceSpecId) | |||
| "", 0, benchmarkChildTypeID, resourceSpecId) | |||
| if err != nil { | |||
| cloudBrainNewDataPrepare(ctx) | |||
| ctx.RenderWithErr(err.Error(), tpl, &form) | |||
| @@ -1,8 +1,8 @@ | |||
| <!-- 头部导航栏 --> | |||
| {{template "base/head" .}} | |||
| <style> | |||
| .defaulttext{ | |||
| color: rgba(0,0,0,.87) | |||
| .text{ | |||
| color: rgba(0,0,0,.87)!important | |||
| } | |||
| </style> | |||
| <!-- 弹窗 --> | |||
| @@ -140,7 +140,7 @@ | |||
| <label>模型框架</label> | |||
| <div class="ui dropdown selection search width70" id="choice_Engine"> | |||
| <input type="hidden" id="Engine" name="Engine" required> | |||
| <div class="default defaulttext">选择模型框架</div> | |||
| <div class="default text">选择模型框架</div> | |||
| <i class="dropdown icon"></i> | |||
| <div class="menu" id="job-Engine"> | |||
| @@ -321,7 +321,7 @@ | |||
| } | |||
| itemHtml += "<option class=\"item\" data-value=\"3\">Other</option>" | |||
| $('#choice_Engine .default.defaulttext').text(selectedText) | |||
| $('#choice_Engine .default.text').text(selectedText) | |||
| $('#choice_Engine input[name="Engine"]').val(selectedValue) | |||
| $("#job-Engine").append(itemHtml); | |||
| $("#choice_Engine").addClass('disabled') | |||
| @@ -330,7 +330,7 @@ | |||
| itemHtml += "<option class=\"item\" data-value=\"1\">TensorFlow</option>" | |||
| itemHtml += "<option class=\"item\" data-value=\"2\">MindSpore</option>" | |||
| itemHtml += "<option class=\"item\" data-value=\"3\">Other</option>" | |||
| $('#choice_Engine .default.defaulttext').text("Pytorch"); | |||
| $('#choice_Engine .default.text').text("Pytorch"); | |||
| $('#choice_Engine input[name="Engine"]').val(0) | |||
| $("#job-Engine").append(itemHtml); | |||
| $("#choice_Engine").removeClass('disabled'); | |||