diff --git a/models/cloudbrain.go b/models/cloudbrain.go index 2bae839cf..aba31f53c 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -1060,7 +1060,7 @@ type UserImageConfig struct { CreateVersion bool `json:"create_version"` Flavor Flavor `json:"flavor"` PoolID string `json:"pool_id"` - Volumes Volumes `json:"volumes"` + Volumes []Volumes `json:"volumes"` } type CreateTrainJobParams struct { @@ -1081,10 +1081,10 @@ type Config struct { LogUrl string `json:"log_url"` //UserImageUrl string `json:"user_image_url"` //UserCommand string `json:"user_command"` - CreateVersion bool `json:"create_version"` - Flavor Flavor `json:"flavor"` - PoolID string `json:"pool_id"` - Volumes Volumes `json:"volumes"` + CreateVersion bool `json:"create_version"` + Flavor Flavor `json:"flavor"` + PoolID string `json:"pool_id"` + Volumes []Volumes `json:"volumes"` } type CreateInferenceJobParams struct { @@ -1181,7 +1181,7 @@ type CreateConfigParams struct { LogUrl string `json:"log_url"` Flavor Flavor `json:"flavor"` PoolID string `json:"pool_id"` - Volumes Volumes `json:"volumes"` + Volumes []Volumes `json:"volumes"` } type Parameter struct { diff --git a/modules/modelarts/modelarts.go b/modules/modelarts/modelarts.go index 5ccb08c92..03378159a 100755 --- a/modules/modelarts/modelarts.go +++ b/modules/modelarts/modelarts.go @@ -69,7 +69,7 @@ const ( VolumeID = "c6a73891-6a19-4a6a-a2e8-0d6baa72a7c5" VolumeSourcePath = "192.168.0.30:/" - VolumeDestPath = "/cache/sfs/" + VolumeDestPath = "/cache/sfs" ) var ( @@ -377,12 +377,14 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (jobId str Parameter: req.Parameters, UserImageUrl: req.UserImageUrl, UserCommand: req.UserCommand, - Volumes: models.Volumes{ - Nfs: models.Nfs{ - ID: VolumeID, - SourcePath: VolumeSourcePath, - DestPath: VolumeDestPath, - ReadOnly: false, + Volumes: []models.Volumes{ + { + Nfs: models.Nfs{ + ID: VolumeID, + SourcePath: VolumeSourcePath, + DestPath: VolumeDestPath, + ReadOnly: false, + }, }, }, }, @@ -405,12 +407,14 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (jobId str Code: req.Spec.SourceSpecId, }, Parameter: req.Parameters, - Volumes: models.Volumes{ - Nfs: models.Nfs{ - ID: VolumeID, - SourcePath: VolumeSourcePath, - DestPath: VolumeDestPath, - ReadOnly: false, + Volumes: []models.Volumes{ + { + Nfs: models.Nfs{ + ID: VolumeID, + SourcePath: VolumeSourcePath, + DestPath: VolumeDestPath, + ReadOnly: false, + }, }, }, }, diff --git a/modules/modelarts/resty.go b/modules/modelarts/resty.go index 27c37b1e8..058641ddd 100755 --- a/modules/modelarts/resty.go +++ b/modules/modelarts/resty.go @@ -545,8 +545,6 @@ func createTrainJob(createJobParams models.CreateTrainJobParams) (*models.Create var result models.CreateTrainJobResult retry := 0 - log.Info("postapi detail all: %s", createJobParams) - log.Info("postapi detail Volume: %s", createJobParams.Config.Volumes) sendjob: res, err := client.R(). @@ -760,9 +758,6 @@ func CreateTrainJobConfig(req models.CreateConfigParams) (*models.CreateTrainJob retry := 0 - log.Info("postapi detail all: %s", req) - log.Info("postapi detail Volume: %s", req.Volumes) - sendjob: res, err := client.R(). SetHeader("Content-Type", "application/json").