From 09186bc6688a7bb11a0d2ede126281641f2e1717 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Wed, 26 Apr 2023 12:59:28 +0800 Subject: [PATCH] fix bug --- models/cloudbrain.go | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/models/cloudbrain.go b/models/cloudbrain.go index 5bcf6b1a80..3150fbf04e 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -3046,10 +3046,25 @@ func GetDatasetInfo(uuidStr string, grampusType ...string) (map[string]DatasetIn } } var dataLocalPath string - if attach.Type == TypeCloudBrainOne { - dataLocalPath = setting.Attachment.Minio.BasePath + path.Join(attach.UUID[0:1], attach.UUID[1:2]) + "/" + attach.UUID + if len(grampusType) > 0 { + if grampusType[0] == GPU { + dataLocalPath = setting.Attachment.Minio.BasePath + path.Join(attach.UUID[0:1], attach.UUID[1:2]) + "/" + attach.UUID + } else if grampusType[0] == NPU { + dataLocalPath = setting.BasePath + path.Join(attach.UUID[0:1], attach.UUID[1:2]) + "/" + attach.UUID + "/" + } else if grampusType[0] == GCU || grampusType[0] == MLU { + if attach.Type == TypeCloudBrainOne { + dataLocalPath = setting.Attachment.Minio.BasePath + path.Join(attach.UUID[0:1], attach.UUID[1:2]) + "/" + attach.UUID + } else { + dataLocalPath = setting.BasePath + path.Join(attach.UUID[0:1], attach.UUID[1:2]) + "/" + attach.UUID + "/" + } + } + } else { - dataLocalPath = setting.BasePath + path.Join(attach.UUID[0:1], attach.UUID[1:2]) + "/" + attach.UUID + "/" + dataLocalPath = setting.Attachment.Minio.RealPath + + setting.Attachment.Minio.Bucket + "/" + + setting.Attachment.Minio.BasePath + + AttachmentRelativePath(attach.UUID) + + attach.UUID } datasetInfos[attach.UUID] = DatasetInfo{ -- 2.34.1