Documentation ¶
Index ¶
- func String(devs []*pluginapi.Device) string
- type DeviceMonitor
- type GopherDevicePlugin
- func (c *GopherDevicePlugin) Allocate(_ context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (c *GopherDevicePlugin) GetDevicePluginOptions(_ context.Context, _ *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (c *GopherDevicePlugin) GetPreferredAllocation(_ context.Context, _ *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
- func (c *GopherDevicePlugin) ListAndWatch(_ *pluginapi.Empty, srv pluginapi.DevicePlugin_ListAndWatchServer) error
- func (c *GopherDevicePlugin) PreStartContainer(_ context.Context, _ *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (c *GopherDevicePlugin) Register() error
- func (c *GopherDevicePlugin) Run() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
type GopherDevicePlugin ¶
type GopherDevicePlugin struct {
// contains filtered or unexported fields
}
func NewGopherDevicePlugin ¶
func NewGopherDevicePlugin() *GopherDevicePlugin
func (*GopherDevicePlugin) Allocate ¶
func (c *GopherDevicePlugin) Allocate(_ context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
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 ¶
func (c *GopherDevicePlugin) GetPreferredAllocation(_ context.Context, _ *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
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 ¶
func (c *GopherDevicePlugin) ListAndWatch(_ *pluginapi.Empty, srv pluginapi.DevicePlugin_ListAndWatchServer) error
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 ¶
func (c *GopherDevicePlugin) PreStartContainer(_ context.Context, _ *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
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