Documentation ¶
Index ¶
- type DevicePluginServer
- func (m *DevicePluginServer) Allocate(ctx context.Context, req *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (m *DevicePluginServer) GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (m *DevicePluginServer) GetPreferredAllocation(context.Context, *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
- func (m *DevicePluginServer) ListAndWatch(empty *pluginapi.Empty, srv pluginapi.DevicePlugin_ListAndWatchServer) error
- func (m *DevicePluginServer) PreStartContainer(context.Context, *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (m *DevicePluginServer) Run(ctx context.Context, wg *sync.WaitGroup, errCh chan<- error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DevicePluginServer ¶
type DevicePluginServer struct {
// contains filtered or unexported fields
}
func NewDevicePluginServer ¶
func NewDevicePluginServer(devicePaths []string, deviceGroupName string, mapSymPaths bool) *DevicePluginServer
NewDevicePluginServer returns an initialized DevicePluginServer
func (*DevicePluginServer) Allocate ¶
func (m *DevicePluginServer) Allocate(ctx context.Context, req *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 (*DevicePluginServer) GetDevicePluginOptions ¶
func (m *DevicePluginServer) GetDevicePluginOptions(context.Context, *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
GetDevicePluginOptions returns options to be communicated with Device Manager
func (*DevicePluginServer) GetPreferredAllocation ¶
func (m *DevicePluginServer) 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 (*DevicePluginServer) ListAndWatch ¶
func (m *DevicePluginServer) ListAndWatch(empty *pluginapi.Empty, srv pluginapi.DevicePlugin_ListAndWatchServer) error
ListAndWatch returns a stream of List of Devices Whenever a Device state change or a Device disapears, ListAndWatch returns the new list
func (*DevicePluginServer) PreStartContainer ¶
func (m *DevicePluginServer) 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