| @@ -421,7 +421,6 @@ func GetOneLevelAllObjectUnderDir(bucket string, prefixRootPath string, relative | |||||
| input := &obs.ListObjectsInput{} | input := &obs.ListObjectsInput{} | ||||
| input.Bucket = bucket | input.Bucket = bucket | ||||
| input.Prefix = prefixRootPath + relativePath | input.Prefix = prefixRootPath + relativePath | ||||
| log.Info(input.Prefix) | |||||
| if !strings.HasSuffix(input.Prefix, "/") { | if !strings.HasSuffix(input.Prefix, "/") { | ||||
| input.Prefix += "/" | input.Prefix += "/" | ||||
| } | } | ||||
| @@ -435,14 +434,12 @@ func GetOneLevelAllObjectUnderDir(bucket string, prefixRootPath string, relative | |||||
| log.Info("Page:%d\n", index) | log.Info("Page:%d\n", index) | ||||
| index++ | index++ | ||||
| for _, val := range output.Contents { | for _, val := range output.Contents { | ||||
| log.Info("val key=" + val.Key) | |||||
| var isDir bool | var isDir bool | ||||
| var fileName string | var fileName string | ||||
| if val.Key == input.Prefix { | if val.Key == input.Prefix { | ||||
| continue | continue | ||||
| } | } | ||||
| fileName = val.Key[prefixLen:] | fileName = val.Key[prefixLen:] | ||||
| //log.Info("fileName =" + fileName) | |||||
| files := strings.Split(fileName, "/") | files := strings.Split(fileName, "/") | ||||
| if fileMap[files[0]] { | if fileMap[files[0]] { | ||||
| continue | continue | ||||
| @@ -470,13 +470,10 @@ func ModelList(ctx *context.APIContext) { | |||||
| status := models.StorageScheduleSucceed | status := models.StorageScheduleSucceed | ||||
| var fileInfos []storage.FileInfo | var fileInfos []storage.FileInfo | ||||
| if task.ComputeResource == models.NPUResource { | if task.ComputeResource == models.NPUResource { | ||||
| //fileInfos, err = storage.GetObsListObject(task.JobName, "output/", parentDir, versionName) | |||||
| prefix := strings.TrimPrefix(path.Join(setting.TrainJobModelPath, task.JobName, setting.OutPutPath, versionName), "/") | prefix := strings.TrimPrefix(path.Join(setting.TrainJobModelPath, task.JobName, setting.OutPutPath, versionName), "/") | ||||
| log.Info(prefix) | |||||
| if !strings.HasSuffix(prefix, "/") { | if !strings.HasSuffix(prefix, "/") { | ||||
| prefix += "/" | prefix += "/" | ||||
| } | } | ||||
| log.Info(prefix) | |||||
| fileInfos, err = storage.GetOneLevelAllObjectUnderDir(setting.Bucket, prefix, parentDir) | fileInfos, err = storage.GetOneLevelAllObjectUnderDir(setting.Bucket, prefix, parentDir) | ||||
| if err != nil { | if err != nil { | ||||
| log.Info("get TrainJobListModel failed:", err) | log.Info("get TrainJobListModel failed:", err) | ||||