device_plugin

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceMemory    = "iscas.cn/gpu-memory"
	ResourceCore      = "iscas.cn/gpu-core"
	MluResourceMemory = "iscas.cn/mlu-memory"
	MluResourceCore   = "iscas.cn/mlu-core"
	DcuResourceMemory = "iscas.cn/dcu-memory"
	DcuResourceCore   = "iscas.cn/dcu-core"
	ResourceUUID      = "iscas.cn/dev-uuid"

	AnnAssumeTime   = "iscas.cn/dev-assume-time"
	AnnAssignedFlag = "iscas.cn/dev-assigned"
	AnnScheduleNode = "iscas.cn/dev-schedule-node"
	AnnDevUseMode   = "iscas.cn/dev-use-mode"
)
View Source
const Name = "DevFilter"

插件名称

Variables

View Source
var (
	DeletePodCache []*v1.Pod
	DelMutex       sync.Mutex
)
View Source
var StopCh chan struct{}

Functions

func GetKuberConfig

func GetKuberConfig(kubeconfig string) *rest.Config

func ReplaceStr

func ReplaceStr(str string) string

Types

type DevFilterPlugin

type DevFilterPlugin struct {
	// contains filtered or unexported fields
}

func (*DevFilterPlugin) Filter

func (s *DevFilterPlugin) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status

Filter(ctx context.Context, state *CycleState, pod *v1.Pod, nodeInfo *NodeInfo) *Status

func (*DevFilterPlugin) Name

func (s *DevFilterPlugin) Name() string

type DevResource

type DevResource struct {
	Dev_type        string
	Name            string
	Uuid            string
	Node            string
	CoreCapacity    int64
	CoreAllocated   int64
	MemoryCapacity  int64
	MemoryAllocated int64
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}
var PlugunManager *Manager

func InitInformer

func InitInformer(config *rest.Config) *Manager

func NewManager

func NewManager(client *kubernetes.Clientset, dynClient *dynamic.DynamicClient, devInf cache.SharedIndexInformer, podInf cache.SharedIndexInformer) *Manager

func (*Manager) AddCrd

func (m *Manager) AddCrd()

func (*Manager) AddPod

func (m *Manager) AddPod()

func (*Manager) DeletePod

func (m *Manager) DeletePod()

func (*Manager) Schedule

func (m *Manager) Schedule(acceType string, requestMemory, requestCore int64) (string, string)

func (*Manager) Stop

func (m *Manager) Stop()

type NodeResource

type NodeResource struct {
	NodeName   string
	DevsByUuid map[string]*DevResource
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL