2018-08-07 05:27:47 +00:00
|
|
|
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
2018-08-13 17:29:29 +00:00
|
|
|
|
// source: github.com/hashicorp/nomad/plugins/device/proto/device.proto
|
2018-08-07 05:27:47 +00:00
|
|
|
|
|
2018-08-13 17:29:29 +00:00
|
|
|
|
package proto
|
2018-08-07 05:27:47 +00:00
|
|
|
|
|
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
|
|
|
import fmt "fmt"
|
|
|
|
|
import math "math"
|
2018-08-23 18:18:35 +00:00
|
|
|
|
import timestamp "github.com/golang/protobuf/ptypes/timestamp"
|
2018-08-07 05:27:47 +00:00
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
context "golang.org/x/net/context"
|
|
|
|
|
grpc "google.golang.org/grpc"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
|
|
|
var _ = proto.Marshal
|
|
|
|
|
var _ = fmt.Errorf
|
|
|
|
|
var _ = math.Inf
|
|
|
|
|
|
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
|
|
|
// is compatible with the proto package it is being compiled against.
|
|
|
|
|
// A compilation error at this line likely means your copy of the
|
|
|
|
|
// proto package needs to be updated.
|
|
|
|
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
|
|
2018-08-13 17:29:29 +00:00
|
|
|
|
// FingerprintRequest is used to request for devices to be fingerprinted.
|
|
|
|
|
type FingerprintRequest struct {
|
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *FingerprintRequest) Reset() { *m = FingerprintRequest{} }
|
|
|
|
|
func (m *FingerprintRequest) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*FingerprintRequest) ProtoMessage() {}
|
|
|
|
|
func (*FingerprintRequest) Descriptor() ([]byte, []int) {
|
2018-08-23 18:18:35 +00:00
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{0}
|
2018-08-13 17:29:29 +00:00
|
|
|
|
}
|
|
|
|
|
func (m *FingerprintRequest) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_FingerprintRequest.Unmarshal(m, b)
|
|
|
|
|
}
|
|
|
|
|
func (m *FingerprintRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_FingerprintRequest.Marshal(b, m, deterministic)
|
|
|
|
|
}
|
|
|
|
|
func (dst *FingerprintRequest) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_FingerprintRequest.Merge(dst, src)
|
|
|
|
|
}
|
|
|
|
|
func (m *FingerprintRequest) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_FingerprintRequest.Size(m)
|
|
|
|
|
}
|
|
|
|
|
func (m *FingerprintRequest) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_FingerprintRequest.DiscardUnknown(m)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var xxx_messageInfo_FingerprintRequest proto.InternalMessageInfo
|
|
|
|
|
|
|
|
|
|
// FingerprintResponse returns a set of detected devices.
|
|
|
|
|
type FingerprintResponse struct {
|
|
|
|
|
// device_group is a group of devices that share a vendor, device_type, and
|
|
|
|
|
// device_name. This is returned as a set so that a single plugin could
|
|
|
|
|
// potentially detect several device types and models.
|
|
|
|
|
DeviceGroup []*DeviceGroup `protobuf:"bytes,1,rep,name=device_group,json=deviceGroup,proto3" json:"device_group,omitempty"`
|
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *FingerprintResponse) Reset() { *m = FingerprintResponse{} }
|
|
|
|
|
func (m *FingerprintResponse) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*FingerprintResponse) ProtoMessage() {}
|
|
|
|
|
func (*FingerprintResponse) Descriptor() ([]byte, []int) {
|
2018-08-23 18:18:35 +00:00
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{1}
|
2018-08-13 17:29:29 +00:00
|
|
|
|
}
|
|
|
|
|
func (m *FingerprintResponse) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_FingerprintResponse.Unmarshal(m, b)
|
|
|
|
|
}
|
|
|
|
|
func (m *FingerprintResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_FingerprintResponse.Marshal(b, m, deterministic)
|
|
|
|
|
}
|
|
|
|
|
func (dst *FingerprintResponse) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_FingerprintResponse.Merge(dst, src)
|
|
|
|
|
}
|
|
|
|
|
func (m *FingerprintResponse) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_FingerprintResponse.Size(m)
|
|
|
|
|
}
|
|
|
|
|
func (m *FingerprintResponse) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_FingerprintResponse.DiscardUnknown(m)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var xxx_messageInfo_FingerprintResponse proto.InternalMessageInfo
|
|
|
|
|
|
|
|
|
|
func (m *FingerprintResponse) GetDeviceGroup() []*DeviceGroup {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.DeviceGroup
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeviceGroup is a group of devices that share a vendor, device type and name.
|
|
|
|
|
type DeviceGroup struct {
|
2018-08-07 19:49:37 +00:00
|
|
|
|
// vendor is the name of the vendor of the device
|
|
|
|
|
Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor,omitempty"`
|
|
|
|
|
// device_type is the type of the device (gpu, fpga, etc).
|
|
|
|
|
DeviceType string `protobuf:"bytes,2,opt,name=device_type,json=deviceType,proto3" json:"device_type,omitempty"`
|
|
|
|
|
// device_name is the name of the device.
|
|
|
|
|
DeviceName string `protobuf:"bytes,3,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"`
|
2018-08-07 05:27:47 +00:00
|
|
|
|
// devices is the set of devices detected by the plugin.
|
2018-08-07 19:49:37 +00:00
|
|
|
|
Devices []*DetectedDevice `protobuf:"bytes,4,rep,name=devices,proto3" json:"devices,omitempty"`
|
2018-08-13 17:29:29 +00:00
|
|
|
|
// attributes allows adding attributes to be used for constraints or
|
|
|
|
|
// affinities.
|
|
|
|
|
Attributes map[string]string `protobuf:"bytes,5,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
2018-08-07 05:27:47 +00:00
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-13 17:29:29 +00:00
|
|
|
|
func (m *DeviceGroup) Reset() { *m = DeviceGroup{} }
|
|
|
|
|
func (m *DeviceGroup) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*DeviceGroup) ProtoMessage() {}
|
|
|
|
|
func (*DeviceGroup) Descriptor() ([]byte, []int) {
|
2018-08-23 18:18:35 +00:00
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{2}
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-13 17:29:29 +00:00
|
|
|
|
func (m *DeviceGroup) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_DeviceGroup.Unmarshal(m, b)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-13 17:29:29 +00:00
|
|
|
|
func (m *DeviceGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_DeviceGroup.Marshal(b, m, deterministic)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-13 17:29:29 +00:00
|
|
|
|
func (dst *DeviceGroup) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_DeviceGroup.Merge(dst, src)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-13 17:29:29 +00:00
|
|
|
|
func (m *DeviceGroup) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_DeviceGroup.Size(m)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-13 17:29:29 +00:00
|
|
|
|
func (m *DeviceGroup) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_DeviceGroup.DiscardUnknown(m)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-08-13 17:29:29 +00:00
|
|
|
|
var xxx_messageInfo_DeviceGroup proto.InternalMessageInfo
|
2018-08-07 05:27:47 +00:00
|
|
|
|
|
2018-08-13 17:29:29 +00:00
|
|
|
|
func (m *DeviceGroup) GetVendor() string {
|
2018-08-07 19:49:37 +00:00
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Vendor
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-13 17:29:29 +00:00
|
|
|
|
func (m *DeviceGroup) GetDeviceType() string {
|
2018-08-07 19:49:37 +00:00
|
|
|
|
if m != nil {
|
|
|
|
|
return m.DeviceType
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-13 17:29:29 +00:00
|
|
|
|
func (m *DeviceGroup) GetDeviceName() string {
|
2018-08-07 05:27:47 +00:00
|
|
|
|
if m != nil {
|
|
|
|
|
return m.DeviceName
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-13 17:29:29 +00:00
|
|
|
|
func (m *DeviceGroup) GetDevices() []*DetectedDevice {
|
2018-08-07 05:27:47 +00:00
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Devices
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-13 17:29:29 +00:00
|
|
|
|
func (m *DeviceGroup) GetAttributes() map[string]string {
|
2018-08-07 05:27:47 +00:00
|
|
|
|
if m != nil {
|
2018-08-13 17:29:29 +00:00
|
|
|
|
return m.Attributes
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DetectedDevice is a single detected device.
|
|
|
|
|
type DetectedDevice struct {
|
2018-08-13 17:29:29 +00:00
|
|
|
|
// ID is the ID of the device. This ID is used during allocation and must be
|
|
|
|
|
// stable across restarts of the device driver.
|
2018-08-07 05:27:47 +00:00
|
|
|
|
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
|
|
|
|
|
// Health of the device.
|
|
|
|
|
Healthy bool `protobuf:"varint,2,opt,name=healthy,proto3" json:"healthy,omitempty"`
|
|
|
|
|
// health_description allows the device plugin to optionally
|
|
|
|
|
// annotate the health field with a human readable reason.
|
|
|
|
|
HealthDescription string `protobuf:"bytes,3,opt,name=health_description,json=healthDescription,proto3" json:"health_description,omitempty"`
|
2018-08-13 17:29:29 +00:00
|
|
|
|
// hw_locality is optionally set to expose hardware locality information for
|
|
|
|
|
// more optimal placement decisions.
|
|
|
|
|
HwLocality *DeviceLocality `protobuf:"bytes,4,opt,name=hw_locality,json=hwLocality,proto3" json:"hw_locality,omitempty"`
|
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *DetectedDevice) Reset() { *m = DetectedDevice{} }
|
|
|
|
|
func (m *DetectedDevice) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*DetectedDevice) ProtoMessage() {}
|
|
|
|
|
func (*DetectedDevice) Descriptor() ([]byte, []int) {
|
2018-08-23 18:18:35 +00:00
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{3}
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
func (m *DetectedDevice) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_DetectedDevice.Unmarshal(m, b)
|
|
|
|
|
}
|
|
|
|
|
func (m *DetectedDevice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_DetectedDevice.Marshal(b, m, deterministic)
|
|
|
|
|
}
|
|
|
|
|
func (dst *DetectedDevice) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_DetectedDevice.Merge(dst, src)
|
|
|
|
|
}
|
|
|
|
|
func (m *DetectedDevice) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_DetectedDevice.Size(m)
|
|
|
|
|
}
|
|
|
|
|
func (m *DetectedDevice) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_DetectedDevice.DiscardUnknown(m)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var xxx_messageInfo_DetectedDevice proto.InternalMessageInfo
|
|
|
|
|
|
|
|
|
|
func (m *DetectedDevice) GetID() string {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.ID
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *DetectedDevice) GetHealthy() bool {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Healthy
|
|
|
|
|
}
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *DetectedDevice) GetHealthDescription() string {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.HealthDescription
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-13 17:29:29 +00:00
|
|
|
|
func (m *DetectedDevice) GetHwLocality() *DeviceLocality {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.HwLocality
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeviceLocality is used to expose HW locality information about a device.
|
|
|
|
|
type DeviceLocality struct {
|
|
|
|
|
// pci_bus_id is the PCI bus ID for the device. If reported, it
|
|
|
|
|
// allows Nomad to make NUMA aware optimizations.
|
|
|
|
|
PciBusId string `protobuf:"bytes,1,opt,name=pci_bus_id,json=pciBusId,proto3" json:"pci_bus_id,omitempty"`
|
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *DeviceLocality) Reset() { *m = DeviceLocality{} }
|
|
|
|
|
func (m *DeviceLocality) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*DeviceLocality) ProtoMessage() {}
|
|
|
|
|
func (*DeviceLocality) Descriptor() ([]byte, []int) {
|
2018-08-23 18:18:35 +00:00
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{4}
|
2018-08-13 17:29:29 +00:00
|
|
|
|
}
|
|
|
|
|
func (m *DeviceLocality) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_DeviceLocality.Unmarshal(m, b)
|
|
|
|
|
}
|
|
|
|
|
func (m *DeviceLocality) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_DeviceLocality.Marshal(b, m, deterministic)
|
|
|
|
|
}
|
|
|
|
|
func (dst *DeviceLocality) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_DeviceLocality.Merge(dst, src)
|
|
|
|
|
}
|
|
|
|
|
func (m *DeviceLocality) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_DeviceLocality.Size(m)
|
|
|
|
|
}
|
|
|
|
|
func (m *DeviceLocality) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_DeviceLocality.DiscardUnknown(m)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var xxx_messageInfo_DeviceLocality proto.InternalMessageInfo
|
|
|
|
|
|
|
|
|
|
func (m *DeviceLocality) GetPciBusId() string {
|
2018-08-07 05:27:47 +00:00
|
|
|
|
if m != nil {
|
|
|
|
|
return m.PciBusId
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
// ReserveRequest is used to ask the device driver for information on
|
2018-08-07 05:27:47 +00:00
|
|
|
|
// how to allocate the requested devices.
|
2018-08-07 19:49:37 +00:00
|
|
|
|
type ReserveRequest struct {
|
2018-08-07 05:27:47 +00:00
|
|
|
|
// device_ids are the requested devices.
|
|
|
|
|
DeviceIds []string `protobuf:"bytes,1,rep,name=device_ids,json=deviceIds,proto3" json:"device_ids,omitempty"`
|
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ReserveRequest) Reset() { *m = ReserveRequest{} }
|
|
|
|
|
func (m *ReserveRequest) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*ReserveRequest) ProtoMessage() {}
|
|
|
|
|
func (*ReserveRequest) Descriptor() ([]byte, []int) {
|
2018-08-23 18:18:35 +00:00
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{5}
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ReserveRequest) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_ReserveRequest.Unmarshal(m, b)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ReserveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_ReserveRequest.Marshal(b, m, deterministic)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (dst *ReserveRequest) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_ReserveRequest.Merge(dst, src)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ReserveRequest) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_ReserveRequest.Size(m)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ReserveRequest) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_ReserveRequest.DiscardUnknown(m)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
var xxx_messageInfo_ReserveRequest proto.InternalMessageInfo
|
2018-08-07 05:27:47 +00:00
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ReserveRequest) GetDeviceIds() []string {
|
2018-08-07 05:27:47 +00:00
|
|
|
|
if m != nil {
|
|
|
|
|
return m.DeviceIds
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
// ReserveResponse informs Nomad how to expose the requested devices
|
2018-08-07 05:27:47 +00:00
|
|
|
|
// to the the task.
|
2018-08-07 19:49:37 +00:00
|
|
|
|
type ReserveResponse struct {
|
|
|
|
|
// container_res contains information on how to mount the device
|
2018-08-07 05:27:47 +00:00
|
|
|
|
// into a task isolated using container technologies (where the
|
|
|
|
|
// host is shared)
|
2018-08-07 19:49:37 +00:00
|
|
|
|
ContainerRes *ContainerReservation `protobuf:"bytes,1,opt,name=container_res,json=containerRes,proto3" json:"container_res,omitempty"`
|
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ReserveResponse) Reset() { *m = ReserveResponse{} }
|
|
|
|
|
func (m *ReserveResponse) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*ReserveResponse) ProtoMessage() {}
|
|
|
|
|
func (*ReserveResponse) Descriptor() ([]byte, []int) {
|
2018-08-23 18:18:35 +00:00
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{6}
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ReserveResponse) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_ReserveResponse.Unmarshal(m, b)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ReserveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_ReserveResponse.Marshal(b, m, deterministic)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (dst *ReserveResponse) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_ReserveResponse.Merge(dst, src)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ReserveResponse) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_ReserveResponse.Size(m)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ReserveResponse) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_ReserveResponse.DiscardUnknown(m)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
var xxx_messageInfo_ReserveResponse proto.InternalMessageInfo
|
2018-08-07 05:27:47 +00:00
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ReserveResponse) GetContainerRes() *ContainerReservation {
|
2018-08-07 05:27:47 +00:00
|
|
|
|
if m != nil {
|
2018-08-07 19:49:37 +00:00
|
|
|
|
return m.ContainerRes
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
// ContainerReservation returns how to mount the device into a
|
2018-08-07 05:27:47 +00:00
|
|
|
|
// container that shares the host OS.
|
2018-08-07 19:49:37 +00:00
|
|
|
|
type ContainerReservation struct {
|
2018-08-07 05:27:47 +00:00
|
|
|
|
// List of environment variable to be set
|
|
|
|
|
Envs map[string]string `protobuf:"bytes,1,rep,name=envs,proto3" json:"envs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
|
|
|
|
// Mounts for the task.
|
|
|
|
|
Mounts []*Mount `protobuf:"bytes,2,rep,name=mounts,proto3" json:"mounts,omitempty"`
|
|
|
|
|
// Devices for the task.
|
|
|
|
|
Devices []*DeviceSpec `protobuf:"bytes,3,rep,name=devices,proto3" json:"devices,omitempty"`
|
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ContainerReservation) Reset() { *m = ContainerReservation{} }
|
|
|
|
|
func (m *ContainerReservation) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*ContainerReservation) ProtoMessage() {}
|
|
|
|
|
func (*ContainerReservation) Descriptor() ([]byte, []int) {
|
2018-08-23 18:18:35 +00:00
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{7}
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ContainerReservation) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_ContainerReservation.Unmarshal(m, b)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ContainerReservation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_ContainerReservation.Marshal(b, m, deterministic)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (dst *ContainerReservation) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_ContainerReservation.Merge(dst, src)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ContainerReservation) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_ContainerReservation.Size(m)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ContainerReservation) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_ContainerReservation.DiscardUnknown(m)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
var xxx_messageInfo_ContainerReservation proto.InternalMessageInfo
|
2018-08-07 05:27:47 +00:00
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ContainerReservation) GetEnvs() map[string]string {
|
2018-08-07 05:27:47 +00:00
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Envs
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ContainerReservation) GetMounts() []*Mount {
|
2018-08-07 05:27:47 +00:00
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Mounts
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (m *ContainerReservation) GetDevices() []*DeviceSpec {
|
2018-08-07 05:27:47 +00:00
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Devices
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Mount specifies a host volume to mount into a task.
|
|
|
|
|
// where device library or tools are installed on host and task
|
|
|
|
|
type Mount struct {
|
|
|
|
|
// Path of the mount within the task.
|
|
|
|
|
TaskPath string `protobuf:"bytes,1,opt,name=task_path,json=taskPath,proto3" json:"task_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"`
|
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *Mount) Reset() { *m = Mount{} }
|
|
|
|
|
func (m *Mount) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*Mount) ProtoMessage() {}
|
|
|
|
|
func (*Mount) Descriptor() ([]byte, []int) {
|
2018-08-23 18:18:35 +00:00
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{8}
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
func (m *Mount) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_Mount.Unmarshal(m, b)
|
|
|
|
|
}
|
|
|
|
|
func (m *Mount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_Mount.Marshal(b, m, deterministic)
|
|
|
|
|
}
|
|
|
|
|
func (dst *Mount) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_Mount.Merge(dst, src)
|
|
|
|
|
}
|
|
|
|
|
func (m *Mount) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_Mount.Size(m)
|
|
|
|
|
}
|
|
|
|
|
func (m *Mount) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_Mount.DiscardUnknown(m)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var xxx_messageInfo_Mount proto.InternalMessageInfo
|
|
|
|
|
|
|
|
|
|
func (m *Mount) GetTaskPath() string {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.TaskPath
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *Mount) GetHostPath() string {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.HostPath
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *Mount) GetReadOnly() bool {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.ReadOnly
|
|
|
|
|
}
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeviceSpec specifies a host device to mount into a task.
|
|
|
|
|
type DeviceSpec struct {
|
|
|
|
|
// Path of the device within the task.
|
|
|
|
|
TaskPath string `protobuf:"bytes,1,opt,name=task_path,json=taskPath,proto3" json:"task_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 task to read from the specified device.
|
|
|
|
|
// * w - allows task to write to the specified device.
|
|
|
|
|
// * m - allows task to create device files that do not yet exist
|
|
|
|
|
Permissions string `protobuf:"bytes,3,opt,name=permissions,proto3" json:"permissions,omitempty"`
|
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *DeviceSpec) Reset() { *m = DeviceSpec{} }
|
|
|
|
|
func (m *DeviceSpec) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*DeviceSpec) ProtoMessage() {}
|
|
|
|
|
func (*DeviceSpec) Descriptor() ([]byte, []int) {
|
2018-08-23 18:18:35 +00:00
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{9}
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
func (m *DeviceSpec) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_DeviceSpec.Unmarshal(m, b)
|
|
|
|
|
}
|
|
|
|
|
func (m *DeviceSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_DeviceSpec.Marshal(b, m, deterministic)
|
|
|
|
|
}
|
|
|
|
|
func (dst *DeviceSpec) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_DeviceSpec.Merge(dst, src)
|
|
|
|
|
}
|
|
|
|
|
func (m *DeviceSpec) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_DeviceSpec.Size(m)
|
|
|
|
|
}
|
|
|
|
|
func (m *DeviceSpec) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_DeviceSpec.DiscardUnknown(m)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var xxx_messageInfo_DeviceSpec proto.InternalMessageInfo
|
|
|
|
|
|
|
|
|
|
func (m *DeviceSpec) GetTaskPath() string {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.TaskPath
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *DeviceSpec) GetHostPath() string {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.HostPath
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *DeviceSpec) GetPermissions() string {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Permissions
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-23 18:18:35 +00:00
|
|
|
|
// StatsRequest is used to parameterize the retrieval of statistics.
|
|
|
|
|
type StatsRequest struct {
|
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *StatsRequest) Reset() { *m = StatsRequest{} }
|
|
|
|
|
func (m *StatsRequest) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*StatsRequest) ProtoMessage() {}
|
|
|
|
|
func (*StatsRequest) Descriptor() ([]byte, []int) {
|
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{10}
|
|
|
|
|
}
|
|
|
|
|
func (m *StatsRequest) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_StatsRequest.Unmarshal(m, b)
|
|
|
|
|
}
|
|
|
|
|
func (m *StatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_StatsRequest.Marshal(b, m, deterministic)
|
|
|
|
|
}
|
|
|
|
|
func (dst *StatsRequest) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_StatsRequest.Merge(dst, src)
|
|
|
|
|
}
|
|
|
|
|
func (m *StatsRequest) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_StatsRequest.Size(m)
|
|
|
|
|
}
|
|
|
|
|
func (m *StatsRequest) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_StatsRequest.DiscardUnknown(m)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var xxx_messageInfo_StatsRequest proto.InternalMessageInfo
|
|
|
|
|
|
|
|
|
|
// StatsResponse returns the statistics for each device group.
|
|
|
|
|
type StatsResponse struct {
|
|
|
|
|
// groups contains statistics for each device group.
|
|
|
|
|
Groups []*DeviceGroupStats `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"`
|
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *StatsResponse) Reset() { *m = StatsResponse{} }
|
|
|
|
|
func (m *StatsResponse) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*StatsResponse) ProtoMessage() {}
|
|
|
|
|
func (*StatsResponse) Descriptor() ([]byte, []int) {
|
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{11}
|
|
|
|
|
}
|
|
|
|
|
func (m *StatsResponse) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_StatsResponse.Unmarshal(m, b)
|
|
|
|
|
}
|
|
|
|
|
func (m *StatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_StatsResponse.Marshal(b, m, deterministic)
|
|
|
|
|
}
|
|
|
|
|
func (dst *StatsResponse) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_StatsResponse.Merge(dst, src)
|
|
|
|
|
}
|
|
|
|
|
func (m *StatsResponse) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_StatsResponse.Size(m)
|
|
|
|
|
}
|
|
|
|
|
func (m *StatsResponse) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_StatsResponse.DiscardUnknown(m)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var xxx_messageInfo_StatsResponse proto.InternalMessageInfo
|
|
|
|
|
|
|
|
|
|
func (m *StatsResponse) GetGroups() []*DeviceGroupStats {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Groups
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeviceGroupStats contains statistics for each device of a particular
|
|
|
|
|
// device group, identified by the vendor, type and name of the device.
|
|
|
|
|
type DeviceGroupStats struct {
|
|
|
|
|
Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor,omitempty"`
|
|
|
|
|
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
|
|
|
|
|
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
|
|
|
|
// instance_stats is a mapping of each device ID to its statistics.
|
|
|
|
|
InstanceStats map[string]*DeviceStats `protobuf:"bytes,4,rep,name=instance_stats,json=instanceStats,proto3" json:"instance_stats,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *DeviceGroupStats) Reset() { *m = DeviceGroupStats{} }
|
|
|
|
|
func (m *DeviceGroupStats) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*DeviceGroupStats) ProtoMessage() {}
|
|
|
|
|
func (*DeviceGroupStats) Descriptor() ([]byte, []int) {
|
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{12}
|
|
|
|
|
}
|
|
|
|
|
func (m *DeviceGroupStats) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_DeviceGroupStats.Unmarshal(m, b)
|
|
|
|
|
}
|
|
|
|
|
func (m *DeviceGroupStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_DeviceGroupStats.Marshal(b, m, deterministic)
|
|
|
|
|
}
|
|
|
|
|
func (dst *DeviceGroupStats) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_DeviceGroupStats.Merge(dst, src)
|
|
|
|
|
}
|
|
|
|
|
func (m *DeviceGroupStats) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_DeviceGroupStats.Size(m)
|
|
|
|
|
}
|
|
|
|
|
func (m *DeviceGroupStats) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_DeviceGroupStats.DiscardUnknown(m)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var xxx_messageInfo_DeviceGroupStats proto.InternalMessageInfo
|
|
|
|
|
|
|
|
|
|
func (m *DeviceGroupStats) GetVendor() string {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Vendor
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *DeviceGroupStats) GetType() string {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Type
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *DeviceGroupStats) GetName() string {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Name
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *DeviceGroupStats) GetInstanceStats() map[string]*DeviceStats {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.InstanceStats
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeviceStats is the statistics for an individual device
|
|
|
|
|
type DeviceStats struct {
|
|
|
|
|
// summary exposes a single summary metric that should be the most
|
|
|
|
|
// informative to users.
|
|
|
|
|
Summary *StatValue `protobuf:"bytes,1,opt,name=summary,proto3" json:"summary,omitempty"`
|
|
|
|
|
// stats contains the verbose statistics for the device.
|
|
|
|
|
Stats *StatObject `protobuf:"bytes,2,opt,name=stats,proto3" json:"stats,omitempty"`
|
|
|
|
|
// timestamp is the time the statistics were collected.
|
|
|
|
|
Timestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
|
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *DeviceStats) Reset() { *m = DeviceStats{} }
|
|
|
|
|
func (m *DeviceStats) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*DeviceStats) ProtoMessage() {}
|
|
|
|
|
func (*DeviceStats) Descriptor() ([]byte, []int) {
|
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{13}
|
|
|
|
|
}
|
|
|
|
|
func (m *DeviceStats) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_DeviceStats.Unmarshal(m, b)
|
|
|
|
|
}
|
|
|
|
|
func (m *DeviceStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_DeviceStats.Marshal(b, m, deterministic)
|
|
|
|
|
}
|
|
|
|
|
func (dst *DeviceStats) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_DeviceStats.Merge(dst, src)
|
|
|
|
|
}
|
|
|
|
|
func (m *DeviceStats) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_DeviceStats.Size(m)
|
|
|
|
|
}
|
|
|
|
|
func (m *DeviceStats) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_DeviceStats.DiscardUnknown(m)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var xxx_messageInfo_DeviceStats proto.InternalMessageInfo
|
|
|
|
|
|
|
|
|
|
func (m *DeviceStats) GetSummary() *StatValue {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Summary
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *DeviceStats) GetStats() *StatObject {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Stats
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *DeviceStats) GetTimestamp() *timestamp.Timestamp {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Timestamp
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// StatObject is a collection of statistics either exposed at the top
|
|
|
|
|
// level or via nested StatObjects.
|
|
|
|
|
type StatObject struct {
|
|
|
|
|
// nested is a mapping of object name to a nested stats object.
|
|
|
|
|
Nested map[string]*StatObject `protobuf:"bytes,1,rep,name=nested,proto3" json:"nested,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
|
|
|
|
// attributes is a mapping of statistic name to its value.
|
|
|
|
|
Attributes map[string]*StatValue `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *StatObject) Reset() { *m = StatObject{} }
|
|
|
|
|
func (m *StatObject) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*StatObject) ProtoMessage() {}
|
|
|
|
|
func (*StatObject) Descriptor() ([]byte, []int) {
|
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{14}
|
|
|
|
|
}
|
|
|
|
|
func (m *StatObject) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_StatObject.Unmarshal(m, b)
|
|
|
|
|
}
|
|
|
|
|
func (m *StatObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_StatObject.Marshal(b, m, deterministic)
|
|
|
|
|
}
|
|
|
|
|
func (dst *StatObject) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_StatObject.Merge(dst, src)
|
|
|
|
|
}
|
|
|
|
|
func (m *StatObject) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_StatObject.Size(m)
|
|
|
|
|
}
|
|
|
|
|
func (m *StatObject) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_StatObject.DiscardUnknown(m)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var xxx_messageInfo_StatObject proto.InternalMessageInfo
|
|
|
|
|
|
|
|
|
|
func (m *StatObject) GetNested() map[string]*StatObject {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Nested
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *StatObject) GetAttributes() map[string]*StatValue {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Attributes
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// StatValue exposes the values of a particular statistic. The value may
|
|
|
|
|
// be of type double, integer, string or boolean. Numeric types can be
|
|
|
|
|
// exposed as a single value or as a fraction.
|
|
|
|
|
type StatValue struct {
|
|
|
|
|
// float_numerator_val exposes a floating point value. If denominator
|
|
|
|
|
// is set it is assumed to be a fractional value, otherwise it is a
|
|
|
|
|
// scalar.
|
|
|
|
|
FloatNumeratorVal float64 `protobuf:"fixed64,1,opt,name=float_numerator_val,json=floatNumeratorVal,proto3" json:"float_numerator_val,omitempty"`
|
|
|
|
|
FloatDenominatorVal float64 `protobuf:"fixed64,2,opt,name=float_denominator_val,json=floatDenominatorVal,proto3" json:"float_denominator_val,omitempty"`
|
|
|
|
|
// int_numerator_val exposes a int value. If denominator
|
|
|
|
|
// is set it is assumed to be a fractional value, otherwise it is a
|
|
|
|
|
// scalar.
|
|
|
|
|
IntNumeratorVal int64 `protobuf:"varint,3,opt,name=int_numerator_val,json=intNumeratorVal,proto3" json:"int_numerator_val,omitempty"`
|
|
|
|
|
IntDenominatorVal int64 `protobuf:"varint,4,opt,name=int_denominator_val,json=intDenominatorVal,proto3" json:"int_denominator_val,omitempty"`
|
|
|
|
|
// string_val exposes a string value. These are likely annotations.
|
|
|
|
|
StringVal string `protobuf:"bytes,5,opt,name=string_val,json=stringVal,proto3" json:"string_val,omitempty"`
|
|
|
|
|
// bool_val exposes a boolean statistic.
|
|
|
|
|
BoolVal bool `protobuf:"varint,6,opt,name=bool_val,json=boolVal,proto3" json:"bool_val,omitempty"`
|
|
|
|
|
// unit gives the unit type: °F, %, MHz, MB, etc.
|
|
|
|
|
Unit string `protobuf:"bytes,7,opt,name=unit,proto3" json:"unit,omitempty"`
|
|
|
|
|
// desc provides a human readable description of the statistic.
|
|
|
|
|
Desc string `protobuf:"bytes,8,opt,name=desc,proto3" json:"desc,omitempty"`
|
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *StatValue) Reset() { *m = StatValue{} }
|
|
|
|
|
func (m *StatValue) String() string { return proto.CompactTextString(m) }
|
|
|
|
|
func (*StatValue) ProtoMessage() {}
|
|
|
|
|
func (*StatValue) Descriptor() ([]byte, []int) {
|
|
|
|
|
return fileDescriptor_device_ebefe60214c28313, []int{15}
|
|
|
|
|
}
|
|
|
|
|
func (m *StatValue) XXX_Unmarshal(b []byte) error {
|
|
|
|
|
return xxx_messageInfo_StatValue.Unmarshal(m, b)
|
|
|
|
|
}
|
|
|
|
|
func (m *StatValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
|
return xxx_messageInfo_StatValue.Marshal(b, m, deterministic)
|
|
|
|
|
}
|
|
|
|
|
func (dst *StatValue) XXX_Merge(src proto.Message) {
|
|
|
|
|
xxx_messageInfo_StatValue.Merge(dst, src)
|
|
|
|
|
}
|
|
|
|
|
func (m *StatValue) XXX_Size() int {
|
|
|
|
|
return xxx_messageInfo_StatValue.Size(m)
|
|
|
|
|
}
|
|
|
|
|
func (m *StatValue) XXX_DiscardUnknown() {
|
|
|
|
|
xxx_messageInfo_StatValue.DiscardUnknown(m)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var xxx_messageInfo_StatValue proto.InternalMessageInfo
|
|
|
|
|
|
|
|
|
|
func (m *StatValue) GetFloatNumeratorVal() float64 {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.FloatNumeratorVal
|
|
|
|
|
}
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *StatValue) GetFloatDenominatorVal() float64 {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.FloatDenominatorVal
|
|
|
|
|
}
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *StatValue) GetIntNumeratorVal() int64 {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.IntNumeratorVal
|
|
|
|
|
}
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *StatValue) GetIntDenominatorVal() int64 {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.IntDenominatorVal
|
|
|
|
|
}
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *StatValue) GetStringVal() string {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.StringVal
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *StatValue) GetBoolVal() bool {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.BoolVal
|
|
|
|
|
}
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *StatValue) GetUnit() string {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Unit
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (m *StatValue) GetDesc() string {
|
|
|
|
|
if m != nil {
|
|
|
|
|
return m.Desc
|
|
|
|
|
}
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 05:27:47 +00:00
|
|
|
|
func init() {
|
2018-08-13 17:29:29 +00:00
|
|
|
|
proto.RegisterType((*FingerprintRequest)(nil), "hashicorp.nomad.plugins.device.FingerprintRequest")
|
|
|
|
|
proto.RegisterType((*FingerprintResponse)(nil), "hashicorp.nomad.plugins.device.FingerprintResponse")
|
|
|
|
|
proto.RegisterType((*DeviceGroup)(nil), "hashicorp.nomad.plugins.device.DeviceGroup")
|
|
|
|
|
proto.RegisterMapType((map[string]string)(nil), "hashicorp.nomad.plugins.device.DeviceGroup.AttributesEntry")
|
2018-08-07 05:27:47 +00:00
|
|
|
|
proto.RegisterType((*DetectedDevice)(nil), "hashicorp.nomad.plugins.device.DetectedDevice")
|
2018-08-13 17:29:29 +00:00
|
|
|
|
proto.RegisterType((*DeviceLocality)(nil), "hashicorp.nomad.plugins.device.DeviceLocality")
|
2018-08-07 19:49:37 +00:00
|
|
|
|
proto.RegisterType((*ReserveRequest)(nil), "hashicorp.nomad.plugins.device.ReserveRequest")
|
|
|
|
|
proto.RegisterType((*ReserveResponse)(nil), "hashicorp.nomad.plugins.device.ReserveResponse")
|
|
|
|
|
proto.RegisterType((*ContainerReservation)(nil), "hashicorp.nomad.plugins.device.ContainerReservation")
|
|
|
|
|
proto.RegisterMapType((map[string]string)(nil), "hashicorp.nomad.plugins.device.ContainerReservation.EnvsEntry")
|
2018-08-07 05:27:47 +00:00
|
|
|
|
proto.RegisterType((*Mount)(nil), "hashicorp.nomad.plugins.device.Mount")
|
|
|
|
|
proto.RegisterType((*DeviceSpec)(nil), "hashicorp.nomad.plugins.device.DeviceSpec")
|
2018-08-23 18:18:35 +00:00
|
|
|
|
proto.RegisterType((*StatsRequest)(nil), "hashicorp.nomad.plugins.device.StatsRequest")
|
|
|
|
|
proto.RegisterType((*StatsResponse)(nil), "hashicorp.nomad.plugins.device.StatsResponse")
|
|
|
|
|
proto.RegisterType((*DeviceGroupStats)(nil), "hashicorp.nomad.plugins.device.DeviceGroupStats")
|
|
|
|
|
proto.RegisterMapType((map[string]*DeviceStats)(nil), "hashicorp.nomad.plugins.device.DeviceGroupStats.InstanceStatsEntry")
|
|
|
|
|
proto.RegisterType((*DeviceStats)(nil), "hashicorp.nomad.plugins.device.DeviceStats")
|
|
|
|
|
proto.RegisterType((*StatObject)(nil), "hashicorp.nomad.plugins.device.StatObject")
|
|
|
|
|
proto.RegisterMapType((map[string]*StatValue)(nil), "hashicorp.nomad.plugins.device.StatObject.AttributesEntry")
|
|
|
|
|
proto.RegisterMapType((map[string]*StatObject)(nil), "hashicorp.nomad.plugins.device.StatObject.NestedEntry")
|
|
|
|
|
proto.RegisterType((*StatValue)(nil), "hashicorp.nomad.plugins.device.StatValue")
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
|
|
|
var _ context.Context
|
|
|
|
|
var _ grpc.ClientConn
|
|
|
|
|
|
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
|
|
|
// is compatible with the grpc package it is being compiled against.
|
|
|
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
|
|
|
|
|
|
// DevicePluginClient is the client API for DevicePlugin service.
|
|
|
|
|
//
|
|
|
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
|
|
|
type DevicePluginClient interface {
|
2018-08-07 19:49:37 +00:00
|
|
|
|
// Fingerprint allows the device plugin to return a set of
|
2018-08-07 05:27:47 +00:00
|
|
|
|
// detected devices and provide a mechanism to update the state of
|
|
|
|
|
// the device.
|
2018-08-13 17:29:29 +00:00
|
|
|
|
Fingerprint(ctx context.Context, in *FingerprintRequest, opts ...grpc.CallOption) (DevicePlugin_FingerprintClient, error)
|
2018-08-07 19:49:37 +00:00
|
|
|
|
// Reserve is called by the client before starting an allocation
|
2018-08-07 05:27:47 +00:00
|
|
|
|
// that requires access to the plugin’s devices. The plugin can use
|
|
|
|
|
// this to run any setup steps and provides the mounting details to
|
|
|
|
|
// the Nomad client
|
2018-08-07 19:49:37 +00:00
|
|
|
|
Reserve(ctx context.Context, in *ReserveRequest, opts ...grpc.CallOption) (*ReserveResponse, error)
|
2018-08-23 18:18:35 +00:00
|
|
|
|
// Stats returns a stream of device statistics.
|
|
|
|
|
Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (DevicePlugin_StatsClient, error)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type devicePluginClient struct {
|
|
|
|
|
cc *grpc.ClientConn
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewDevicePluginClient(cc *grpc.ClientConn) DevicePluginClient {
|
|
|
|
|
return &devicePluginClient{cc}
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-13 17:29:29 +00:00
|
|
|
|
func (c *devicePluginClient) Fingerprint(ctx context.Context, in *FingerprintRequest, opts ...grpc.CallOption) (DevicePlugin_FingerprintClient, error) {
|
2018-08-07 19:49:37 +00:00
|
|
|
|
stream, err := c.cc.NewStream(ctx, &_DevicePlugin_serviceDesc.Streams[0], "/hashicorp.nomad.plugins.device.DevicePlugin/Fingerprint", opts...)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
x := &devicePluginFingerprintClient{stream}
|
2018-08-07 05:27:47 +00:00
|
|
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return x, nil
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
type DevicePlugin_FingerprintClient interface {
|
2018-08-13 17:29:29 +00:00
|
|
|
|
Recv() (*FingerprintResponse, error)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
grpc.ClientStream
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
type devicePluginFingerprintClient struct {
|
2018-08-07 05:27:47 +00:00
|
|
|
|
grpc.ClientStream
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-13 17:29:29 +00:00
|
|
|
|
func (x *devicePluginFingerprintClient) Recv() (*FingerprintResponse, error) {
|
|
|
|
|
m := new(FingerprintResponse)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return m, nil
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func (c *devicePluginClient) Reserve(ctx context.Context, in *ReserveRequest, opts ...grpc.CallOption) (*ReserveResponse, error) {
|
|
|
|
|
out := new(ReserveResponse)
|
|
|
|
|
err := c.cc.Invoke(ctx, "/hashicorp.nomad.plugins.device.DevicePlugin/Reserve", in, out, opts...)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return out, nil
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-23 18:18:35 +00:00
|
|
|
|
func (c *devicePluginClient) Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (DevicePlugin_StatsClient, error) {
|
|
|
|
|
stream, err := c.cc.NewStream(ctx, &_DevicePlugin_serviceDesc.Streams[1], "/hashicorp.nomad.plugins.device.DevicePlugin/Stats", opts...)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
x := &devicePluginStatsClient{stream}
|
|
|
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return x, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type DevicePlugin_StatsClient interface {
|
|
|
|
|
Recv() (*StatsResponse, error)
|
|
|
|
|
grpc.ClientStream
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type devicePluginStatsClient struct {
|
|
|
|
|
grpc.ClientStream
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (x *devicePluginStatsClient) Recv() (*StatsResponse, error) {
|
|
|
|
|
m := new(StatsResponse)
|
|
|
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return m, nil
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 05:27:47 +00:00
|
|
|
|
// DevicePluginServer is the server API for DevicePlugin service.
|
|
|
|
|
type DevicePluginServer interface {
|
2018-08-07 19:49:37 +00:00
|
|
|
|
// Fingerprint allows the device plugin to return a set of
|
2018-08-07 05:27:47 +00:00
|
|
|
|
// detected devices and provide a mechanism to update the state of
|
|
|
|
|
// the device.
|
2018-08-13 17:29:29 +00:00
|
|
|
|
Fingerprint(*FingerprintRequest, DevicePlugin_FingerprintServer) error
|
2018-08-07 19:49:37 +00:00
|
|
|
|
// Reserve is called by the client before starting an allocation
|
2018-08-07 05:27:47 +00:00
|
|
|
|
// that requires access to the plugin’s devices. The plugin can use
|
|
|
|
|
// this to run any setup steps and provides the mounting details to
|
|
|
|
|
// the Nomad client
|
2018-08-07 19:49:37 +00:00
|
|
|
|
Reserve(context.Context, *ReserveRequest) (*ReserveResponse, error)
|
2018-08-23 18:18:35 +00:00
|
|
|
|
// Stats returns a stream of device statistics.
|
|
|
|
|
Stats(*StatsRequest, DevicePlugin_StatsServer) error
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func RegisterDevicePluginServer(s *grpc.Server, srv DevicePluginServer) {
|
|
|
|
|
s.RegisterService(&_DevicePlugin_serviceDesc, srv)
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func _DevicePlugin_Fingerprint_Handler(srv interface{}, stream grpc.ServerStream) error {
|
2018-08-13 17:29:29 +00:00
|
|
|
|
m := new(FingerprintRequest)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
2018-08-07 19:49:37 +00:00
|
|
|
|
return srv.(DevicePluginServer).Fingerprint(m, &devicePluginFingerprintServer{stream})
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
type DevicePlugin_FingerprintServer interface {
|
2018-08-13 17:29:29 +00:00
|
|
|
|
Send(*FingerprintResponse) error
|
2018-08-07 05:27:47 +00:00
|
|
|
|
grpc.ServerStream
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
type devicePluginFingerprintServer struct {
|
2018-08-07 05:27:47 +00:00
|
|
|
|
grpc.ServerStream
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-13 17:29:29 +00:00
|
|
|
|
func (x *devicePluginFingerprintServer) Send(m *FingerprintResponse) error {
|
2018-08-07 05:27:47 +00:00
|
|
|
|
return x.ServerStream.SendMsg(m)
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 19:49:37 +00:00
|
|
|
|
func _DevicePlugin_Reserve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
|
|
in := new(ReserveRequest)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
if err := dec(in); err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
if interceptor == nil {
|
2018-08-07 19:49:37 +00:00
|
|
|
|
return srv.(DevicePluginServer).Reserve(ctx, in)
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
info := &grpc.UnaryServerInfo{
|
|
|
|
|
Server: srv,
|
2018-08-07 19:49:37 +00:00
|
|
|
|
FullMethod: "/hashicorp.nomad.plugins.device.DevicePlugin/Reserve",
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
2018-08-07 19:49:37 +00:00
|
|
|
|
return srv.(DevicePluginServer).Reserve(ctx, req.(*ReserveRequest))
|
2018-08-07 05:27:47 +00:00
|
|
|
|
}
|
|
|
|
|
return interceptor(ctx, in, info, handler)
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-23 18:18:35 +00:00
|
|
|
|
func _DevicePlugin_Stats_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
|
|
|
m := new(StatsRequest)
|
|
|
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
return srv.(DevicePluginServer).Stats(m, &devicePluginStatsServer{stream})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type DevicePlugin_StatsServer interface {
|
|
|
|
|
Send(*StatsResponse) error
|
|
|
|
|
grpc.ServerStream
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type devicePluginStatsServer struct {
|
|
|
|
|
grpc.ServerStream
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (x *devicePluginStatsServer) Send(m *StatsResponse) error {
|
|
|
|
|
return x.ServerStream.SendMsg(m)
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 05:27:47 +00:00
|
|
|
|
var _DevicePlugin_serviceDesc = grpc.ServiceDesc{
|
|
|
|
|
ServiceName: "hashicorp.nomad.plugins.device.DevicePlugin",
|
|
|
|
|
HandlerType: (*DevicePluginServer)(nil),
|
|
|
|
|
Methods: []grpc.MethodDesc{
|
|
|
|
|
{
|
2018-08-07 19:49:37 +00:00
|
|
|
|
MethodName: "Reserve",
|
|
|
|
|
Handler: _DevicePlugin_Reserve_Handler,
|
2018-08-07 05:27:47 +00:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
Streams: []grpc.StreamDesc{
|
|
|
|
|
{
|
2018-08-07 19:49:37 +00:00
|
|
|
|
StreamName: "Fingerprint",
|
|
|
|
|
Handler: _DevicePlugin_Fingerprint_Handler,
|
2018-08-07 05:27:47 +00:00
|
|
|
|
ServerStreams: true,
|
|
|
|
|
},
|
2018-08-23 18:18:35 +00:00
|
|
|
|
{
|
|
|
|
|
StreamName: "Stats",
|
|
|
|
|
Handler: _DevicePlugin_Stats_Handler,
|
|
|
|
|
ServerStreams: true,
|
|
|
|
|
},
|
2018-08-07 05:27:47 +00:00
|
|
|
|
},
|
2018-08-13 17:29:29 +00:00
|
|
|
|
Metadata: "github.com/hashicorp/nomad/plugins/device/proto/device.proto",
|
2018-08-09 20:29:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
2018-08-23 18:18:35 +00:00
|
|
|
|
proto.RegisterFile("github.com/hashicorp/nomad/plugins/device/proto/device.proto", fileDescriptor_device_ebefe60214c28313)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var fileDescriptor_device_ebefe60214c28313 = []byte{
|
|
|
|
|
// 1086 bytes of a gzipped FileDescriptorProto
|
|
|
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xeb, 0x8e, 0xdb, 0x44,
|
|
|
|
|
0x14, 0x26, 0xf7, 0xe4, 0x64, 0x2f, 0xdd, 0xd9, 0x05, 0x85, 0x40, 0xe9, 0xca, 0x12, 0x52, 0x59,
|
|
|
|
|
0xa8, 0x53, 0xa5, 0x08, 0xaa, 0x42, 0xa1, 0xed, 0xa6, 0xd0, 0x95, 0x60, 0xb7, 0x72, 0xab, 0x4a,
|
|
|
|
|
0x2d, 0x12, 0xd6, 0xc4, 0x9e, 0xc6, 0xd3, 0xda, 0x33, 0xc6, 0x33, 0x4e, 0x15, 0xde, 0x80, 0x37,
|
|
|
|
|
0xe1, 0x4f, 0x5f, 0x80, 0x77, 0x80, 0x87, 0xe0, 0x49, 0xd0, 0x5c, 0x9c, 0x38, 0xdb, 0xa5, 0x49,
|
|
|
|
|
0xe0, 0x97, 0xe7, 0x5c, 0xbe, 0x6f, 0x8e, 0xcf, 0x39, 0x73, 0x66, 0xe0, 0xeb, 0x09, 0x95, 0x51,
|
|
|
|
|
0x3e, 0x76, 0x03, 0x9e, 0x0c, 0x22, 0x2c, 0x22, 0x1a, 0xf0, 0x2c, 0x1d, 0x30, 0x9e, 0xe0, 0x70,
|
|
|
|
|
0x90, 0xc6, 0xf9, 0x84, 0x32, 0x31, 0x08, 0xc9, 0x94, 0x06, 0x64, 0x90, 0x66, 0x5c, 0x72, 0x2b,
|
|
|
|
|
0xb8, 0x5a, 0x40, 0x1f, 0xcd, 0x21, 0xae, 0x86, 0xb8, 0x16, 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