All Known Implementing Classes:
NECVEPlugin, NvidiaGPUPluginForRuntimeV2

public interface DevicePlugin
A must interface for vendor plugin to implement.
  • Method Details

    • getRegisterRequestInfo

      DeviceRegisterRequest getRegisterRequestInfo() throws Exception
      Called first when device plugin framework wants to register.
      Returns:
      DeviceRegisterRequest DeviceRegisterRequest
      Throws:
      Exception
    • getDevices

      Set<Device> getDevices() throws Exception
      Called when update node resource.
      Returns:
      a set of Device, TreeSet recommended
      Throws:
      Exception
    • onDevicesAllocated

      DeviceRuntimeSpec onDevicesAllocated(Set<Device> allocatedDevices, YarnRuntimeType yarnRuntime) throws Exception
      Asking how these devices should be prepared/used before/when container launch. A plugin can do some tasks in its own or define it in DeviceRuntimeSpec to let the framework do it. For instance, define VolumeSpec to let the framework to create volume before running container.
      Parameters:
      allocatedDevices - A set of allocated Device.
      yarnRuntime - Indicate which runtime YARN will use Could be RUNTIME_DEFAULT or RUNTIME_DOCKER in DeviceRuntimeSpec constants. The default means YARN's non-docker container runtime is used. The docker means YARN's docker container runtime is used.
      Returns:
      a DeviceRuntimeSpec description about environment, VolumeSpec, MountVolumeSpec. etc
      Throws:
      Exception
    • onDevicesReleased

      void onDevicesReleased(Set<Device> releasedDevices) throws Exception
      Called after device released.
      Parameters:
      releasedDevices - A set of released devices
      Throws:
      Exception