device_plugin

package
v0.0.0-...-d64f538 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func String

func String(devs []*pluginapi.Device) string

Types

type DeviceMonitor

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

func NewDeviceMonitor

func NewDeviceMonitor(path string) *DeviceMonitor

func (*DeviceMonitor) Devices

func (d *DeviceMonitor) Devices() []*pluginapi.Device

Devices transformer map to slice

func (*DeviceMonitor) List

func (d *DeviceMonitor) List() error

List all device

func (*DeviceMonitor) Watch

func (d *DeviceMonitor) Watch() error

Watch device change

type GopherDevicePlugin

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

func NewGopherDevicePlugin

func NewGopherDevicePlugin() *GopherDevicePlugin

func (*GopherDevicePlugin) Allocate

Allocate is called during container creation so that the Device Plugin can run device specific operations and instruct Kubelet of the steps to make the Device available in the container

func (*GopherDevicePlugin) GetDevicePluginOptions

func (c *GopherDevicePlugin) GetDevicePluginOptions(_ context.Context, _ *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)

GetDevicePluginOptions returns options to be communicated with Device Manager

func (*GopherDevicePlugin) GetPreferredAllocation

GetPreferredAllocation returns a preferred set of devices to allocate from a list of available ones. The resulting preferred allocation is not guaranteed to be the allocation ultimately performed by the devicemanager. It is only designed to help the devicemanager make a more informed allocation decision when possible.

func (*GopherDevicePlugin) ListAndWatch

ListAndWatch returns a stream of List of Devices Whenever a Device state change or a Device disappears, ListAndWatch returns the new list

func (*GopherDevicePlugin) PreStartContainer

PreStartContainer is called, if indicated by Device Plugin during registeration phase, before each container start. Device plugin can run device specific operations such as reseting the device before making devices available to the container

func (*GopherDevicePlugin) Register

func (c *GopherDevicePlugin) Register() error

Register registers the device plugin for the given resourceName with Kubelet.

func (*GopherDevicePlugin) Run

func (c *GopherDevicePlugin) Run() error

Run start gRPC server and watcher

Jump to

Keyboard shortcuts

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