Browse Source

添加训练任务磁盘挂载

tags/v1.22.12.1^2
Gitea 3 years ago
parent
commit
dac33a75a8
2 changed files with 16 additions and 20 deletions
  1. +8
    -8
      models/cloudbrain.go
  2. +8
    -12
      modules/modelarts/modelarts.go

+ 8
- 8
models/cloudbrain.go View File

@@ -1045,7 +1045,7 @@ type CreateUserImageTrainJobParams struct {
Description string `json:"job_desc"`
Config UserImageConfig `json:"config"`
WorkspaceID string `json:"workspace_id"`
Volume Volumes `json:"volumes"`
DataMount Nfs `json:"volumes"`
}

type UserImageConfig struct {
@@ -1064,11 +1064,11 @@ type UserImageConfig struct {
}

type CreateTrainJobParams struct {
JobName string `json:"job_name"`
Description string `json:"job_desc"`
Config Config `json:"config"`
WorkspaceID string `json:"workspace_id"`
Volume Volumes `json:"volumes"`
JobName string `json:"job_name"`
Description string `json:"job_desc"`
Config Config `json:"config"`
WorkspaceID string `json:"workspace_id"`
DataMount Nfs `json:"volumes"`
}

type Config struct {
@@ -1215,8 +1215,8 @@ type Volumes struct {

type Nfs struct {
ID string `json:"id"`
SourcePath string `json:"src_path"`
DestPath string `json:"dest_path"`
SourcePath string `json:"nfs_server_path"`
DestPath string `json:"local_path"`
ReadOnly bool `json:"read_only"`
}



+ 8
- 12
modules/modelarts/modelarts.go View File

@@ -377,12 +377,10 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (jobId str
UserImageUrl: req.UserImageUrl,
UserCommand: req.UserCommand,
},
Volume: models.Volumes{
Nfs: models.Nfs{
SourcePath: VolumeSourcePath,
DestPath: VolumeDestPath,
ReadOnly: false,
},
DataMount: models.Nfs{
SourcePath: VolumeSourcePath,
DestPath: VolumeDestPath,
ReadOnly: false,
},
})
} else {
@@ -404,12 +402,10 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (jobId str
},
Parameter: req.Parameters,
},
Volume: models.Volumes{
Nfs: models.Nfs{
SourcePath: VolumeSourcePath,
DestPath: VolumeDestPath,
ReadOnly: false,
},
DataMount: models.Nfs{
SourcePath: VolumeSourcePath,
DestPath: VolumeDestPath,
ReadOnly: false,
},
})
}


Loading…
Cancel
Save