Browse Source

添加训练任务磁盘挂载

tags/v1.22.12.1^2
Gitea 3 years ago
parent
commit
6d11f68505
2 changed files with 22 additions and 16 deletions
  1. +7
    -5
      models/cloudbrain.go
  2. +15
    -11
      modules/modelarts/modelarts.go

+ 7
- 5
models/cloudbrain.go View File

@@ -1060,7 +1060,7 @@ type UserImageConfig struct {
CreateVersion bool `json:"create_version"`
Flavor Flavor `json:"flavor"`
PoolID string `json:"pool_id"`
DataMount Volumes `json:"volumes"`
Volumes Volumes `json:"volumes"`
}

type CreateTrainJobParams struct {
@@ -1084,14 +1084,16 @@ type Config struct {
CreateVersion bool `json:"create_version"`
Flavor Flavor `json:"flavor"`
PoolID string `json:"pool_id"`
DataMount Volumes `json:"volumes"`
Volumes Volumes `json:"volumes"`
}

type CreateInferenceJobParams struct {
JobName string `json:"job_name"`
Description string `json:"job_desc"`
InfConfig InfConfig `json:"config"`
WorkspaceID string `json:"workspace_id"`
}

type CreateInfUserImageParams struct {
JobName string `json:"job_name"`
Description string `json:"job_desc"`
@@ -1209,14 +1211,14 @@ type DataSource struct {
}

type Volumes struct {
Nfs Nfs `json:"nfs"`
Nfs []Nfs `json:"nfs"`
HostPath HostPath `json:"host_path"`
}

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



+ 15
- 11
modules/modelarts/modelarts.go View File

@@ -68,7 +68,7 @@ const (
TotalVersionCount = 1

VolumeSourcePath = "192.168.0.30:/"
VolumeDestPath = "/cache/data/"
VolumeDestPath = "/cache/sfs/"
)

var (
@@ -376,11 +376,13 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (jobId str
Parameter: req.Parameters,
UserImageUrl: req.UserImageUrl,
UserCommand: req.UserCommand,
DataMount: models.Volumes{
Nfs: models.Nfs{
SourcePath: VolumeSourcePath,
DestPath: VolumeDestPath,
ReadOnly: false,
Volumes: models.Volumes{
Nfs: []models.Nfs{
{
SourcePath: VolumeSourcePath,
DestPath: VolumeDestPath,
ReadOnly: false,
},
},
},
},
@@ -403,11 +405,13 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (jobId str
Code: req.Spec.SourceSpecId,
},
Parameter: req.Parameters,
DataMount: models.Volumes{
Nfs: models.Nfs{
SourcePath: VolumeSourcePath,
DestPath: VolumeDestPath,
ReadOnly: false,
Volumes: models.Volumes{
Nfs: []models.Nfs{
{
SourcePath: VolumeSourcePath,
DestPath: VolumeDestPath,
ReadOnly: false,
},
},
},
},


Loading…
Cancel
Save