|
|
|
@@ -249,7 +249,63 @@ func GenerateTask(req GenerateCloudBrainTaskReq) error { |
|
|
|
return errors.New("no such resourceSpec") |
|
|
|
} |
|
|
|
|
|
|
|
log.Info(req.DatasetInfos[req.Uuids].DataLocalPath) |
|
|
|
volumes := []models.Volume{ |
|
|
|
{ |
|
|
|
HostPath: models.StHostPath{ |
|
|
|
Path: req.CodePath, |
|
|
|
MountPath: CodeMountPath, |
|
|
|
ReadOnly: false, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
HostPath: models.StHostPath{ |
|
|
|
Path: req.ModelPath, |
|
|
|
MountPath: ModelMountPath, |
|
|
|
ReadOnly: false, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
HostPath: models.StHostPath{ |
|
|
|
Path: req.BenchmarkPath, |
|
|
|
MountPath: BenchMarkMountPath, |
|
|
|
ReadOnly: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
HostPath: models.StHostPath{ |
|
|
|
Path: req.Snn4ImageNetPath, |
|
|
|
MountPath: Snn4imagenetMountPath, |
|
|
|
ReadOnly: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
HostPath: models.StHostPath{ |
|
|
|
Path: req.BrainScorePath, |
|
|
|
MountPath: BrainScoreMountPath, |
|
|
|
ReadOnly: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
if len(req.DatasetInfos) == 1 { |
|
|
|
volumes = append(volumes, models.Volume{ |
|
|
|
HostPath: models.StHostPath{ |
|
|
|
Path: req.DatasetInfos[req.Uuids].DataLocalPath, |
|
|
|
MountPath: DataSetMountPath, |
|
|
|
ReadOnly: true, |
|
|
|
}, |
|
|
|
}) |
|
|
|
} else { |
|
|
|
for _, dataset := range req.DatasetInfos { |
|
|
|
volumes = append(volumes, models.Volume{ |
|
|
|
HostPath: models.StHostPath{ |
|
|
|
Path: dataset.DataLocalPath, |
|
|
|
MountPath: DataSetMountPath + "/" + dataset.Name, |
|
|
|
ReadOnly: true, |
|
|
|
}, |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
createTime := timeutil.TimeStampNow() |
|
|
|
jobResult, err := CreateJob(req.JobName, models.CreateJobParams{ |
|
|
|
@@ -273,50 +329,7 @@ func GenerateTask(req GenerateCloudBrainTaskReq) error { |
|
|
|
UseNNI: false, |
|
|
|
}, |
|
|
|
}, |
|
|
|
Volumes: []models.Volume{ |
|
|
|
{ |
|
|
|
HostPath: models.StHostPath{ |
|
|
|
Path: req.CodePath, |
|
|
|
MountPath: CodeMountPath, |
|
|
|
ReadOnly: false, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
HostPath: models.StHostPath{ |
|
|
|
Path: req.DatasetInfos[req.Uuids].DataLocalPath, |
|
|
|
MountPath: DataSetMountPath, |
|
|
|
ReadOnly: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
HostPath: models.StHostPath{ |
|
|
|
Path: req.ModelPath, |
|
|
|
MountPath: ModelMountPath, |
|
|
|
ReadOnly: false, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
HostPath: models.StHostPath{ |
|
|
|
Path: req.BenchmarkPath, |
|
|
|
MountPath: BenchMarkMountPath, |
|
|
|
ReadOnly: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
HostPath: models.StHostPath{ |
|
|
|
Path: req.Snn4ImageNetPath, |
|
|
|
MountPath: Snn4imagenetMountPath, |
|
|
|
ReadOnly: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
HostPath: models.StHostPath{ |
|
|
|
Path: req.BrainScorePath, |
|
|
|
MountPath: BrainScoreMountPath, |
|
|
|
ReadOnly: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
Volumes: volumes, |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
log.Error("CreateJob failed:", err.Error(), req.Ctx.Data["MsgID"]) |
|
|
|
|