|
|
|
@@ -149,6 +149,35 @@ func getDatasetGPUGrampus(datasetInfos map[string]models.DatasetInfo) ([]models. |
|
|
|
} |
|
|
|
return datasetGrampus, command |
|
|
|
} |
|
|
|
func getDatasetGCUGrampus(datasetInfos map[string]models.DatasetInfo) ([]models.GrampusDataset, string) { |
|
|
|
var datasetGrampus []models.GrampusDataset |
|
|
|
var command = "" |
|
|
|
epuEndPoint := getEndPoint() |
|
|
|
for uuid, datasetInfo := range datasetInfos { |
|
|
|
if datasetInfo.Type == models.TypeCloudBrainOne { |
|
|
|
datasetGrampus = append(datasetGrampus, models.GrampusDataset{ |
|
|
|
Name: datasetInfo.FullName, |
|
|
|
Bucket: setting.Attachment.Minio.Bucket, |
|
|
|
EndPoint: setting.Attachment.Minio.Endpoint, |
|
|
|
ObjectKey: datasetInfo.DataLocalPath, |
|
|
|
ReadOnly: true, |
|
|
|
ContainerPath: "/dataset1/" + datasetInfo.Name, |
|
|
|
}) |
|
|
|
|
|
|
|
command += "cp /dataset1/'" + datasetInfo.Name + "'/" + uuid + " /dataset/'" + datasetInfo.FullName + "';" |
|
|
|
|
|
|
|
} else { |
|
|
|
datasetGrampus = append(datasetGrampus, models.GrampusDataset{ |
|
|
|
Name: datasetInfo.FullName, |
|
|
|
Bucket: setting.Bucket, |
|
|
|
EndPoint: epuEndPoint, |
|
|
|
ObjectKey: datasetInfo.DataLocalPath + datasetInfo.FullName, |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return datasetGrampus, command |
|
|
|
} |
|
|
|
|
|
|
|
func GenerateNotebookJob(ctx *context.Context, req *GenerateNotebookJobReq) (jobId string, err error) { |
|
|
|
createTime := timeutil.TimeStampNow() |
|
|
|
@@ -179,7 +208,11 @@ func GenerateNotebookJob(ctx *context.Context, req *GenerateNotebookJobReq) (job |
|
|
|
imageUrl = "" |
|
|
|
req.Command = "" |
|
|
|
} else { |
|
|
|
datasetGrampus, cpCommand = getDatasetGPUGrampus(req.DatasetInfos) |
|
|
|
if ProcessorTypeGCU == req.ProcessType { |
|
|
|
datasetGrampus, cpCommand = getDatasetGCUGrampus(req.DatasetInfos) |
|
|
|
} else { |
|
|
|
datasetGrampus, cpCommand = getDatasetGPUGrampus(req.DatasetInfos) |
|
|
|
} |
|
|
|
if len(req.ModelName) != 0 { |
|
|
|
datasetGrampus = append(datasetGrampus, models.GrampusDataset{ |
|
|
|
Name: req.ModelName, |
|
|
|
|