deviceplugin

package
v1.8.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package deviceplugin is a generated protocol buffer package.

It is generated from these files:

api.proto

It has these top-level messages:

RegisterRequest
Empty
ListAndWatchResponse
Device
AllocateRequest
AllocateResponse
DeviceRuntimeSpec
Mount
DeviceSpec

Index

Constants

View Source
const (
	// Healthy means that the device is healty
	Healthy = "Healthy"
	// UnHealthy means that the device is unhealty
	Unhealthy = "Unhealthy"

	// Version is the API version
	Version = "0.1"
	// DevicePluginPath is the folder the Device Plugin is expecting sockets to be on
	// Only privileged pods have access to this path
	// Note: Placeholder until we find a "standard path"
	DevicePluginPath = "/var/lib/kubelet/device-plugins/"
	// KubeletSocket is the path of the Kubelet registry socket
	KubeletSocket = DevicePluginPath + "kubelet.sock"
)

Variables

View Source
var (
	ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowApi   = fmt.Errorf("proto: integer overflow")
)

Functions

func RegisterDevicePluginServer

func RegisterDevicePluginServer(s *grpc.Server, srv DevicePluginServer)

func RegisterRegistrationServer

func RegisterRegistrationServer(s *grpc.Server, srv RegistrationServer)

Types

type AllocateRequest

type AllocateRequest struct {
	DevicesIDs []string `protobuf:"bytes,1,rep,name=devicesIDs" json:"devicesIDs,omitempty"`
}
  • Allocate is expected to be called during pod creation since allocation failures for any container would result in pod startup failure.
  • Allocate allows kubelet to exposes additional artifacts in a pod's environment as directed by the plugin.
  • Allocate allows Device Plugin to run device specific operations on the Devices requested

func (*AllocateRequest) Descriptor

func (*AllocateRequest) Descriptor() ([]byte, []int)

func (*AllocateRequest) GetDevicesIDs

func (m *AllocateRequest) GetDevicesIDs() []string

func (*AllocateRequest) Marshal

func (m *AllocateRequest) Marshal() (dAtA []byte, err error)

func (*AllocateRequest) MarshalTo

func (m *AllocateRequest) MarshalTo(dAtA []byte) (int, error)

func (*AllocateRequest) ProtoMessage

func (*AllocateRequest) ProtoMessage()

func (*AllocateRequest) Reset

func (m *AllocateRequest) Reset()

func (*AllocateRequest) Size

func (m *AllocateRequest) Size() (n int)

func (*AllocateRequest) String

func (this *AllocateRequest) String() string

func (*AllocateRequest) Unmarshal

func (m *AllocateRequest) Unmarshal(dAtA []byte) error

type AllocateResponse

type AllocateResponse struct {
	Spec []*DeviceRuntimeSpec `protobuf:"bytes,1,rep,name=spec" json:"spec,omitempty"`
}

Failure Handling: if Kubelet sends an allocation request for dev1 and dev2. Allocation on dev1 succeeds but allocation on dev2 fails. The Device plugin should send a ListAndWatch update and fail the Allocation request

func (*AllocateResponse) Descriptor

func (*AllocateResponse) Descriptor() ([]byte, []int)

func (*AllocateResponse) GetSpec

func (m *AllocateResponse) GetSpec() []*DeviceRuntimeSpec

func (*AllocateResponse) Marshal

func (m *AllocateResponse) Marshal() (dAtA []byte, err error)

func (*AllocateResponse) MarshalTo

func (m *AllocateResponse) MarshalTo(dAtA []byte) (int, error)

func (*AllocateResponse) ProtoMessage

func (*AllocateResponse) ProtoMessage()

func (*AllocateResponse) Reset

func (m *AllocateResponse) Reset()

func (*AllocateResponse) Size

func (m *AllocateResponse) Size() (n int)

func (*AllocateResponse) String

func (this *AllocateResponse) String() string

func (*AllocateResponse) Unmarshal

func (m *AllocateResponse) Unmarshal(dAtA []byte) error

type Device

type Device struct {
	// A unique ID assigned by the device plugin used
	// to identify devices during the communication
	// Max length of this field is 63 characters
	ID string `protobuf:"bytes,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
	// Health of the device, can be healthy or unhealthy, see constants.go
	Health string `protobuf:"bytes,2,opt,name=health,proto3" json:"health,omitempty"`
}

E.g:

struct Device {
   ID: "GPU-fef8089b-4820-abfc-e83e-94318197576e",
   State: "Healthy",
}

func (*Device) Descriptor

func (*Device) Descriptor() ([]byte, []int)

func (*Device) GetHealth

func (m *Device) GetHealth() string

func (*Device) GetID

func (m *Device) GetID() string

func (*Device) Marshal

func (m *Device) Marshal() (dAtA []byte, err error)

func (*Device) MarshalTo

func (m *Device) MarshalTo(dAtA []byte) (int, error)

func (*Device) ProtoMessage

func (*Device) ProtoMessage()

func (*Device) Reset

func (m *Device) Reset()

func (*Device) Size

func (m *Device) Size() (n int)

func (*Device) String

func (this *Device) String() string

func (*Device) Unmarshal

func (m *Device) Unmarshal(dAtA []byte) error

type DevicePluginClient

type DevicePluginClient interface {
	// ListAndWatch returns a stream of List of Devices
	// Whenever a Device state change or a Device disapears, ListAndWatch
	// returns the new list
	ListAndWatch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (DevicePlugin_ListAndWatchClient, 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
	Allocate(ctx context.Context, in *AllocateRequest, opts ...grpc.CallOption) (*AllocateResponse, error)
}

func NewDevicePluginClient

func NewDevicePluginClient(cc *grpc.ClientConn) DevicePluginClient

type DevicePluginServer

type DevicePluginServer interface {
	// ListAndWatch returns a stream of List of Devices
	// Whenever a Device state change or a Device disapears, ListAndWatch
	// returns the new list
	ListAndWatch(*Empty, DevicePlugin_ListAndWatchServer) 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
	Allocate(context.Context, *AllocateRequest) (*AllocateResponse, error)
}

type DevicePlugin_ListAndWatchClient

type DevicePlugin_ListAndWatchClient interface {
	Recv() (*ListAndWatchResponse, error)
	grpc.ClientStream
}

type DevicePlugin_ListAndWatchServer

type DevicePlugin_ListAndWatchServer interface {
	Send(*ListAndWatchResponse) error
	grpc.ServerStream
}

type DeviceRuntimeSpec

type DeviceRuntimeSpec struct {
	// ID of the Device
	ID string `protobuf:"bytes,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
	// List of environment variable to set in the container.
	Envs map[string]string `` /* 142-byte string literal not displayed */
	// Mounts for the container.
	Mounts []*Mount `protobuf:"bytes,3,rep,name=mounts" json:"mounts,omitempty"`
	// Devices for the container
	Devices []*DeviceSpec `protobuf:"bytes,4,rep,name=devices" json:"devices,omitempty"`
}

The list to be added to the CRI spec

func (*DeviceRuntimeSpec) Descriptor

func (*DeviceRuntimeSpec) Descriptor() ([]byte, []int)

func (*DeviceRuntimeSpec) GetDevices

func (m *DeviceRuntimeSpec) GetDevices() []*DeviceSpec

func (*DeviceRuntimeSpec) GetEnvs

func (m *DeviceRuntimeSpec) GetEnvs() map[string]string

func (*DeviceRuntimeSpec) GetID

func (m *DeviceRuntimeSpec) GetID() string

func (*DeviceRuntimeSpec) GetMounts

func (m *DeviceRuntimeSpec) GetMounts() []*Mount

func (*DeviceRuntimeSpec) Marshal

func (m *DeviceRuntimeSpec) Marshal() (dAtA []byte, err error)

func (*DeviceRuntimeSpec) MarshalTo

func (m *DeviceRuntimeSpec) MarshalTo(dAtA []byte) (int, error)

func (*DeviceRuntimeSpec) ProtoMessage

func (*DeviceRuntimeSpec) ProtoMessage()

func (*DeviceRuntimeSpec) Reset

func (m *DeviceRuntimeSpec) Reset()

func (*DeviceRuntimeSpec) Size

func (m *DeviceRuntimeSpec) Size() (n int)

func (*DeviceRuntimeSpec) String

func (this *DeviceRuntimeSpec) String() string

func (*DeviceRuntimeSpec) Unmarshal

func (m *DeviceRuntimeSpec) Unmarshal(dAtA []byte) error

type DeviceSpec

type DeviceSpec struct {
	// Path of the device within the container.
	ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"container_path,omitempty"`
	// Path of the device on the host.
	HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"`
	// Cgroups permissions of the device, candidates are one or more of
	// * r - allows container to read from the specified device.
	// * w - allows container to write to the specified device.
	// * m - allows container to create device files that do not yet exist.
	Permissions string `protobuf:"bytes,3,opt,name=permissions,proto3" json:"permissions,omitempty"`
}

DeviceSpec specifies a host device to mount into a container.

func (*DeviceSpec) Descriptor

func (*DeviceSpec) Descriptor() ([]byte, []int)

func (*DeviceSpec) GetContainerPath

func (m *DeviceSpec) GetContainerPath() string

func (*DeviceSpec) GetHostPath

func (m *DeviceSpec) GetHostPath() string

func (*DeviceSpec) GetPermissions

func (m *DeviceSpec) GetPermissions() string

func (*DeviceSpec) Marshal

func (m *DeviceSpec) Marshal() (dAtA []byte, err error)

func (*DeviceSpec) MarshalTo

func (m *DeviceSpec) MarshalTo(dAtA []byte) (int, error)

func (*DeviceSpec) ProtoMessage

func (*DeviceSpec) ProtoMessage()

func (*DeviceSpec) Reset

func (m *DeviceSpec) Reset()

func (*DeviceSpec) Size

func (m *DeviceSpec) Size() (n int)

func (*DeviceSpec) String

func (this *DeviceSpec) String() string

func (*DeviceSpec) Unmarshal

func (m *DeviceSpec) Unmarshal(dAtA []byte) error

type Empty

type Empty struct {
}

func (*Empty) Descriptor

func (*Empty) Descriptor() ([]byte, []int)

func (*Empty) Marshal

func (m *Empty) Marshal() (dAtA []byte, err error)

func (*Empty) MarshalTo

func (m *Empty) MarshalTo(dAtA []byte) (int, error)

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) Size

func (m *Empty) Size() (n int)

func (*Empty) String

func (this *Empty) String() string

func (*Empty) Unmarshal

func (m *Empty) Unmarshal(dAtA []byte) error

type ListAndWatchResponse

type ListAndWatchResponse struct {
	Devices []*Device `protobuf:"bytes,1,rep,name=devices" json:"devices,omitempty"`
}

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

func (*ListAndWatchResponse) Descriptor

func (*ListAndWatchResponse) Descriptor() ([]byte, []int)

func (*ListAndWatchResponse) GetDevices

func (m *ListAndWatchResponse) GetDevices() []*Device

func (*ListAndWatchResponse) Marshal

func (m *ListAndWatchResponse) Marshal() (dAtA []byte, err error)

func (*ListAndWatchResponse) MarshalTo

func (m *ListAndWatchResponse) MarshalTo(dAtA []byte) (int, error)

func (*ListAndWatchResponse) ProtoMessage

func (*ListAndWatchResponse) ProtoMessage()

func (*ListAndWatchResponse) Reset

func (m *ListAndWatchResponse) Reset()

func (*ListAndWatchResponse) Size

func (m *ListAndWatchResponse) Size() (n int)

func (*ListAndWatchResponse) String

func (this *ListAndWatchResponse) String() string

func (*ListAndWatchResponse) Unmarshal

func (m *ListAndWatchResponse) Unmarshal(dAtA []byte) error

type Mount

type Mount struct {
	// Path of the mount within the container.
	ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"container_path,omitempty"`
	// Path of the mount on the host.
	HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"`
	// If set, the mount is read-only.
	ReadOnly bool `protobuf:"varint,3,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
}

Mount specifies a host volume to mount into a container. where device library or tools are installed on host and container

func (*Mount) Descriptor

func (*Mount) Descriptor() ([]byte, []int)

func (*Mount) GetContainerPath

func (m *Mount) GetContainerPath() string

func (*Mount) GetHostPath

func (m *Mount) GetHostPath() string

func (*Mount) GetReadOnly

func (m *Mount) GetReadOnly() bool

func (*Mount) Marshal

func (m *Mount) Marshal() (dAtA []byte, err error)

func (*Mount) MarshalTo

func (m *Mount) MarshalTo(dAtA []byte) (int, error)

func (*Mount) ProtoMessage

func (*Mount) ProtoMessage()

func (*Mount) Reset

func (m *Mount) Reset()

func (*Mount) Size

func (m *Mount) Size() (n int)

func (*Mount) String

func (this *Mount) String() string

func (*Mount) Unmarshal

func (m *Mount) Unmarshal(dAtA []byte) error

type RegisterRequest

type RegisterRequest struct {
	// Version of the API the Device Plugin was built against
	Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	// Name of the unix socket the device plugin is listening on
	// PATH = path.Join(DevicePluginPath, endpoint)
	Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	// Schedulable resource name. As of now it's expected to be a DNS Label
	ResourceName string `protobuf:"bytes,3,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"`
}

func (*RegisterRequest) Descriptor

func (*RegisterRequest) Descriptor() ([]byte, []int)

func (*RegisterRequest) GetEndpoint

func (m *RegisterRequest) GetEndpoint() string

func (*RegisterRequest) GetResourceName

func (m *RegisterRequest) GetResourceName() string

func (*RegisterRequest) GetVersion

func (m *RegisterRequest) GetVersion() string

func (*RegisterRequest) Marshal

func (m *RegisterRequest) Marshal() (dAtA []byte, err error)

func (*RegisterRequest) MarshalTo

func (m *RegisterRequest) MarshalTo(dAtA []byte) (int, error)

func (*RegisterRequest) ProtoMessage

func (*RegisterRequest) ProtoMessage()

func (*RegisterRequest) Reset

func (m *RegisterRequest) Reset()

func (*RegisterRequest) Size

func (m *RegisterRequest) Size() (n int)

func (*RegisterRequest) String

func (this *RegisterRequest) String() string

func (*RegisterRequest) Unmarshal

func (m *RegisterRequest) Unmarshal(dAtA []byte) error

type RegistrationClient

type RegistrationClient interface {
	Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*Empty, error)
}

func NewRegistrationClient

func NewRegistrationClient(cc *grpc.ClientConn) RegistrationClient

type RegistrationServer

type RegistrationServer interface {
	Register(context.Context, *RegisterRequest) (*Empty, error)
}

Jump to

Keyboard shortcuts

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