modified ai scheduler struct

Former-commit-id: 761d378c4d78dd20bc749e077c44a3b9ef772412
This commit is contained in:
tzwang 2024-01-22 23:15:01 +08:00
parent aac4ee3c67
commit 6c8dae6a78
3 changed files with 16 additions and 9 deletions

View File

@ -1,13 +1,16 @@
package collector
import "gitlink.org.cn/jcce-pcm/pcm-ac/hpcacclient"
//单条作业费=作业运行秒数×(CPU核心数*CPU单价+GPU卡数×GPU单价+DCU卡数×DCU单价)/3600
//CPU单价=队列CPU费率×计算中心CPU单价
//GPU单价=队列GPU费率×计算中心GPU单价
//DCU单价=队列DCU费率×计算中心DCU单价
type ShuguangAiCollector struct {
ACRpc hpcacclient.HpcAC
}
func (a *ShuguangAiCollector) getResourceSpecs() {
func (a *ShuguangAiCollector) getResourceSpecs() (*ResourceSpecs, error) {
return nil, nil
}

View File

@ -1,7 +1,7 @@
package collector
type ResourceCollector interface {
getResourceSpecs() ([]ResourceSpecs, error)
getResourceSpecs() (*ResourceSpecs, error)
}
type ResourceSpecs struct {
@ -10,6 +10,7 @@ type ResourceSpecs struct {
DiskAvail float64
GpuAvail float64
CardAvail []Card
Balance float64
}
type Card struct {

View File

@ -19,6 +19,7 @@ import (
"github.com/pkg/errors"
"github.com/zeromicro/go-zero/core/logx"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/pkg/response"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/scheduler/collector"
"gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/client/participantservice"
"gorm.io/gorm"
"sigs.k8s.io/yaml"
@ -26,12 +27,14 @@ import (
)
type scheduler struct {
task *response.TaskInfo
participantIds []int64
scheduleService scheduleService
dbEngin *gorm.DB
result []string //pID:子任务yamlstring 键值对
participantRpc participantservice.ParticipantService
task *response.TaskInfo
participantIds []int64
scheduleService scheduleService
dbEngin *gorm.DB
result []string //pID:子任务yamlstring 键值对
participantRpc participantservice.ParticipantService
resourceCollectors []collector.ResourceCollector
//storelink
}
func NewScheduler(scheduleService scheduleService, val string, dbEngin *gorm.DB, participantRpc participantservice.ParticipantService) (*scheduler, error) {