Documentation ¶
Index ¶
- Constants
- func NewNvidiaTopoAllocator(config *config.Config, tree device.GPUTree, k8sClient kubernetes.Interface) allocator.GPUTopoService
- func NewNvidiaTopoAllocatorForTest(config *config.Config, tree device.GPUTree, k8sClient kubernetes.Interface) allocator.GPUTopoService
- func OrderPodsdByPredicateTime(pods []*v1.Pod) []*v1.Pod
- type Evaluator
- type NvidiaTopoAllocator
- func (ta *NvidiaTopoAllocator) Allocate(_ context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (ta *NvidiaTopoAllocator) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (ta *NvidiaTopoAllocator) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
- func (ta *NvidiaTopoAllocator) ListAndWatchWithResourceName(resourceName string, e *pluginapi.Empty, ...) error
- func (ta *NvidiaTopoAllocator) PreStartContainer(ctx context.Context, req *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- type PodsOrderedByPredicateTime
Constants ¶
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.
Types ¶
type Evaluator ¶
type Evaluator interface {
Evaluate(cores int64, memory int64) []*node.NvidiaNode
}
Evaluator api for schedule algorithm
type NvidiaTopoAllocator ¶
NvidiaTopoAllocator is an allocator for Nvidia GPU
func (*NvidiaTopoAllocator) Allocate ¶
func (ta *NvidiaTopoAllocator) Allocate(_ context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
#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 ¶
func (ta *NvidiaTopoAllocator) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
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 ¶
func (ta *NvidiaTopoAllocator) PreStartContainer(ctx context.Context, req *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
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 ¶
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)