scheduler

package
v0.0.0-...-b068cba Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OptimisticLockErrorMsg = "the object has been modified; please apply your changes to the latest version and try again"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bind

type Bind struct {
	Name string
	Func func(podName string, podNamespace string, podUID types.UID, node string, cache *cache.SchedulerCache) error
	// contains filtered or unexported fields
}

Bind is responsible for binding node and pod

func NewGPUShareBind

func NewGPUShareBind(clientset *kubernetes.Clientset, c *cache.SchedulerCache) *Bind

func (Bind) Handler

Handler handles the Bind request

type Device

type Device struct {
	ID       int    `json:"id"`
	TotalGPU uint   `json:"totalGPU"`
	UsedGPU  uint   `json:"usedGPU"`
	Pods     []*Pod `json:"pods"`
}

type Inspect

type Inspect struct {
	Name string
	// contains filtered or unexported fields
}

func NewGPUShareInspect

func NewGPUShareInspect(c *cache.SchedulerCache) *Inspect

func (Inspect) Handler

func (in Inspect) Handler(name string) *Result

type Node

type Node struct {
	Name     string    `json:"name"`
	TotalGPU uint      `json:"totalGPU"`
	UsedGPU  uint      `json:"usedGPU"`
	Devices  []*Device `json:"devs"`
}

type Pod

type Pod struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	UsedGPU   int    `json:"usedGPU"`
}

type Predicate

type Predicate struct {
	Name string
	Func func(pod *v1.Pod, nodeName string, c *cache.SchedulerCache) (bool, error)
	// contains filtered or unexported fields
}

func NewGPUsharePredicate

func NewGPUsharePredicate(clientset *kubernetes.Clientset, c *cache.SchedulerCache) *Predicate

type Result

type Result struct {
	Nodes []*Node `json:"nodes"`
	Error string  `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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