nvidia

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ALLOCATE_SUCCESS = iota
	ALLOCATE_FAIL
	PREDICATE_MISSING
)

Variables

This section is empty.

Functions

func NewNvidiaTopoAllocator

func NewNvidiaTopoAllocator(config *config.Config, tree device.GPUTree, k8sClient kubernetes.Interface) allocator.GPUTopoService

NewNvidiaTopoAllocator returns a new NvidiaTopoAllocator

func NewNvidiaTopoAllocatorForTest

func NewNvidiaTopoAllocatorForTest(config *config.Config, tree device.GPUTree, k8sClient kubernetes.Interface) allocator.GPUTopoService

NewNvidiaTopoAllocatorForTest returns a new NvidiaTopoAllocator with fake docker client, just for testing.

func OrderPodsdByPredicateTime

func OrderPodsdByPredicateTime(pods []*v1.Pod) []*v1.Pod

make the pod ordered by predicate time

Types

type Evaluator

type Evaluator interface {
	Evaluate(cores int64, memory int64) []*node.NvidiaNode
}

Evaluator api for schedule algorithm

type NvidiaTopoAllocator

type NvidiaTopoAllocator struct {
	sync.Mutex
	// contains filtered or unexported fields
}

NvidiaTopoAllocator is an allocator for Nvidia GPU

func (*NvidiaTopoAllocator) Allocate

#lizard forgives Allocate tries to allocate GPU node for each request

func (*NvidiaTopoAllocator) GetDevicePluginOptions

func (ta *NvidiaTopoAllocator) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)

GetDevicePluginOptions returns empty DevicePluginOptions

func (*NvidiaTopoAllocator) ListAndWatch

ListAndWatch is not implement

func (*NvidiaTopoAllocator) ListAndWatchWithResourceName

func (ta *NvidiaTopoAllocator) ListAndWatchWithResourceName(resourceName string, e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error

ListAndWatchWithResourceName send devices for request resource back to server

func (*NvidiaTopoAllocator) PreStartContainer

PreStartContainer find the podUID by comparing request deviceids with deviceplugin checkpoint data, then checks the validation of allocation of the pod. Update pod annotation if check success, otherwise evict the pod.

type PodsOrderedByPredicateTime

type PodsOrderedByPredicateTime []*v1.Pod

func (PodsOrderedByPredicateTime) Len

func (pods PodsOrderedByPredicateTime) Len() int

func (PodsOrderedByPredicateTime) Less

func (pods PodsOrderedByPredicateTime) Less(i, j int) bool

func (PodsOrderedByPredicateTime) Swap

func (pods PodsOrderedByPredicateTime) Swap(i, j int)

Jump to

Keyboard shortcuts

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