| @@ -1060,7 +1060,7 @@ type UserImageConfig struct { | |||||
| CreateVersion bool `json:"create_version"` | CreateVersion bool `json:"create_version"` | ||||
| Flavor Flavor `json:"flavor"` | Flavor Flavor `json:"flavor"` | ||||
| PoolID string `json:"pool_id"` | PoolID string `json:"pool_id"` | ||||
| Volumes Volumes `json:"volumes"` | |||||
| Volumes []Volumes `json:"volumes"` | |||||
| } | } | ||||
| type CreateTrainJobParams struct { | type CreateTrainJobParams struct { | ||||
| @@ -1081,10 +1081,10 @@ type Config struct { | |||||
| LogUrl string `json:"log_url"` | LogUrl string `json:"log_url"` | ||||
| //UserImageUrl string `json:"user_image_url"` | //UserImageUrl string `json:"user_image_url"` | ||||
| //UserCommand string `json:"user_command"` | //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 { | type CreateInferenceJobParams struct { | ||||
| @@ -1181,7 +1181,7 @@ type CreateConfigParams struct { | |||||
| LogUrl string `json:"log_url"` | LogUrl string `json:"log_url"` | ||||
| Flavor Flavor `json:"flavor"` | Flavor Flavor `json:"flavor"` | ||||
| PoolID string `json:"pool_id"` | PoolID string `json:"pool_id"` | ||||
| Volumes Volumes `json:"volumes"` | |||||
| Volumes []Volumes `json:"volumes"` | |||||
| } | } | ||||
| type Parameter struct { | type Parameter struct { | ||||
| @@ -69,7 +69,7 @@ const ( | |||||
| VolumeID = "c6a73891-6a19-4a6a-a2e8-0d6baa72a7c5" | VolumeID = "c6a73891-6a19-4a6a-a2e8-0d6baa72a7c5" | ||||
| VolumeSourcePath = "192.168.0.30:/" | VolumeSourcePath = "192.168.0.30:/" | ||||
| VolumeDestPath = "/cache/sfs/" | |||||
| VolumeDestPath = "/cache/sfs" | |||||
| ) | ) | ||||
| var ( | var ( | ||||
| @@ -377,12 +377,14 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (jobId str | |||||
| Parameter: req.Parameters, | Parameter: req.Parameters, | ||||
| UserImageUrl: req.UserImageUrl, | UserImageUrl: req.UserImageUrl, | ||||
| UserCommand: req.UserCommand, | 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, | Code: req.Spec.SourceSpecId, | ||||
| }, | }, | ||||
| Parameter: req.Parameters, | 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, | |||||
| }, | |||||
| }, | }, | ||||
| }, | }, | ||||
| }, | }, | ||||
| @@ -545,8 +545,6 @@ func createTrainJob(createJobParams models.CreateTrainJobParams) (*models.Create | |||||
| var result models.CreateTrainJobResult | var result models.CreateTrainJobResult | ||||
| retry := 0 | retry := 0 | ||||
| log.Info("postapi detail all: %s", createJobParams) | |||||
| log.Info("postapi detail Volume: %s", createJobParams.Config.Volumes) | |||||
| sendjob: | sendjob: | ||||
| res, err := client.R(). | res, err := client.R(). | ||||
| @@ -760,9 +758,6 @@ func CreateTrainJobConfig(req models.CreateConfigParams) (*models.CreateTrainJob | |||||
| retry := 0 | retry := 0 | ||||
| log.Info("postapi detail all: %s", req) | |||||
| log.Info("postapi detail Volume: %s", req.Volumes) | |||||
| sendjob: | sendjob: | ||||
| res, err := client.R(). | res, err := client.R(). | ||||
| SetHeader("Content-Type", "application/json"). | SetHeader("Content-Type", "application/json"). | ||||