| @@ -41,6 +41,7 @@ type ( | |||||
| Params []string `json:"params,optional"` | Params []string `json:"params,optional"` | ||||
| Envs []string `json:"envs,optional"` | Envs []string `json:"envs,optional"` | ||||
| Cmd string `json:"cmd,optional"` | Cmd string `json:"cmd,optional"` | ||||
| Replica int32 `json:"replicas"` | |||||
| } | } | ||||
| AiResourceTypesResp { | AiResourceTypesResp { | ||||
| @@ -110,7 +110,6 @@ func (l *CommitVmTaskLogic) CommitVmTask(req *types.CommitVmTaskReq) (resp *type | |||||
| AND vf.public_flavor_id = ? | AND vf.public_flavor_id = ? | ||||
| AND vi.public_image_id = ? | AND vi.public_image_id = ? | ||||
| AND vn.public_network_id = ?` | AND vn.public_network_id = ?` | ||||
| // err2 := l.svcCtx.DbEngin.Raw(sql, clusterId, req.FlavorRef, req.ImageRef, req.Uuid).Scan(&taskVm).Error | |||||
| txVm := l.svcCtx.DbEngin.Raw(sql, clusterId, req.FlavorRef, req.ImageRef, req.Uuid).Scan(&VmObject) | txVm := l.svcCtx.DbEngin.Raw(sql, clusterId, req.FlavorRef, req.ImageRef, req.Uuid).Scan(&VmObject) | ||||
| if txVm.Error != nil { | if txVm.Error != nil { | ||||
| logx.Error(err) | logx.Error(err) | ||||
| @@ -118,7 +117,6 @@ func (l *CommitVmTaskLogic) CommitVmTask(req *types.CommitVmTaskReq) (resp *type | |||||
| } | } | ||||
| if err2 != nil { | if err2 != nil { | ||||
| logx.Errorf("CommitGeneralTask() => sql execution error: %v", err) | logx.Errorf("CommitGeneralTask() => sql execution error: %v", err) | ||||
| //return errors.Errorf("the cluster does not match the drive resources. Check the data"), nil | |||||
| } | } | ||||
| taskVm.Name = req.VmName | taskVm.Name = req.VmName | ||||
| taskVm.Status = "Saved" | taskVm.Status = "Saved" | ||||
| @@ -31,7 +31,7 @@ func (l *ScheduleSubmitLogic) ScheduleSubmit(req *types.ScheduleReq) (resp *type | |||||
| AdapterId: req.AiOption.AdapterId, | AdapterId: req.AiOption.AdapterId, | ||||
| TaskName: req.AiOption.TaskName, | TaskName: req.AiOption.TaskName, | ||||
| ResourceType: req.AiOption.ResourceType, | ResourceType: req.AiOption.ResourceType, | ||||
| Replica: 1, | |||||
| Replica: req.AiOption.Replica, | |||||
| Tops: req.AiOption.Tops, | Tops: req.AiOption.Tops, | ||||
| TaskType: req.AiOption.TaskType, | TaskType: req.AiOption.TaskType, | ||||
| DatasetsName: req.AiOption.Datasets, | DatasetsName: req.AiOption.Datasets, | ||||
| @@ -105,7 +105,7 @@ func (s *AiStorage) SaveAiTask(taskId int64, option *option.AiOption, clusterId | |||||
| AdapterId: aId, | AdapterId: aId, | ||||
| ClusterId: cId, | ClusterId: cId, | ||||
| Name: option.TaskName, | Name: option.TaskName, | ||||
| Replica: option.Replica, | |||||
| Replica: int64(option.Replica), | |||||
| JobId: jobId, | JobId: jobId, | ||||
| TaskType: option.TaskType, | TaskType: option.TaskType, | ||||
| Strategy: option.StrategyName, | Strategy: option.StrategyName, | ||||
| @@ -103,7 +103,7 @@ func (as *AiScheduler) PickOptimalStrategy() (strategy.Strategy, error) { | |||||
| return strategy, nil | return strategy, nil | ||||
| case strategy.STATIC_WEIGHT: | case strategy.STATIC_WEIGHT: | ||||
| //todo resources should match cluster StaticWeightMap | //todo resources should match cluster StaticWeightMap | ||||
| strategy := strategy.NewStaticWeightStrategy(as.option.ClusterToStaticWeight, 1) | |||||
| strategy := strategy.NewStaticWeightStrategy(as.option.ClusterToStaticWeight, as.option.Replica) | |||||
| return strategy, nil | return strategy, nil | ||||
| } | } | ||||
| @@ -4,7 +4,7 @@ type AiOption struct { | |||||
| AdapterId string | AdapterId string | ||||
| ClusterIds []string | ClusterIds []string | ||||
| TaskName string | TaskName string | ||||
| Replica int64 | |||||
| Replica int32 | |||||
| ResourceType string // cpu/gpu/compute card | ResourceType string // cpu/gpu/compute card | ||||
| CpuCoreNum int64 | CpuCoreNum int64 | ||||
| TaskType string // pytorch/tensorflow/mindspore | TaskType string // pytorch/tensorflow/mindspore | ||||
| @@ -5642,6 +5642,7 @@ type AiOption struct { | |||||
| Params []string `json:"params,optional"` | Params []string `json:"params,optional"` | ||||
| Envs []string `json:"envs,optional"` | Envs []string `json:"envs,optional"` | ||||
| Cmd string `json:"cmd,optional"` | Cmd string `json:"cmd,optional"` | ||||
| Replica int32 `json:"replicas"` | |||||
| } | } | ||||
| type AiResourceTypesResp struct { | type AiResourceTypesResp struct { | ||||