modified ai scheduler struct
Former-commit-id: 761d378c4d78dd20bc749e077c44a3b9ef772412
This commit is contained in:
parent
aac4ee3c67
commit
6c8dae6a78
|
@ -1,13 +1,16 @@
|
||||||
package collector
|
package collector
|
||||||
|
|
||||||
|
import "gitlink.org.cn/jcce-pcm/pcm-ac/hpcacclient"
|
||||||
|
|
||||||
//单条作业费=作业运行秒数×(CPU核心数*CPU单价+GPU卡数×GPU单价+DCU卡数×DCU单价)/3600
|
//单条作业费=作业运行秒数×(CPU核心数*CPU单价+GPU卡数×GPU单价+DCU卡数×DCU单价)/3600
|
||||||
//CPU单价=队列CPU费率×计算中心CPU单价
|
//CPU单价=队列CPU费率×计算中心CPU单价
|
||||||
//GPU单价=队列GPU费率×计算中心GPU单价
|
//GPU单价=队列GPU费率×计算中心GPU单价
|
||||||
//DCU单价=队列DCU费率×计算中心DCU单价
|
//DCU单价=队列DCU费率×计算中心DCU单价
|
||||||
|
|
||||||
type ShuguangAiCollector struct {
|
type ShuguangAiCollector struct {
|
||||||
|
ACRpc hpcacclient.HpcAC
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *ShuguangAiCollector) getResourceSpecs() {
|
func (a *ShuguangAiCollector) getResourceSpecs() (*ResourceSpecs, error) {
|
||||||
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package collector
|
package collector
|
||||||
|
|
||||||
type ResourceCollector interface {
|
type ResourceCollector interface {
|
||||||
getResourceSpecs() ([]ResourceSpecs, error)
|
getResourceSpecs() (*ResourceSpecs, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type ResourceSpecs struct {
|
type ResourceSpecs struct {
|
||||||
|
@ -10,6 +10,7 @@ type ResourceSpecs struct {
|
||||||
DiskAvail float64
|
DiskAvail float64
|
||||||
GpuAvail float64
|
GpuAvail float64
|
||||||
CardAvail []Card
|
CardAvail []Card
|
||||||
|
Balance float64
|
||||||
}
|
}
|
||||||
|
|
||||||
type Card struct {
|
type Card struct {
|
||||||
|
|
|
@ -19,6 +19,7 @@ import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/pkg/response"
|
"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"
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/client/participantservice"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
"sigs.k8s.io/yaml"
|
"sigs.k8s.io/yaml"
|
||||||
|
@ -26,12 +27,14 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type scheduler struct {
|
type scheduler struct {
|
||||||
task *response.TaskInfo
|
task *response.TaskInfo
|
||||||
participantIds []int64
|
participantIds []int64
|
||||||
scheduleService scheduleService
|
scheduleService scheduleService
|
||||||
dbEngin *gorm.DB
|
dbEngin *gorm.DB
|
||||||
result []string //pID:子任务yamlstring 键值对
|
result []string //pID:子任务yamlstring 键值对
|
||||||
participantRpc participantservice.ParticipantService
|
participantRpc participantservice.ParticipantService
|
||||||
|
resourceCollectors []collector.ResourceCollector
|
||||||
|
//storelink
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewScheduler(scheduleService scheduleService, val string, dbEngin *gorm.DB, participantRpc participantservice.ParticipantService) (*scheduler, error) {
|
func NewScheduler(scheduleService scheduleService, val string, dbEngin *gorm.DB, participantRpc participantservice.ParticipantService) (*scheduler, error) {
|
||||||
|
|
Loading…
Reference in New Issue