Browse Source

add

tags/v1.22.12.1^2
Gitea 3 years ago
parent
commit
11f0bbd4e4
3 changed files with 23 additions and 24 deletions
  1. +6
    -6
      models/cloudbrain.go
  2. +17
    -13
      modules/modelarts/modelarts.go
  3. +0
    -5
      modules/modelarts/resty.go

+ 6
- 6
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"`
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 {


+ 17
- 13
modules/modelarts/modelarts.go View File

@@ -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,
},
},
},
},


+ 0
- 5
modules/modelarts/resty.go View File

@@ -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").


Loading…
Cancel
Save