Browse Source

fix: update ai Replicas

Former-commit-id: f08e733c5b
pull/178/head
qiwang 1 year ago
parent
commit
b2eb0a6156
7 changed files with 6 additions and 6 deletions
  1. +1
    -0
      api/desc/schedule/pcm-schedule.api
  2. +0
    -2
      api/internal/logic/core/commitvmtasklogic.go
  3. +1
    -1
      api/internal/logic/schedule/schedulesubmitlogic.go
  4. +1
    -1
      api/internal/scheduler/database/aiStorage.go
  5. +1
    -1
      api/internal/scheduler/schedulers/aiScheduler.go
  6. +1
    -1
      api/internal/scheduler/schedulers/option/aiOption.go
  7. +1
    -0
      api/internal/types/types.go

+ 1
- 0
api/desc/schedule/pcm-schedule.api View File

@@ -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 {


+ 0
- 2
api/internal/logic/core/commitvmtasklogic.go View File

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


+ 1
- 1
api/internal/logic/schedule/schedulesubmitlogic.go View File

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


+ 1
- 1
api/internal/scheduler/database/aiStorage.go View File

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


+ 1
- 1
api/internal/scheduler/schedulers/aiScheduler.go View File

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



+ 1
- 1
api/internal/scheduler/schedulers/option/aiOption.go View File

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


+ 1
- 0
api/internal/types/types.go View File

@@ -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…
Cancel
Save