fix: update ai Replicas
Former-commit-id: f08e733c5be93758e45a19808851d12569a4f2d3
This commit is contained in:
parent
e4df9839ad
commit
b2eb0a6156
|
@ -41,6 +41,7 @@ type (
|
|||
Params []string `json:"params,optional"`
|
||||
Envs []string `json:"envs,optional"`
|
||||
Cmd string `json:"cmd,optional"`
|
||||
Replica int32 `json:"replicas"`
|
||||
}
|
||||
|
||||
AiResourceTypesResp {
|
||||
|
|
|
@ -110,7 +110,6 @@ func (l *CommitVmTaskLogic) CommitVmTask(req *types.CommitVmTaskReq) (resp *type
|
|||
AND vf.public_flavor_id = ?
|
||||
AND vi.public_image_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)
|
||||
if txVm.Error != nil {
|
||||
logx.Error(err)
|
||||
|
@ -118,7 +117,6 @@ func (l *CommitVmTaskLogic) CommitVmTask(req *types.CommitVmTaskReq) (resp *type
|
|||
}
|
||||
if err2 != nil {
|
||||
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.Status = "Saved"
|
||||
|
|
|
@ -31,7 +31,7 @@ func (l *ScheduleSubmitLogic) ScheduleSubmit(req *types.ScheduleReq) (resp *type
|
|||
AdapterId: req.AiOption.AdapterId,
|
||||
TaskName: req.AiOption.TaskName,
|
||||
ResourceType: req.AiOption.ResourceType,
|
||||
Replica: 1,
|
||||
Replica: req.AiOption.Replica,
|
||||
Tops: req.AiOption.Tops,
|
||||
TaskType: req.AiOption.TaskType,
|
||||
DatasetsName: req.AiOption.Datasets,
|
||||
|
|
|
@ -105,7 +105,7 @@ func (s *AiStorage) SaveAiTask(taskId int64, option *option.AiOption, clusterId
|
|||
AdapterId: aId,
|
||||
ClusterId: cId,
|
||||
Name: option.TaskName,
|
||||
Replica: option.Replica,
|
||||
Replica: int64(option.Replica),
|
||||
JobId: jobId,
|
||||
TaskType: option.TaskType,
|
||||
Strategy: option.StrategyName,
|
||||
|
|
|
@ -103,7 +103,7 @@ func (as *AiScheduler) PickOptimalStrategy() (strategy.Strategy, error) {
|
|||
return strategy, nil
|
||||
case strategy.STATIC_WEIGHT:
|
||||
//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
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ type AiOption struct {
|
|||
AdapterId string
|
||||
ClusterIds []string
|
||||
TaskName string
|
||||
Replica int64
|
||||
Replica int32
|
||||
ResourceType string // cpu/gpu/compute card
|
||||
CpuCoreNum int64
|
||||
TaskType string // pytorch/tensorflow/mindspore
|
||||
|
|
|
@ -5642,6 +5642,7 @@ type AiOption struct {
|
|||
Params []string `json:"params,optional"`
|
||||
Envs []string `json:"envs,optional"`
|
||||
Cmd string `json:"cmd,optional"`
|
||||
Replica int32 `json:"replicas"`
|
||||
}
|
||||
|
||||
type AiResourceTypesResp struct {
|
||||
|
|
Loading…
Reference in New Issue