Documentation ¶
Index ¶
- type DevicePluginManager
- func (m *DevicePluginManager) Allocate(ex *comtypes.ExtendedResource, deviceIds []string) (map[string]string, error)
- func (m *DevicePluginManager) ListAndWatch(ex *comtypes.ExtendedResource) ([]*pluginapi.Device, error)
- func (m *DevicePluginManager) PreStartContainer(ex *comtypes.ExtendedResource, deviceIds []string) error
- type ResourceManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DevicePluginManager ¶
type DevicePluginManager struct { }
DevicePluginManager manager for device plugins
func NewDevicePluginManager ¶
func NewDevicePluginManager() *DevicePluginManager
NewDevicePluginManager xxx new DevicePluginManager function
func (*DevicePluginManager) Allocate ¶
func (m *DevicePluginManager) Allocate(ex *comtypes.ExtendedResource, deviceIds []string) (map[string]string, error)
Allocate xxx request deviceplugin to allocate extended resources before create container call the function
func (*DevicePluginManager) ListAndWatch ¶
func (m *DevicePluginManager) ListAndWatch(ex *comtypes.ExtendedResource) ([]*pluginapi.Device, error)
ListAndWatch xxx request device plugin to listandwatch device list ids return deviceIds, examples: ["cpuset0","cpuset1","cpuset2"...]
func (*DevicePluginManager) PreStartContainer ¶
func (m *DevicePluginManager) PreStartContainer(ex *comtypes.ExtendedResource, deviceIds []string) error
PreStartContainer xxx request deviceplugin to allocate extended resources before create container call the function
type ResourceManager ¶
type ResourceManager struct {
// contains filtered or unexported fields
}
ResourceManager manager for extended resources
func NewResourceManager ¶
func NewResourceManager(devicePluginM *DevicePluginManager, extendedResourceDriver *extendedresource.Driver) *ResourceManager
NewResourceManager create resource manager
func (*ResourceManager) ApplyExtendedResources ¶
func (rm *ResourceManager) ApplyExtendedResources( ex *comtypes.ExtendedResource, taskID string) (map[string]string, error)
ApplyExtendedResources apply extended resource, records to file, and call device plugin return envs after device plugin Allocate
func (*ResourceManager) ReleaseExtendedResources ¶
func (rm *ResourceManager) ReleaseExtendedResources(exName, taskID string) error
ReleaseExtendedResources release extended resource allocation in executor