Browse Source

提交代码

tags/v1.22.12.1^2
ychao_1983 3 years ago
parent
commit
76b4c84948
1 changed files with 22 additions and 5 deletions
  1. +22
    -5
      modules/grampus/grampus.go

+ 22
- 5
modules/grampus/grampus.go View File

@@ -121,6 +121,21 @@ func getDatasetGrampus(datasetInfos map[string]models.DatasetInfo) []models.Gram
}
return datasetGrampus
}
func getDatasetGPUGrampus(datasetInfos map[string]models.DatasetInfo) []models.GrampusDataset {
var datasetGrampus []models.GrampusDataset
for _, datasetInfo := range datasetInfos {
datasetGrampus = append(datasetGrampus, models.GrampusDataset{
Name: datasetInfo.FullName,
Bucket: setting.Attachment.Minio.Bucket,
EndPoint: setting.Attachment.Minio.Endpoint,
ObjectKey: datasetInfo.DataLocalPath + "/" + datasetInfo.FullName,
ReadOnly: true,
ContainerPath: "/dataset/" + datasetInfo.Name,
})

}
return datasetGrampus
}

func GenerateNotebookJob(ctx *context.Context, req *GenerateNotebookJobReq) (jobId string, err error) {
createTime := timeutil.TimeStampNow()
@@ -136,12 +151,14 @@ func GenerateNotebookJob(ctx *context.Context, req *GenerateNotebookJobReq) (job
ObjectKey: req.CodeStoragePath + cloudbrain.DefaultBranchName + ".zip",
}
} else {
datasetGrampus = getDatasetGPUGrampus(req.DatasetInfos)
codeGrampus = models.GrampusDataset{
Name: req.CodeName,
Bucket: setting.Bucket,
EndPoint: getEndPoint(),
ObjectKey: req.CodeStoragePath + cloudbrain.DefaultBranchName + ".zip",
Name: req.CodeName,
Bucket: setting.Attachment.Minio.Bucket,
EndPoint: setting.Attachment.Minio.Endpoint,
ObjectKey: req.CodeStoragePath + cloudbrain.DefaultBranchName + ".zip",
ReadOnly: false,
ContainerPath: "/code",
}

}


Loading…
Cancel
Save