Browse Source

解决多节点训练日志下载问题

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/3481/head
zouap 2 years ago
parent
commit
44bbf46343
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      modules/storage/obs.go
  2. +2
    -2
      routers/repo/modelarts.go

+ 2
- 2
modules/storage/obs.go View File

@@ -634,10 +634,10 @@ func GetObsLogFileName(prefix string) ([]FileInfo, error) {
log.Info("log fileName=" + val.Key)
fileInfo := FileInfo{
ModTime: val.LastModified.Local().Format("2006-01-02 15:04:05"),
FileName: val.Key,
FileName: val.Key[len(prefix)-3:], //加上 job
Size: val.Size,
IsDir: false,
ParenDir: "",
ParenDir: prefix[0 : len(prefix)-3],
}
fileInfos = append(fileInfos, fileInfo)
}


+ 2
- 2
routers/repo/modelarts.go View File

@@ -2894,9 +2894,9 @@ func TrainJobDownloadLogFile(ctx *context.Context) {
return
}
if len(key) > 1 {
ObsDownloadManyFile("", ctx, task.DisplayJobName+".zip", key)
ObsDownloadManyFile(prefix[0:len(prefix)-3], ctx, task.DisplayJobName+".zip", key)
} else {
url, err := storage.GetObsCreateSignedUrlByBucketAndKey(setting.Bucket, key[0].FileName)
url, err := storage.GetObsCreateSignedUrlByBucketAndKey(setting.Bucket, key[0].ParenDir+key[0].FileName)
if err != nil {
log.Error("GetObsCreateSignedUrlByBucketAndKey failed: %v", err.Error(), ctx.Data["msgID"])
ctx.ServerError("GetObsCreateSignedUrlByBucketAndKey", err)


Loading…
Cancel
Save