Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.21.12.1^2
zouap 3 years ago
parent
commit
cca33572cf
2 changed files with 6 additions and 6 deletions
  1. +4
    -4
      modules/storage/obs.go
  2. +2
    -2
      routers/repo/ai_model_manage.go

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

@@ -176,10 +176,10 @@ func ObsModelDownload(JobName string, fileName string) (io.ReadCloser, error) {

func ObsCopyFile(srcBucket string, srcKeyName string, destBucket string, destKeyName string) error {
input := &obs.CopyObjectInput{}
input.Bucket = srcBucket
input.Key = srcKeyName
input.CopySourceBucket = destBucket
input.CopySourceKey = destKeyName
input.Bucket = destBucket
input.Key = destKeyName
input.CopySourceBucket = srcBucket
input.CopySourceKey = srcKeyName
_, err := ObsCli.CopyObject(input)
if err == nil {
log.Info("copy success,destBuckName:%s, destkeyname:%s", destBucket, destKeyName)


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

@@ -161,9 +161,9 @@ func downloadModelFromCloudBrainTwo(modelUUID string, jobName string, parentDir
if len(modelDbResult) == 0 {
return "", 0, errors.New("cannot create model, as model is empty.")
}
prefix := "/" + strings.TrimPrefix(path.Join(setting.TrainJobModelPath, jobName, setting.OutPutPath, parentDir), "/") + "/"
prefix := strings.TrimPrefix(path.Join(setting.TrainJobModelPath, jobName, setting.OutPutPath, parentDir), "/") + "/"
for _, modelFile := range modelDbResult {
destKeyNamePrefix := "/aimodels/" + models.AttachmentRelativePath(modelUUID) + "/"
destKeyNamePrefix := "aimodels/" + models.AttachmentRelativePath(modelUUID) + "/"

log.Info("copy file, bucket=" + setting.Bucket + ", src keyname=" + prefix + modelFile.FileName)
log.Info("Dest key name=" + destKeyNamePrefix + modelFile.FileName)


Loading…
Cancel
Save