Browse Source

add taskinfo

tags/v1.21.12.1
lewis 4 years ago
parent
commit
779532f98d
2 changed files with 9 additions and 2 deletions
  1. +8
    -1
      modules/cloudbrain/cloudbrain.go
  2. +1
    -1
      routers/repo/cloudbrain.go

+ 8
- 1
modules/cloudbrain/cloudbrain.go View File

@@ -28,7 +28,7 @@ var (
ResourceSpecs *models.ResourceSpecs ResourceSpecs *models.ResourceSpecs
) )


func GenerateTask(ctx *context.Context, jobName, image, command, uuid, codePath, modelPath, benchmarkPath, snn4imagenetPath, jobType, gpuQueue string, resourceSpecId int) error {
func GenerateTask(ctx *context.Context, jobName, image, command, uuid, codePath, modelPath, benchmarkPath, snn4imagenetPath, brainScorePath, jobType, gpuQueue string, resourceSpecId int) error {
dataActualPath := setting.Attachment.Minio.RealPath + dataActualPath := setting.Attachment.Minio.RealPath +
setting.Attachment.Minio.Bucket + "/" + setting.Attachment.Minio.Bucket + "/" +
setting.Attachment.Minio.BasePath + setting.Attachment.Minio.BasePath +
@@ -104,6 +104,13 @@ func GenerateTask(ctx *context.Context, jobName, image, command, uuid, codePath,
ReadOnly: true, ReadOnly: true,
}, },
}, },
{
HostPath: models.StHostPath{
Path: brainScorePath,
MountPath: BrainScoreMountPath,
ReadOnly: true,
},
},
}, },
}) })
if err != nil { if err != nil {


+ 1
- 1
routers/repo/cloudbrain.go View File

@@ -262,7 +262,7 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) {
downloadRateCode(repo, jobName, setting.BrainScoreCode, brainScorePath, "", "") downloadRateCode(repo, jobName, setting.BrainScoreCode, brainScorePath, "", "")
} }


err = cloudbrain.GenerateTask(ctx, jobName, image, command, uuid, codePath, modelPath, benchmarkPath, snn4imagenetPath, jobType, gpuQueue, resourceSpecId)
err = cloudbrain.GenerateTask(ctx, jobName, image, command, uuid, codePath, modelPath, benchmarkPath, snn4imagenetPath, brainScorePath, jobType, gpuQueue, resourceSpecId)
if err != nil { if err != nil {
cloudBrainNewDataPrepare(ctx) cloudBrainNewDataPrepare(ctx)
ctx.RenderWithErr(err.Error(), tplCloudBrainNew, &form) ctx.RenderWithErr(err.Error(), tplCloudBrainNew, &form)


Loading…
Cancel
Save