diff --git a/buf.work.yaml b/buf.work.yaml index 2c2d588d..275550ea 100644 --- a/buf.work.yaml +++ b/buf.work.yaml @@ -4,3 +4,4 @@ directories: - proto/provider - vendor/github.com/cosmos/cosmos-sdk/proto - vendor/github.com/cosmos/cosmos-sdk/third_party/proto + - vendor/k8s.io/apimachinery/pkg/api/resource diff --git a/go/inventory/v1/cluster.pb.go b/go/inventory/v1/cluster.pb.go new file mode 100644 index 00000000..ee4c22af --- /dev/null +++ b/go/inventory/v1/cluster.pb.go @@ -0,0 +1,398 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: akash/inventory/v1/cluster.proto + +package v1 + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Cluster struct { + Nodes Nodes `protobuf:"bytes,1,rep,name=nodes,proto3,castrepeated=Nodes" json:"nodes" yaml:"nodes"` + Storage ClusterStorage `protobuf:"bytes,2,rep,name=storage,proto3,castrepeated=ClusterStorage" json:"storage" yaml:"storage"` +} + +func (m *Cluster) Reset() { *m = Cluster{} } +func (m *Cluster) String() string { return proto.CompactTextString(m) } +func (*Cluster) ProtoMessage() {} +func (*Cluster) Descriptor() ([]byte, []int) { + return fileDescriptor_205585ebfe7f68ce, []int{0} +} +func (m *Cluster) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Cluster) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Cluster.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Cluster) XXX_Merge(src proto.Message) { + xxx_messageInfo_Cluster.Merge(m, src) +} +func (m *Cluster) XXX_Size() int { + return m.Size() +} +func (m *Cluster) XXX_DiscardUnknown() { + xxx_messageInfo_Cluster.DiscardUnknown(m) +} + +var xxx_messageInfo_Cluster proto.InternalMessageInfo + +func (m *Cluster) GetNodes() Nodes { + if m != nil { + return m.Nodes + } + return nil +} + +func (m *Cluster) GetStorage() ClusterStorage { + if m != nil { + return m.Storage + } + return nil +} + +func init() { + proto.RegisterType((*Cluster)(nil), "akash.inventory.v1.Cluster") +} + +func init() { proto.RegisterFile("akash/inventory/v1/cluster.proto", fileDescriptor_205585ebfe7f68ce) } + +var fileDescriptor_205585ebfe7f68ce = []byte{ + // 309 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xcc, 0x4e, 0x2c, + 0xce, 0xd0, 0xcf, 0xcc, 0x2b, 0x4b, 0xcd, 0x2b, 0xc9, 0x2f, 0xaa, 0xd4, 0x2f, 0x33, 0xd4, 0x4f, + 0xce, 0x29, 0x2d, 0x2e, 0x49, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x02, 0xab, + 0xd0, 0x83, 0xab, 0xd0, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xeb, 0x83, + 0x58, 0x10, 0x95, 0x52, 0xb2, 0x58, 0xcc, 0xca, 0xcb, 0x4f, 0x49, 0x85, 0x4a, 0xab, 0x62, 0x91, + 0x2e, 0x4a, 0x2d, 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0x2d, 0x48, 0xcc, 0x84, 0xda, 0x27, 0x85, 0xcd, + 0x45, 0xc5, 0x25, 0xf9, 0x45, 0x89, 0xe9, 0x50, 0x83, 0x94, 0x9e, 0x33, 0x72, 0xb1, 0x3b, 0x43, + 0xdc, 0x28, 0x14, 0xcf, 0xc5, 0x0a, 0xb2, 0xa2, 0x58, 0x82, 0x51, 0x81, 0x59, 0x83, 0xdb, 0x48, + 0x42, 0x0f, 0xd3, 0xb5, 0x7a, 0x7e, 0xf9, 0x29, 0xa9, 0x4e, 0xfa, 0x27, 0xee, 0xc9, 0x33, 0x3c, + 0xba, 0x27, 0xcf, 0x0a, 0xe2, 0x15, 0xbf, 0xba, 0x27, 0x0f, 0xd1, 0xf7, 0xe9, 0x9e, 0x3c, 0x4f, + 0x65, 0x62, 0x6e, 0x8e, 0x95, 0x12, 0x98, 0xab, 0xb4, 0xea, 0x3e, 0x54, 0x45, 0x10, 0x44, 0x5e, + 0xa8, 0x94, 0x8b, 0x1d, 0x6a, 0xbb, 0x04, 0x13, 0xd8, 0x0a, 0x69, 0x6c, 0x56, 0x04, 0x43, 0x94, + 0x38, 0xd9, 0x41, 0x6d, 0x61, 0x87, 0x0a, 0xbc, 0xba, 0x27, 0x0f, 0xd3, 0xfe, 0xe9, 0x9e, 0x3c, + 0x1f, 0xc4, 0x26, 0xa8, 0x00, 0xc8, 0x2e, 0x3e, 0xa8, 0x3f, 0xa0, 0xca, 0x83, 0x60, 0x8a, 0xad, + 0x58, 0x5e, 0x2c, 0x90, 0x67, 0x70, 0xf2, 0x39, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, + 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, + 0x86, 0x28, 0xa3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xb0, 0x7b, + 0x74, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xa1, 0xbc, 0xc4, 0x82, 0x4c, 0xfd, 0xf4, 0x7c, + 0x94, 0x50, 0x4c, 0x62, 0x03, 0x07, 0x9f, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x54, 0xea, + 0xeb, 0xf4, 0x01, 0x00, 0x00, +} + +func (m *Cluster) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Cluster) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Cluster) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Storage) > 0 { + for iNdEx := len(m.Storage) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Storage[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCluster(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Nodes) > 0 { + for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCluster(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintCluster(dAtA []byte, offset int, v uint64) int { + offset -= sovCluster(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Cluster) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Nodes) > 0 { + for _, e := range m.Nodes { + l = e.Size() + n += 1 + l + sovCluster(uint64(l)) + } + } + if len(m.Storage) > 0 { + for _, e := range m.Storage { + l = e.Size() + n += 1 + l + sovCluster(uint64(l)) + } + } + return n +} + +func sovCluster(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCluster(x uint64) (n int) { + return sovCluster(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Cluster) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCluster + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Cluster: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Cluster: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCluster + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCluster + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCluster + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Nodes = append(m.Nodes, Node{}) + if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Storage", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCluster + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCluster + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCluster + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Storage = append(m.Storage, Storage{}) + if err := m.Storage[len(m.Storage)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCluster(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCluster + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCluster(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCluster + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCluster + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCluster + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthCluster + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCluster + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthCluster + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthCluster = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCluster = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCluster = fmt.Errorf("proto: unexpected end of group") +) diff --git a/go/inventory/v1/cpu.pb.go b/go/inventory/v1/cpu.pb.go new file mode 100644 index 00000000..04ea62c0 --- /dev/null +++ b/go/inventory/v1/cpu.pb.go @@ -0,0 +1,703 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: akash/inventory/v1/cpu.proto + +package v1 + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/golang/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// 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.ProtoPackageIsVersion3 // please upgrade the proto package + +type CPUInfo struct { + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" yaml:"id"` + Vendor string `protobuf:"bytes,2,opt,name=vendor,proto3" json:"vendor" yaml:"vendor"` + Model string `protobuf:"bytes,3,opt,name=model,proto3" json:"model" yaml:"model"` + Vcores uint32 `protobuf:"varint,4,opt,name=vcores,proto3" json:"vcores" yaml:"vcores"` +} + +func (m *CPUInfo) Reset() { *m = CPUInfo{} } +func (m *CPUInfo) String() string { return proto.CompactTextString(m) } +func (*CPUInfo) ProtoMessage() {} +func (*CPUInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ed2b8a0bd798e5a3, []int{0} +} +func (m *CPUInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CPUInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CPUInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CPUInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_CPUInfo.Merge(m, src) +} +func (m *CPUInfo) XXX_Size() int { + return m.Size() +} +func (m *CPUInfo) XXX_DiscardUnknown() { + xxx_messageInfo_CPUInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_CPUInfo proto.InternalMessageInfo + +func (m *CPUInfo) GetID() string { + if m != nil { + return m.ID + } + return "" +} + +func (m *CPUInfo) GetVendor() string { + if m != nil { + return m.Vendor + } + return "" +} + +func (m *CPUInfo) GetModel() string { + if m != nil { + return m.Model + } + return "" +} + +func (m *CPUInfo) GetVcores() uint32 { + if m != nil { + return m.Vcores + } + return 0 +} + +type CPU struct { + Quantity ResourcePair `protobuf:"bytes,1,opt,name=quantity,proto3" json:"quantity" yaml:"quantity"` + Info []CPUInfo `protobuf:"bytes,2,rep,name=info,proto3" json:"info" yaml:"info"` +} + +func (m *CPU) Reset() { *m = CPU{} } +func (m *CPU) String() string { return proto.CompactTextString(m) } +func (*CPU) ProtoMessage() {} +func (*CPU) Descriptor() ([]byte, []int) { + return fileDescriptor_ed2b8a0bd798e5a3, []int{1} +} +func (m *CPU) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CPU) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CPU.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CPU) XXX_Merge(src proto.Message) { + xxx_messageInfo_CPU.Merge(m, src) +} +func (m *CPU) XXX_Size() int { + return m.Size() +} +func (m *CPU) XXX_DiscardUnknown() { + xxx_messageInfo_CPU.DiscardUnknown(m) +} + +var xxx_messageInfo_CPU proto.InternalMessageInfo + +func (m *CPU) GetQuantity() ResourcePair { + if m != nil { + return m.Quantity + } + return ResourcePair{} +} + +func (m *CPU) GetInfo() []CPUInfo { + if m != nil { + return m.Info + } + return nil +} + +func init() { + proto.RegisterType((*CPUInfo)(nil), "akash.inventory.v1.CPUInfo") + proto.RegisterType((*CPU)(nil), "akash.inventory.v1.CPU") +} + +func init() { proto.RegisterFile("akash/inventory/v1/cpu.proto", fileDescriptor_ed2b8a0bd798e5a3) } + +var fileDescriptor_ed2b8a0bd798e5a3 = []byte{ + // 424 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x31, 0x6f, 0xd4, 0x30, + 0x1c, 0xc5, 0xe3, 0xdc, 0xf5, 0x68, 0x7d, 0x54, 0x48, 0x11, 0x43, 0x28, 0x28, 0x3e, 0x19, 0x55, + 0x3a, 0x06, 0x12, 0xf5, 0x58, 0x10, 0x12, 0xcb, 0x95, 0xa5, 0x03, 0xd2, 0x11, 0x51, 0x06, 0xb6, + 0x34, 0xc9, 0xa5, 0x56, 0x1b, 0x3b, 0xf8, 0x92, 0xa0, 0xfb, 0x16, 0x8c, 0x7c, 0xa4, 0x8a, 0xa9, + 0x23, 0x93, 0x85, 0x92, 0x2d, 0x62, 0xca, 0x27, 0x40, 0xf9, 0xdb, 0x9c, 0x40, 0xed, 0xf6, 0x7f, + 0xef, 0xfd, 0x5f, 0x7e, 0x8a, 0x6d, 0xfc, 0x2c, 0xba, 0x8a, 0x36, 0x97, 0x01, 0xe3, 0x75, 0xca, + 0x4b, 0x21, 0xb7, 0x41, 0x7d, 0x12, 0xc4, 0x45, 0xe5, 0x17, 0x52, 0x94, 0xc2, 0x71, 0x20, 0xf5, + 0x77, 0xa9, 0x5f, 0x9f, 0x1c, 0x3d, 0xce, 0x44, 0x26, 0x20, 0x0e, 0x86, 0x49, 0x6f, 0x1e, 0x1d, + 0xdf, 0xf3, 0x1d, 0x99, 0x6e, 0x44, 0x25, 0xe3, 0xb4, 0x88, 0x98, 0xd4, 0x6b, 0xf4, 0x37, 0xc2, + 0x0f, 0x4e, 0x57, 0xe7, 0x67, 0x7c, 0x2d, 0x9c, 0x17, 0xd8, 0x66, 0x89, 0x8b, 0x66, 0x68, 0x7e, + 0xb0, 0x7c, 0xd2, 0x28, 0x62, 0x9f, 0xbd, 0xeb, 0x14, 0xb1, 0x59, 0xd2, 0x2b, 0x72, 0xb0, 0x8d, + 0xf2, 0xeb, 0x37, 0x94, 0x25, 0x34, 0xb4, 0x59, 0xe2, 0xbc, 0xc5, 0x93, 0x3a, 0xe5, 0x89, 0x90, + 0xae, 0x0d, 0xeb, 0xc7, 0x8d, 0x22, 0x93, 0x4f, 0xe0, 0x74, 0x8a, 0x98, 0xac, 0x57, 0xe4, 0x50, + 0xd7, 0xb4, 0xa6, 0xa1, 0x09, 0x9c, 0xd7, 0x78, 0x2f, 0x17, 0x49, 0x7a, 0xed, 0x8e, 0xa0, 0x4d, + 0x1b, 0x45, 0xf6, 0xde, 0x0f, 0x46, 0xa7, 0x88, 0x4e, 0x7a, 0x45, 0x1e, 0xea, 0x2e, 0x48, 0x1a, + 0x6a, 0x1b, 0xc0, 0xb1, 0x90, 0xe9, 0xc6, 0x1d, 0xcf, 0xd0, 0xfc, 0xd0, 0x80, 0xc1, 0x01, 0x30, + 0x4c, 0xff, 0x80, 0x41, 0x0f, 0x60, 0x3d, 0xfc, 0x40, 0x78, 0x74, 0xba, 0x3a, 0x77, 0x72, 0xbc, + 0xff, 0xa5, 0x8a, 0x78, 0xc9, 0xca, 0x2d, 0xfc, 0xf0, 0x74, 0x31, 0xf3, 0xef, 0x1e, 0xad, 0x1f, + 0x9a, 0x03, 0x5b, 0x45, 0x4c, 0x2e, 0x83, 0x1b, 0x45, 0xac, 0x46, 0x91, 0xfd, 0x0f, 0xa6, 0xd9, + 0x29, 0xb2, 0xfb, 0x4a, 0xaf, 0xc8, 0x23, 0x8d, 0xfc, 0xeb, 0xd0, 0x70, 0x17, 0x3a, 0x1f, 0xf1, + 0x98, 0xf1, 0xb5, 0x70, 0xed, 0xd9, 0x68, 0x3e, 0x5d, 0x3c, 0xbd, 0x0f, 0x65, 0x2e, 0x61, 0xf9, + 0xdc, 0x50, 0xc6, 0x83, 0xea, 0x14, 0x81, 0x62, 0xaf, 0xc8, 0xd4, 0x5c, 0x00, 0x5f, 0x0b, 0x1a, + 0x82, 0xb9, 0x5c, 0xdd, 0x34, 0x1e, 0xba, 0x6d, 0x3c, 0xf4, 0xab, 0xf1, 0xd0, 0xb7, 0xd6, 0xb3, + 0xbe, 0xb7, 0x9e, 0x75, 0xdb, 0x7a, 0xd6, 0xcf, 0xd6, 0xb3, 0x3e, 0x2f, 0x32, 0x56, 0x5e, 0x56, + 0x17, 0x7e, 0x2c, 0xf2, 0x00, 0x78, 0x2f, 0x79, 0x5a, 0x7e, 0x15, 0xf2, 0xca, 0xa8, 0xa8, 0x60, + 0x41, 0x26, 0xfe, 0x7b, 0x20, 0x17, 0x13, 0x78, 0x14, 0xaf, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, + 0x34, 0x07, 0x23, 0x38, 0x85, 0x02, 0x00, 0x00, +} + +func (m *CPUInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CPUInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CPUInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Vcores != 0 { + i = encodeVarintCpu(dAtA, i, uint64(m.Vcores)) + i-- + dAtA[i] = 0x20 + } + if len(m.Model) > 0 { + i -= len(m.Model) + copy(dAtA[i:], m.Model) + i = encodeVarintCpu(dAtA, i, uint64(len(m.Model))) + i-- + dAtA[i] = 0x1a + } + if len(m.Vendor) > 0 { + i -= len(m.Vendor) + copy(dAtA[i:], m.Vendor) + i = encodeVarintCpu(dAtA, i, uint64(len(m.Vendor))) + i-- + dAtA[i] = 0x12 + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintCpu(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CPU) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CPU) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CPU) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Info) > 0 { + for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Info[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCpu(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Quantity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCpu(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintCpu(dAtA []byte, offset int, v uint64) int { + offset -= sovCpu(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *CPUInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovCpu(uint64(l)) + } + l = len(m.Vendor) + if l > 0 { + n += 1 + l + sovCpu(uint64(l)) + } + l = len(m.Model) + if l > 0 { + n += 1 + l + sovCpu(uint64(l)) + } + if m.Vcores != 0 { + n += 1 + sovCpu(uint64(m.Vcores)) + } + return n +} + +func (m *CPU) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Quantity.Size() + n += 1 + l + sovCpu(uint64(l)) + if len(m.Info) > 0 { + for _, e := range m.Info { + l = e.Size() + n += 1 + l + sovCpu(uint64(l)) + } + } + return n +} + +func sovCpu(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCpu(x uint64) (n int) { + return sovCpu(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *CPUInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CPUInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CPUInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCpu + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCpu + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vendor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCpu + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCpu + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Vendor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Model", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthCpu + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCpu + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Model = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Vcores", wireType) + } + m.Vcores = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Vcores |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipCpu(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCpu + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CPU) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CPU: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CPU: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCpu + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCpu + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Quantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCpu + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCpu + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Info = append(m.Info, CPUInfo{}) + if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCpu(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCpu + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCpu(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCpu + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCpu + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCpu + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthCpu + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCpu + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthCpu + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthCpu = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCpu = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCpu = fmt.Errorf("proto: unexpected end of group") +) diff --git a/go/inventory/v1/gpu.pb.go b/go/inventory/v1/gpu.pb.go new file mode 100644 index 00000000..959aa24d --- /dev/null +++ b/go/inventory/v1/gpu.pb.go @@ -0,0 +1,764 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: akash/inventory/v1/gpu.proto + +package v1 + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/golang/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// 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.ProtoPackageIsVersion3 // please upgrade the proto package + +type GPUInfo struct { + Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor" yaml:"vendor"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name" yaml:"name"` + ModelID string `protobuf:"bytes,3,opt,name=modelid,proto3" json:"model_id" yaml:"model_id"` + Interface string `protobuf:"bytes,4,opt,name=interface,proto3" json:"interface" yaml:"interface"` + MemorySize string `protobuf:"bytes,5,opt,name=memory_size,json=memorySize,proto3" json:"memory_size" yaml:"memory_size"` +} + +func (m *GPUInfo) Reset() { *m = GPUInfo{} } +func (m *GPUInfo) String() string { return proto.CompactTextString(m) } +func (*GPUInfo) ProtoMessage() {} +func (*GPUInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_2cc01b12bd00ffcc, []int{0} +} +func (m *GPUInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GPUInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GPUInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GPUInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_GPUInfo.Merge(m, src) +} +func (m *GPUInfo) XXX_Size() int { + return m.Size() +} +func (m *GPUInfo) XXX_DiscardUnknown() { + xxx_messageInfo_GPUInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_GPUInfo proto.InternalMessageInfo + +func (m *GPUInfo) GetVendor() string { + if m != nil { + return m.Vendor + } + return "" +} + +func (m *GPUInfo) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *GPUInfo) GetModelID() string { + if m != nil { + return m.ModelID + } + return "" +} + +func (m *GPUInfo) GetInterface() string { + if m != nil { + return m.Interface + } + return "" +} + +func (m *GPUInfo) GetMemorySize() string { + if m != nil { + return m.MemorySize + } + return "" +} + +type GPU struct { + Quantity ResourcePair `protobuf:"bytes,1,opt,name=quantity,proto3" json:"quantity" yaml:"quantity"` + Info GPUInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info" yaml:"info"` +} + +func (m *GPU) Reset() { *m = GPU{} } +func (m *GPU) String() string { return proto.CompactTextString(m) } +func (*GPU) ProtoMessage() {} +func (*GPU) Descriptor() ([]byte, []int) { + return fileDescriptor_2cc01b12bd00ffcc, []int{1} +} +func (m *GPU) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GPU) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GPU.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GPU) XXX_Merge(src proto.Message) { + xxx_messageInfo_GPU.Merge(m, src) +} +func (m *GPU) XXX_Size() int { + return m.Size() +} +func (m *GPU) XXX_DiscardUnknown() { + xxx_messageInfo_GPU.DiscardUnknown(m) +} + +var xxx_messageInfo_GPU proto.InternalMessageInfo + +func (m *GPU) GetQuantity() ResourcePair { + if m != nil { + return m.Quantity + } + return ResourcePair{} +} + +func (m *GPU) GetInfo() GPUInfo { + if m != nil { + return m.Info + } + return GPUInfo{} +} + +func init() { + proto.RegisterType((*GPUInfo)(nil), "akash.inventory.v1.GPUInfo") + proto.RegisterType((*GPU)(nil), "akash.inventory.v1.GPU") +} + +func init() { proto.RegisterFile("akash/inventory/v1/gpu.proto", fileDescriptor_2cc01b12bd00ffcc) } + +var fileDescriptor_2cc01b12bd00ffcc = []byte{ + // 474 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x4f, 0x6b, 0xdb, 0x30, + 0x18, 0xc6, 0xe3, 0xd6, 0xcb, 0x1f, 0x85, 0xb1, 0x21, 0x76, 0x30, 0xdd, 0xb0, 0x8a, 0x46, 0x61, + 0x0c, 0x66, 0xd3, 0xe4, 0x36, 0xd8, 0x25, 0x14, 0x4a, 0x60, 0x1d, 0x99, 0xd7, 0xee, 0xb0, 0x4b, + 0x51, 0x13, 0xc5, 0x15, 0xad, 0xa4, 0x4c, 0x71, 0x32, 0xd2, 0x4f, 0xb1, 0xe3, 0x3e, 0x52, 0xd9, + 0xa9, 0xc7, 0x9d, 0xc4, 0x50, 0x0e, 0x83, 0x1c, 0xfd, 0x09, 0x86, 0x64, 0x3b, 0xde, 0x68, 0x6f, + 0x7e, 0x7f, 0xcf, 0xfb, 0x3c, 0x32, 0x7a, 0x04, 0x5e, 0x90, 0x2b, 0x32, 0xbf, 0x8c, 0x99, 0x58, + 0x52, 0x91, 0x49, 0xb5, 0x8a, 0x97, 0x87, 0x71, 0x3a, 0x5b, 0x44, 0x33, 0x25, 0x33, 0x09, 0xa1, + 0x53, 0xa3, 0xad, 0x1a, 0x2d, 0x0f, 0xf7, 0x9e, 0xa5, 0x32, 0x95, 0x4e, 0x8e, 0xed, 0x57, 0xb1, + 0xb9, 0x77, 0xf0, 0x40, 0x8e, 0xa2, 0x73, 0xb9, 0x50, 0x63, 0x3a, 0x23, 0x4c, 0x15, 0x6b, 0xf8, + 0xcf, 0x0e, 0x68, 0x1d, 0x8f, 0xce, 0x86, 0x62, 0x2a, 0xe1, 0x3b, 0xd0, 0x5c, 0x52, 0x31, 0x91, + 0x2a, 0xf0, 0xf6, 0xbd, 0x57, 0x9d, 0xc1, 0x81, 0xd1, 0xa8, 0xf9, 0xd9, 0x91, 0x8d, 0x46, 0xa5, + 0x96, 0x6b, 0xf4, 0x78, 0x45, 0xf8, 0xf5, 0x5b, 0x5c, 0xcc, 0x38, 0x29, 0x05, 0xd8, 0x07, 0xbe, + 0x20, 0x9c, 0x06, 0x3b, 0xce, 0x8c, 0x8c, 0x46, 0xfe, 0x07, 0xc2, 0xe9, 0x46, 0x23, 0xc7, 0x73, + 0x8d, 0xba, 0x85, 0xd1, 0x4e, 0x38, 0x71, 0x10, 0x1e, 0x81, 0x16, 0x97, 0x13, 0x7a, 0xcd, 0x26, + 0xc1, 0xae, 0xf3, 0xbd, 0x36, 0x1a, 0xb5, 0x4e, 0x2c, 0x1a, 0x1e, 0x6d, 0x34, 0x6a, 0x3b, 0xf5, + 0x9c, 0x4d, 0x72, 0x8d, 0x9e, 0x14, 0xf6, 0x8a, 0xe0, 0xa4, 0xb2, 0xc2, 0xf7, 0xa0, 0xc3, 0x44, + 0x46, 0xd5, 0x94, 0x8c, 0x69, 0xe0, 0xbb, 0x9c, 0xc8, 0x68, 0xd4, 0x19, 0x56, 0x70, 0xa3, 0x51, + 0xbd, 0x91, 0x6b, 0xf4, 0xb4, 0x88, 0xda, 0x22, 0x9c, 0xd4, 0x32, 0x3c, 0x05, 0x5d, 0x4e, 0xb9, + 0x54, 0xab, 0xf3, 0x39, 0xbb, 0xa1, 0xc1, 0x23, 0x97, 0xd7, 0x37, 0x1a, 0x81, 0x13, 0x87, 0x3f, + 0xb1, 0x1b, 0x1b, 0xf8, 0xef, 0x52, 0xae, 0x11, 0x2c, 0xff, 0xae, 0x86, 0x38, 0x01, 0x7c, 0x6b, + 0xc0, 0x3f, 0x3d, 0xb0, 0x7b, 0x3c, 0x3a, 0x83, 0x1c, 0xb4, 0xbf, 0x2e, 0x88, 0xc8, 0x58, 0xb6, + 0x72, 0xf7, 0xdc, 0xed, 0xed, 0x47, 0xf7, 0x5b, 0x8d, 0x92, 0xb2, 0xab, 0x11, 0x61, 0x6a, 0x10, + 0xdf, 0x6a, 0xd4, 0x30, 0x1a, 0xb5, 0x3f, 0x96, 0x4e, 0x7b, 0x33, 0x55, 0x4a, 0x7d, 0x33, 0x15, + 0xc1, 0xc9, 0x56, 0x84, 0xa7, 0xc0, 0x67, 0x62, 0x2a, 0x5d, 0x2b, 0xdd, 0xde, 0xf3, 0x87, 0x8e, + 0x2a, 0xfb, 0x1f, 0xbc, 0x2c, 0x4f, 0xf1, 0xed, 0x64, 0x6b, 0xb3, 0xc6, 0xba, 0x36, 0x3b, 0xe1, + 0xc4, 0xc1, 0xc1, 0xe8, 0xd6, 0x84, 0xde, 0x9d, 0x09, 0xbd, 0xdf, 0x26, 0xf4, 0xbe, 0xaf, 0xc3, + 0xc6, 0x8f, 0x75, 0xd8, 0xb8, 0x5b, 0x87, 0x8d, 0x5f, 0xeb, 0xb0, 0xf1, 0xa5, 0x97, 0xb2, 0xec, + 0x72, 0x71, 0x11, 0x8d, 0x25, 0x8f, 0xdd, 0x79, 0x6f, 0x04, 0xcd, 0xbe, 0x49, 0x75, 0x55, 0x4e, + 0x64, 0xc6, 0xe2, 0x54, 0xfe, 0xf7, 0x36, 0x2f, 0x9a, 0xee, 0x3d, 0xf6, 0xff, 0x06, 0x00, 0x00, + 0xff, 0xff, 0x2c, 0x99, 0x43, 0xfe, 0x00, 0x03, 0x00, 0x00, +} + +func (m *GPUInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GPUInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GPUInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MemorySize) > 0 { + i -= len(m.MemorySize) + copy(dAtA[i:], m.MemorySize) + i = encodeVarintGpu(dAtA, i, uint64(len(m.MemorySize))) + i-- + dAtA[i] = 0x2a + } + if len(m.Interface) > 0 { + i -= len(m.Interface) + copy(dAtA[i:], m.Interface) + i = encodeVarintGpu(dAtA, i, uint64(len(m.Interface))) + i-- + dAtA[i] = 0x22 + } + if len(m.ModelID) > 0 { + i -= len(m.ModelID) + copy(dAtA[i:], m.ModelID) + i = encodeVarintGpu(dAtA, i, uint64(len(m.ModelID))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGpu(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Vendor) > 0 { + i -= len(m.Vendor) + copy(dAtA[i:], m.Vendor) + i = encodeVarintGpu(dAtA, i, uint64(len(m.Vendor))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GPU) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GPU) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GPU) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Info.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGpu(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Quantity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGpu(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGpu(dAtA []byte, offset int, v uint64) int { + offset -= sovGpu(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GPUInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Vendor) + if l > 0 { + n += 1 + l + sovGpu(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovGpu(uint64(l)) + } + l = len(m.ModelID) + if l > 0 { + n += 1 + l + sovGpu(uint64(l)) + } + l = len(m.Interface) + if l > 0 { + n += 1 + l + sovGpu(uint64(l)) + } + l = len(m.MemorySize) + if l > 0 { + n += 1 + l + sovGpu(uint64(l)) + } + return n +} + +func (m *GPU) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Quantity.Size() + n += 1 + l + sovGpu(uint64(l)) + l = m.Info.Size() + n += 1 + l + sovGpu(uint64(l)) + return n +} + +func sovGpu(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGpu(x uint64) (n int) { + return sovGpu(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GPUInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GPUInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GPUInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vendor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGpu + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGpu + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Vendor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGpu + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGpu + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ModelID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGpu + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGpu + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ModelID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Interface", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGpu + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGpu + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Interface = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MemorySize", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGpu + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGpu + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MemorySize = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGpu(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGpu + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GPU) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GPU: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GPU: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGpu + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGpu + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Quantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGpu + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGpu + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGpu + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGpu(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGpu + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGpu(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGpu + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGpu + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGpu + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGpu + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGpu + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGpu + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGpu = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGpu = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGpu = fmt.Errorf("proto: unexpected end of group") +) diff --git a/go/inventory/v1/memory.pb.go b/go/inventory/v1/memory.pb.go new file mode 100644 index 00000000..7ec90ca4 --- /dev/null +++ b/go/inventory/v1/memory.pb.go @@ -0,0 +1,720 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: akash/inventory/v1/memory.proto + +package v1 + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/golang/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// 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.ProtoPackageIsVersion3 // please upgrade the proto package + +type MemoryInfo struct { + Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor" yaml:"vendor"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type" yaml:"type"` + TotalSize string `protobuf:"bytes,3,opt,name=total_size,json=totalSize,proto3" json:"total_size" yaml:"total_size"` + Speed string `protobuf:"bytes,4,opt,name=speed,proto3" json:"speed" yaml:"speed"` +} + +func (m *MemoryInfo) Reset() { *m = MemoryInfo{} } +func (m *MemoryInfo) String() string { return proto.CompactTextString(m) } +func (*MemoryInfo) ProtoMessage() {} +func (*MemoryInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_bf744888c94a0308, []int{0} +} +func (m *MemoryInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MemoryInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MemoryInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MemoryInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemoryInfo.Merge(m, src) +} +func (m *MemoryInfo) XXX_Size() int { + return m.Size() +} +func (m *MemoryInfo) XXX_DiscardUnknown() { + xxx_messageInfo_MemoryInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_MemoryInfo proto.InternalMessageInfo + +func (m *MemoryInfo) GetVendor() string { + if m != nil { + return m.Vendor + } + return "" +} + +func (m *MemoryInfo) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *MemoryInfo) GetTotalSize() string { + if m != nil { + return m.TotalSize + } + return "" +} + +func (m *MemoryInfo) GetSpeed() string { + if m != nil { + return m.Speed + } + return "" +} + +type Memory struct { + Quantity ResourcePair `protobuf:"bytes,1,opt,name=quantity,proto3" json:"quantity" yaml:"quantity"` + Info []MemoryInfo `protobuf:"bytes,2,rep,name=info,proto3" json:"info" yaml:"info"` +} + +func (m *Memory) Reset() { *m = Memory{} } +func (m *Memory) String() string { return proto.CompactTextString(m) } +func (*Memory) ProtoMessage() {} +func (*Memory) Descriptor() ([]byte, []int) { + return fileDescriptor_bf744888c94a0308, []int{1} +} +func (m *Memory) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Memory) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Memory.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Memory) XXX_Merge(src proto.Message) { + xxx_messageInfo_Memory.Merge(m, src) +} +func (m *Memory) XXX_Size() int { + return m.Size() +} +func (m *Memory) XXX_DiscardUnknown() { + xxx_messageInfo_Memory.DiscardUnknown(m) +} + +var xxx_messageInfo_Memory proto.InternalMessageInfo + +func (m *Memory) GetQuantity() ResourcePair { + if m != nil { + return m.Quantity + } + return ResourcePair{} +} + +func (m *Memory) GetInfo() []MemoryInfo { + if m != nil { + return m.Info + } + return nil +} + +func init() { + proto.RegisterType((*MemoryInfo)(nil), "akash.inventory.v1.MemoryInfo") + proto.RegisterType((*Memory)(nil), "akash.inventory.v1.Memory") +} + +func init() { proto.RegisterFile("akash/inventory/v1/memory.proto", fileDescriptor_bf744888c94a0308) } + +var fileDescriptor_bf744888c94a0308 = []byte{ + // 435 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0x3f, 0x6f, 0x13, 0x31, + 0x1c, 0xbd, 0x4b, 0xaf, 0x51, 0xe3, 0x80, 0x10, 0x16, 0xc3, 0xa9, 0x83, 0x7f, 0x91, 0x51, 0xa5, + 0x2e, 0xdc, 0xd1, 0x74, 0x41, 0x48, 0x2c, 0xd9, 0x18, 0x10, 0xe5, 0x5a, 0x81, 0xc4, 0x82, 0xdc, + 0xd6, 0x4d, 0xad, 0xf6, 0xce, 0x87, 0xe3, 0x04, 0x5d, 0xbf, 0x02, 0x0b, 0x23, 0x1f, 0xa9, 0x63, + 0x46, 0x26, 0x0b, 0x39, 0x5b, 0xc6, 0xfb, 0x04, 0xc8, 0xf6, 0x35, 0x05, 0xd1, 0xed, 0xde, 0xfb, + 0xbd, 0x3f, 0xd2, 0x3b, 0x23, 0x60, 0x57, 0x6c, 0x76, 0x99, 0x8b, 0x6a, 0xc1, 0x2b, 0x2d, 0x55, + 0x93, 0x2f, 0x0e, 0xf2, 0x92, 0x97, 0x52, 0x35, 0x59, 0xad, 0xa4, 0x96, 0x18, 0x7b, 0x41, 0xb6, + 0x11, 0x64, 0x8b, 0x83, 0xdd, 0x67, 0x53, 0x39, 0x95, 0xfe, 0x9c, 0xbb, 0xaf, 0xa0, 0xdc, 0xdd, + 0x7b, 0x20, 0x4a, 0xf1, 0x99, 0x9c, 0xab, 0x33, 0x5e, 0x33, 0xa1, 0x82, 0x8c, 0x7e, 0xef, 0x21, + 0xf4, 0xce, 0x37, 0xbc, 0xad, 0x2e, 0x24, 0x7e, 0x83, 0xfa, 0x0b, 0x5e, 0x9d, 0x4b, 0x95, 0xc6, + 0xa3, 0x78, 0x7f, 0x30, 0xd9, 0xb3, 0x06, 0xfa, 0x1f, 0x3d, 0xb3, 0x36, 0xd0, 0xdd, 0x5a, 0x03, + 0x8f, 0x1b, 0x56, 0x5e, 0xbf, 0xa6, 0x01, 0xd3, 0xa2, 0x3b, 0xe0, 0x43, 0x94, 0xe8, 0xa6, 0xe6, + 0x69, 0xcf, 0x9b, 0xc1, 0x1a, 0x48, 0x4e, 0x9a, 0x9a, 0xaf, 0x0d, 0x78, 0xbe, 0x35, 0x30, 0x0c, + 0x46, 0x87, 0x68, 0xe1, 0x49, 0xfc, 0x1e, 0x21, 0x2d, 0x35, 0xbb, 0xfe, 0x32, 0x13, 0x37, 0x3c, + 0xdd, 0xf2, 0xd6, 0x97, 0xd6, 0xc0, 0xe0, 0xc4, 0xb1, 0xc7, 0xe2, 0xc6, 0xf9, 0xff, 0x92, 0xb4, + 0x06, 0x9e, 0x76, 0x29, 0x1b, 0x8e, 0x16, 0x03, 0x7d, 0xa7, 0xc6, 0xaf, 0xd0, 0xf6, 0xac, 0xe6, + 0xfc, 0x3c, 0x4d, 0x7c, 0x16, 0xb5, 0x06, 0xb6, 0x8f, 0x1d, 0xb1, 0x36, 0x10, 0x2e, 0xad, 0x81, + 0x47, 0x21, 0xc2, 0x43, 0x5a, 0x04, 0x9a, 0x2e, 0x63, 0xd4, 0x0f, 0x6b, 0xe0, 0x12, 0xed, 0x7c, + 0x9d, 0xb3, 0x4a, 0x0b, 0xdd, 0xf8, 0x2d, 0x86, 0xe3, 0x51, 0xf6, 0xff, 0xf8, 0x59, 0xd1, 0x4d, + 0x7a, 0xc4, 0x84, 0x9a, 0xe4, 0xb7, 0x06, 0x22, 0x6b, 0x60, 0xe7, 0x43, 0xe7, 0x5c, 0x1b, 0xd8, + 0xa4, 0xb4, 0x06, 0x9e, 0x84, 0xce, 0x3b, 0x86, 0x16, 0x9b, 0x23, 0xfe, 0x84, 0x12, 0x51, 0x5d, + 0xc8, 0xb4, 0x37, 0xda, 0xda, 0x1f, 0x8e, 0xc9, 0x43, 0x55, 0xf7, 0xbf, 0x69, 0xf2, 0xbc, 0x2b, + 0x4a, 0x1c, 0x72, 0xeb, 0x3a, 0xef, 0xfd, 0xba, 0x0e, 0xd1, 0xc2, 0x93, 0x93, 0xa3, 0x5b, 0x4b, + 0xe2, 0xa5, 0x25, 0xf1, 0x6f, 0x4b, 0xe2, 0x1f, 0x2b, 0x12, 0xfd, 0x5c, 0x91, 0x68, 0xb9, 0x22, + 0xd1, 0xaf, 0x15, 0x89, 0x3e, 0x8f, 0xa7, 0x42, 0x5f, 0xce, 0x4f, 0xb3, 0x33, 0x59, 0xe6, 0xbe, + 0xf2, 0x45, 0xc5, 0xf5, 0x37, 0xa9, 0xae, 0x3a, 0xc4, 0x6a, 0x91, 0x4f, 0xe5, 0x3f, 0xaf, 0xe8, + 0xb4, 0xef, 0x5f, 0xce, 0xe1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x82, 0x38, 0x06, 0x7c, 0xad, + 0x02, 0x00, 0x00, +} + +func (m *MemoryInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MemoryInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemoryInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Speed) > 0 { + i -= len(m.Speed) + copy(dAtA[i:], m.Speed) + i = encodeVarintMemory(dAtA, i, uint64(len(m.Speed))) + i-- + dAtA[i] = 0x22 + } + if len(m.TotalSize) > 0 { + i -= len(m.TotalSize) + copy(dAtA[i:], m.TotalSize) + i = encodeVarintMemory(dAtA, i, uint64(len(m.TotalSize))) + i-- + dAtA[i] = 0x1a + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintMemory(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x12 + } + if len(m.Vendor) > 0 { + i -= len(m.Vendor) + copy(dAtA[i:], m.Vendor) + i = encodeVarintMemory(dAtA, i, uint64(len(m.Vendor))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Memory) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Memory) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Memory) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Info) > 0 { + for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Info[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMemory(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Quantity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMemory(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintMemory(dAtA []byte, offset int, v uint64) int { + offset -= sovMemory(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MemoryInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Vendor) + if l > 0 { + n += 1 + l + sovMemory(uint64(l)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sovMemory(uint64(l)) + } + l = len(m.TotalSize) + if l > 0 { + n += 1 + l + sovMemory(uint64(l)) + } + l = len(m.Speed) + if l > 0 { + n += 1 + l + sovMemory(uint64(l)) + } + return n +} + +func (m *Memory) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Quantity.Size() + n += 1 + l + sovMemory(uint64(l)) + if len(m.Info) > 0 { + for _, e := range m.Info { + l = e.Size() + n += 1 + l + sovMemory(uint64(l)) + } + } + return n +} + +func sovMemory(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMemory(x uint64) (n int) { + return sovMemory(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MemoryInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMemory + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MemoryInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MemoryInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vendor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMemory + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMemory + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMemory + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Vendor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMemory + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMemory + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMemory + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalSize", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMemory + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMemory + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMemory + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TotalSize = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Speed", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMemory + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMemory + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMemory + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Speed = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMemory(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMemory + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Memory) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMemory + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Memory: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Memory: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMemory + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMemory + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMemory + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Quantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMemory + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMemory + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMemory + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Info = append(m.Info, MemoryInfo{}) + if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMemory(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMemory + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMemory(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMemory + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMemory + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMemory + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthMemory + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMemory + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMemory + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMemory = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMemory = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMemory = fmt.Errorf("proto: unexpected end of group") +) diff --git a/go/inventory/v1/node.pb.go b/go/inventory/v1/node.pb.go new file mode 100644 index 00000000..e7302df7 --- /dev/null +++ b/go/inventory/v1/node.pb.go @@ -0,0 +1,509 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: akash/inventory/v1/node.proto + +package v1 + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Node struct { + CPU CPU `protobuf:"bytes,1,opt,name=cpu,proto3" json:"cpu" yaml:"cpu"` + Memory Memory `protobuf:"bytes,2,opt,name=memory,proto3" json:"memory" yaml:"memory"` + Gpus GPUs `protobuf:"bytes,3,rep,name=gpu,proto3,castrepeated=GPUs" json:"gpus" yaml:"gpus"` + Storage ClusterStorage `protobuf:"bytes,4,rep,name=storage,proto3,castrepeated=ClusterStorage" json:"storage" yaml:"storage"` +} + +func (m *Node) Reset() { *m = Node{} } +func (m *Node) String() string { return proto.CompactTextString(m) } +func (*Node) ProtoMessage() {} +func (*Node) Descriptor() ([]byte, []int) { + return fileDescriptor_5f97c0fb35079221, []int{0} +} +func (m *Node) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Node.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Node) XXX_Merge(src proto.Message) { + xxx_messageInfo_Node.Merge(m, src) +} +func (m *Node) XXX_Size() int { + return m.Size() +} +func (m *Node) XXX_DiscardUnknown() { + xxx_messageInfo_Node.DiscardUnknown(m) +} + +var xxx_messageInfo_Node proto.InternalMessageInfo + +func (m *Node) GetCPU() CPU { + if m != nil { + return m.CPU + } + return CPU{} +} + +func (m *Node) GetMemory() Memory { + if m != nil { + return m.Memory + } + return Memory{} +} + +func (m *Node) GetGpus() GPUs { + if m != nil { + return m.Gpus + } + return nil +} + +func (m *Node) GetStorage() ClusterStorage { + if m != nil { + return m.Storage + } + return nil +} + +func init() { + proto.RegisterType((*Node)(nil), "akash.inventory.v1.Node") +} + +func init() { proto.RegisterFile("akash/inventory/v1/node.proto", fileDescriptor_5f97c0fb35079221) } + +var fileDescriptor_5f97c0fb35079221 = []byte{ + // 389 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xbd, 0x8e, 0x9b, 0x40, + 0x14, 0x85, 0x21, 0x20, 0x5b, 0xc2, 0x8a, 0x0b, 0x14, 0x29, 0x88, 0x24, 0x0c, 0xa2, 0x4a, 0x14, + 0x05, 0x64, 0xa7, 0x4b, 0x91, 0x02, 0x17, 0x2e, 0xf2, 0x23, 0x44, 0x44, 0x8a, 0x48, 0x29, 0x30, + 0x46, 0x63, 0xcb, 0x86, 0x19, 0x01, 0xe3, 0xc8, 0x65, 0xde, 0x60, 0x9f, 0x63, 0x9f, 0xc4, 0xa5, + 0xcb, 0xad, 0x66, 0x57, 0xb8, 0xa3, 0xe4, 0x09, 0x56, 0xcc, 0x8c, 0x2d, 0xad, 0x96, 0xdd, 0x8e, + 0x73, 0xcf, 0xb9, 0xdf, 0x3d, 0x62, 0xb4, 0x77, 0xf1, 0x26, 0x2e, 0x57, 0xde, 0x3a, 0xdf, 0xa5, + 0x79, 0x85, 0x8a, 0xbd, 0xb7, 0x9b, 0x78, 0x39, 0x5a, 0xa6, 0x2e, 0x2e, 0x50, 0x85, 0x74, 0x9d, + 0xd9, 0xee, 0xc5, 0x76, 0x77, 0x13, 0xf3, 0x15, 0x44, 0x10, 0x31, 0xdb, 0xeb, 0xbe, 0x78, 0xd2, + 0x7c, 0xdb, 0x03, 0x4a, 0x30, 0x79, 0xc6, 0x85, 0x17, 0xd7, 0xee, 0x71, 0xcb, 0x0a, 0x15, 0x31, + 0x14, 0x3d, 0x4c, 0xd0, 0x93, 0xc8, 0xd2, 0xac, 0x6b, 0xc4, 0x02, 0xce, 0x7f, 0x45, 0x53, 0x7f, + 0xa2, 0x65, 0xaa, 0x7f, 0xd3, 0x94, 0x04, 0x13, 0x43, 0xb6, 0xe5, 0xf7, 0xa3, 0xe9, 0x6b, 0xf7, + 0x71, 0x7f, 0x77, 0x16, 0x44, 0xbe, 0x7d, 0xa0, 0x40, 0xaa, 0x29, 0x50, 0x66, 0x41, 0xd4, 0x50, + 0xd0, 0xad, 0xb4, 0x14, 0x68, 0xfb, 0x38, 0xdb, 0x7e, 0x71, 0x12, 0x4c, 0x9c, 0xb0, 0x1b, 0xe9, + 0x7f, 0xb5, 0x01, 0xbf, 0x62, 0xbc, 0x60, 0x3c, 0xb3, 0x8f, 0xf7, 0x83, 0x25, 0xfc, 0x0f, 0x02, + 0x39, 0xe0, 0xba, 0xa1, 0x40, 0xec, 0xb6, 0x14, 0xbc, 0xe4, 0x60, 0xae, 0x9d, 0x50, 0x18, 0xfa, + 0x6f, 0x4d, 0x81, 0x98, 0x18, 0x8a, 0xad, 0x3c, 0xd5, 0x75, 0x1e, 0x44, 0xfe, 0x47, 0x01, 0x56, + 0xe7, 0x98, 0x94, 0x0d, 0x05, 0x2a, 0xc4, 0xa4, 0x6c, 0x29, 0x18, 0x71, 0x68, 0xa7, 0x9c, 0xeb, + 0x5b, 0xa0, 0xce, 0x83, 0xa8, 0x0c, 0x3b, 0xa0, 0x4e, 0xb4, 0xa1, 0xf8, 0x7d, 0x86, 0xca, 0xd8, + 0x6f, 0xfa, 0xd8, 0xbf, 0x78, 0xc4, 0xff, 0x2a, 0xf8, 0x43, 0x31, 0x68, 0x28, 0x38, 0xaf, 0xb7, + 0x14, 0x8c, 0xf9, 0x15, 0x31, 0xe8, 0x0e, 0x8d, 0x67, 0x5b, 0x52, 0x56, 0x69, 0x21, 0xe2, 0xe1, + 0x39, 0xec, 0x7f, 0x3f, 0xd4, 0x96, 0x7c, 0xac, 0x2d, 0xf9, 0xae, 0xb6, 0xe4, 0xab, 0x93, 0x25, + 0x1d, 0x4f, 0x96, 0x74, 0x73, 0xb2, 0xa4, 0x3f, 0x53, 0xb8, 0xae, 0x56, 0x64, 0xe1, 0x26, 0x28, + 0xf3, 0x58, 0x93, 0x4f, 0x79, 0x5a, 0xfd, 0x43, 0xc5, 0x46, 0xa8, 0x18, 0xaf, 0x3d, 0x88, 0x1e, + 0x3c, 0xef, 0x62, 0xc0, 0x1e, 0xf6, 0xf3, 0x7d, 0x00, 0x00, 0x00, 0xff, 0xff, 0xca, 0x35, 0xfe, + 0x8f, 0xa2, 0x02, 0x00, 0x00, +} + +func (m *Node) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Node) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Storage) > 0 { + for iNdEx := len(m.Storage) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Storage[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Gpus) > 0 { + for iNdEx := len(m.Gpus) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Gpus[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + { + size, err := m.Memory.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.CPU.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintNode(dAtA []byte, offset int, v uint64) int { + offset -= sovNode(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Node) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.CPU.Size() + n += 1 + l + sovNode(uint64(l)) + l = m.Memory.Size() + n += 1 + l + sovNode(uint64(l)) + if len(m.Gpus) > 0 { + for _, e := range m.Gpus { + l = e.Size() + n += 1 + l + sovNode(uint64(l)) + } + } + if len(m.Storage) > 0 { + for _, e := range m.Storage { + l = e.Size() + n += 1 + l + sovNode(uint64(l)) + } + } + return n +} + +func sovNode(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozNode(x uint64) (n int) { + return sovNode(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Node) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Node: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Node: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CPU", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CPU.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Memory", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Memory.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gpus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Gpus = append(m.Gpus, GPU{}) + if err := m.Gpus[len(m.Gpus)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Storage", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Storage = append(m.Storage, Storage{}) + if err := m.Storage[len(m.Storage)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNode(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipNode(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNode + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNode + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNode + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthNode + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupNode + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthNode + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthNode = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowNode = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupNode = fmt.Errorf("proto: unexpected end of group") +) diff --git a/go/inventory/v1/resourcepair.go b/go/inventory/v1/resourcepair.go new file mode 100644 index 00000000..1eef26e4 --- /dev/null +++ b/go/inventory/v1/resourcepair.go @@ -0,0 +1,17 @@ +package v1 + +func (m *ResourcePair) Equal(rhs ResourcePair) bool { + if m == nil { + return false + } + + return (m.Allocatable.Cmp(rhs.Allocatable) == 0) && (m.Allocated.Cmp(rhs.Allocated) == 0) +} + +func (m *ResourcePair) LT(rhs ResourcePair) bool { + if m == nil { + return false + } + + return m.Allocatable.Cmp(rhs.Allocatable) == -1 +} diff --git a/go/inventory/v1/resourcepair.pb.go b/go/inventory/v1/resourcepair.pb.go new file mode 100644 index 00000000..2144eaf2 --- /dev/null +++ b/go/inventory/v1/resourcepair.pb.go @@ -0,0 +1,452 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: akash/inventory/v1/resourcepair.proto + +package v1 + +import ( + fmt "fmt" + v1beta3 "github.com/akash-network/akash-api/go/node/types/v1beta3" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/golang/protobuf/proto" + io "io" + resource "k8s.io/apimachinery/pkg/api/resource" + math "math" + math_bits "math/bits" +) + +// 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.ProtoPackageIsVersion3 // please upgrade the proto package + +type ResourcePair struct { + Allocatable resource.Quantity `protobuf:"bytes,1,opt,name=allocatable,proto3" json:"allocatable" yaml:"allocatable"` + Allocated resource.Quantity `protobuf:"bytes,2,opt,name=allocated,proto3" json:"allocated" yaml:"allocated"` + Attributes []*v1beta3.Attribute `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes,omitempty" yaml:"attributes,omitempty"` +} + +func (m *ResourcePair) Reset() { *m = ResourcePair{} } +func (m *ResourcePair) String() string { return proto.CompactTextString(m) } +func (*ResourcePair) ProtoMessage() {} +func (*ResourcePair) Descriptor() ([]byte, []int) { + return fileDescriptor_995cee7bf7b692e7, []int{0} +} +func (m *ResourcePair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourcePair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResourcePair.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ResourcePair) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourcePair.Merge(m, src) +} +func (m *ResourcePair) XXX_Size() int { + return m.Size() +} +func (m *ResourcePair) XXX_DiscardUnknown() { + xxx_messageInfo_ResourcePair.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourcePair proto.InternalMessageInfo + +func (m *ResourcePair) GetAllocatable() resource.Quantity { + if m != nil { + return m.Allocatable + } + return resource.Quantity{} +} + +func (m *ResourcePair) GetAllocated() resource.Quantity { + if m != nil { + return m.Allocated + } + return resource.Quantity{} +} + +func (m *ResourcePair) GetAttributes() []*v1beta3.Attribute { + if m != nil { + return m.Attributes + } + return nil +} + +func init() { + proto.RegisterType((*ResourcePair)(nil), "akash.inventory.v1.ResourcePair") +} + +func init() { + proto.RegisterFile("akash/inventory/v1/resourcepair.proto", fileDescriptor_995cee7bf7b692e7) +} + +var fileDescriptor_995cee7bf7b692e7 = []byte{ + // 407 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0xbd, 0xae, 0xd3, 0x30, + 0x18, 0x8d, 0x29, 0x42, 0xba, 0x09, 0x03, 0x8a, 0xee, 0x50, 0x5d, 0x44, 0x7c, 0x15, 0x09, 0xe9, + 0x0e, 0x60, 0xab, 0x29, 0x43, 0x55, 0xa6, 0xf6, 0x09, 0x4a, 0x46, 0x36, 0x27, 0xb5, 0x52, 0x2b, + 0x3f, 0x8e, 0x1c, 0x27, 0x28, 0x4c, 0xcc, 0x4c, 0x8c, 0x8c, 0x7d, 0x9c, 0x8e, 0x1d, 0x99, 0x2c, + 0x94, 0x2c, 0xa8, 0x63, 0x9f, 0x00, 0xe5, 0xa7, 0x4d, 0x2a, 0x31, 0xb1, 0xf9, 0x3b, 0xdf, 0x39, + 0xe7, 0x3b, 0xca, 0x89, 0xfe, 0x96, 0x84, 0x24, 0xdb, 0x61, 0x96, 0x14, 0x34, 0x91, 0x5c, 0x94, + 0xb8, 0x98, 0x61, 0x41, 0x33, 0x9e, 0x0b, 0x9f, 0xa6, 0x84, 0x09, 0x94, 0x0a, 0x2e, 0xb9, 0x69, + 0xb6, 0x34, 0x74, 0xa5, 0xa1, 0x62, 0xf6, 0x60, 0x77, 0x52, 0x8f, 0x64, 0x14, 0x17, 0x33, 0x8f, + 0x4a, 0x32, 0xc7, 0x44, 0x4a, 0xc1, 0xbc, 0x5c, 0xd2, 0x4e, 0xf7, 0x70, 0x1f, 0xf0, 0x80, 0xb7, + 0x4f, 0xdc, 0xbc, 0x7a, 0xf4, 0x43, 0xb8, 0xc8, 0x10, 0xe3, 0x98, 0xa4, 0x2c, 0x26, 0xfe, 0x8e, + 0x25, 0x54, 0x94, 0x38, 0x0d, 0x83, 0x06, 0xb8, 0x5e, 0xc7, 0x01, 0x4d, 0xa8, 0x20, 0x92, 0x6e, + 0x3b, 0x95, 0xbd, 0x9f, 0xe8, 0x2f, 0xdd, 0x7e, 0xb9, 0x21, 0x4c, 0x98, 0xdf, 0x81, 0x6e, 0x90, + 0x28, 0xe2, 0x3e, 0x91, 0xc4, 0x8b, 0xe8, 0x14, 0x3c, 0x82, 0x27, 0xc3, 0x41, 0xa8, 0x73, 0x47, + 0x63, 0x77, 0x94, 0x86, 0x41, 0x03, 0xa0, 0x8b, 0x3b, 0xfa, 0x94, 0x93, 0x44, 0x32, 0x59, 0xae, + 0x17, 0x07, 0x05, 0xb5, 0x4a, 0x41, 0x63, 0x35, 0x58, 0x9d, 0x14, 0x1c, 0x3b, 0x9f, 0x15, 0x34, + 0x4b, 0x12, 0x47, 0x4b, 0x7b, 0x04, 0xda, 0xee, 0x98, 0x62, 0x7e, 0x03, 0xfa, 0x5d, 0x3f, 0xd3, + 0xed, 0xf4, 0xd9, 0x7f, 0x45, 0x71, 0xfa, 0x28, 0x77, 0xab, 0x8b, 0xd1, 0x49, 0xc1, 0xc1, 0xf5, + 0xac, 0xe0, 0xab, 0x9b, 0x18, 0x74, 0x6b, 0xbb, 0xc3, 0xda, 0xfc, 0xaa, 0xeb, 0xd7, 0xef, 0x9f, + 0x4d, 0x27, 0x8f, 0x93, 0x27, 0xc3, 0x79, 0x83, 0xba, 0xe6, 0x9a, 0x96, 0x50, 0xdf, 0x12, 0x5a, + 0x5d, 0x58, 0xeb, 0x8f, 0x07, 0x05, 0xc1, 0x49, 0xc1, 0xfb, 0x41, 0xf8, 0x8e, 0xc7, 0x4c, 0xd2, + 0x38, 0x95, 0xe5, 0x59, 0xc1, 0xd7, 0xfd, 0xbd, 0x7f, 0x6c, 0x6d, 0x77, 0x74, 0x6d, 0xf9, 0xfc, + 0xcf, 0x1e, 0x6a, 0xeb, 0xcd, 0xa1, 0xb2, 0xc0, 0xb1, 0xb2, 0xc0, 0xef, 0xca, 0x02, 0x3f, 0x6a, + 0x4b, 0xfb, 0x59, 0x5b, 0xda, 0xb1, 0xb6, 0xb4, 0x5f, 0xb5, 0xa5, 0x7d, 0x76, 0x02, 0x26, 0x77, + 0xb9, 0x87, 0x7c, 0x1e, 0xe3, 0x36, 0xd5, 0xfb, 0x84, 0xca, 0x2f, 0x5c, 0x84, 0xfd, 0xd4, 0xb4, + 0x1f, 0xf0, 0x9b, 0x7f, 0xd1, 0x7b, 0xd1, 0x76, 0x3f, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xc8, + 0xb9, 0xff, 0x7b, 0xa8, 0x02, 0x00, 0x00, +} + +func (m *ResourcePair) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ResourcePair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourcePair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Attributes) > 0 { + for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Attributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResourcepair(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + { + size, err := m.Allocated.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResourcepair(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Allocatable.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintResourcepair(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintResourcepair(dAtA []byte, offset int, v uint64) int { + offset -= sovResourcepair(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ResourcePair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Allocatable.Size() + n += 1 + l + sovResourcepair(uint64(l)) + l = m.Allocated.Size() + n += 1 + l + sovResourcepair(uint64(l)) + if len(m.Attributes) > 0 { + for _, e := range m.Attributes { + l = e.Size() + n += 1 + l + sovResourcepair(uint64(l)) + } + } + return n +} + +func sovResourcepair(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozResourcepair(x uint64) (n int) { + return sovResourcepair(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ResourcePair) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResourcepair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResourcePair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourcePair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allocatable", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResourcepair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResourcepair + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResourcepair + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Allocatable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allocated", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResourcepair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResourcepair + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResourcepair + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Allocated.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowResourcepair + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthResourcepair + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthResourcepair + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attributes = append(m.Attributes, &v1beta3.Attribute{}) + if err := m.Attributes[len(m.Attributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipResourcepair(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthResourcepair + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipResourcepair(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowResourcepair + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowResourcepair + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowResourcepair + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthResourcepair + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupResourcepair + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthResourcepair + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthResourcepair = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowResourcepair = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupResourcepair = fmt.Errorf("proto: unexpected end of group") +) diff --git a/go/inventory/v1/service.pb.go b/go/inventory/v1/service.pb.go new file mode 100644 index 00000000..ffe06c2b --- /dev/null +++ b/go/inventory/v1/service.pb.go @@ -0,0 +1,380 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: akash/inventory/v1/service.proto + +package v1 + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type VoidNoParam struct { +} + +func (m *VoidNoParam) Reset() { *m = VoidNoParam{} } +func (m *VoidNoParam) String() string { return proto.CompactTextString(m) } +func (*VoidNoParam) ProtoMessage() {} +func (*VoidNoParam) Descriptor() ([]byte, []int) { + return fileDescriptor_19b1fad552cee5dc, []int{0} +} +func (m *VoidNoParam) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VoidNoParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VoidNoParam.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *VoidNoParam) XXX_Merge(src proto.Message) { + xxx_messageInfo_VoidNoParam.Merge(m, src) +} +func (m *VoidNoParam) XXX_Size() int { + return m.Size() +} +func (m *VoidNoParam) XXX_DiscardUnknown() { + xxx_messageInfo_VoidNoParam.DiscardUnknown(m) +} + +var xxx_messageInfo_VoidNoParam proto.InternalMessageInfo + +func init() { + proto.RegisterType((*VoidNoParam)(nil), "akash.inventory.v1.voidNoParam") +} + +func init() { proto.RegisterFile("akash/inventory/v1/service.proto", fileDescriptor_19b1fad552cee5dc) } + +var fileDescriptor_19b1fad552cee5dc = []byte{ + // 195 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xcc, 0x4e, 0x2c, + 0xce, 0xd0, 0xcf, 0xcc, 0x2b, 0x4b, 0xcd, 0x2b, 0xc9, 0x2f, 0xaa, 0xd4, 0x2f, 0x33, 0xd4, 0x2f, + 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x02, 0xab, + 0xd0, 0x83, 0xab, 0xd0, 0x2b, 0x33, 0x94, 0x92, 0xc5, 0xa2, 0x2b, 0x2f, 0x3f, 0x05, 0xaa, 0x45, + 0x89, 0x97, 0x8b, 0xbb, 0x2c, 0x3f, 0x33, 0xc5, 0x2f, 0x3f, 0x20, 0xb1, 0x28, 0x31, 0xd7, 0xc8, + 0x9f, 0x8b, 0xd9, 0xb7, 0x38, 0x5d, 0xc8, 0x83, 0x8b, 0x33, 0xb0, 0x34, 0xb5, 0xa8, 0xd2, 0x2f, + 0x3f, 0x25, 0x55, 0x48, 0x5e, 0x0f, 0xd3, 0x58, 0x3d, 0x24, 0x4d, 0x52, 0x12, 0xd8, 0x14, 0x80, + 0xb4, 0x1a, 0x30, 0x3a, 0xf9, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, + 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, + 0x51, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x58, 0xbf, 0x6e, 0x5e, + 0x6a, 0x49, 0x79, 0x7e, 0x51, 0x36, 0x94, 0x97, 0x58, 0x90, 0xa9, 0x9f, 0x9e, 0x8f, 0xe2, 0xf0, + 0x24, 0x36, 0xb0, 0xa3, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x12, 0x83, 0xba, 0x0b, + 0x01, 0x00, 0x00, +} + +// 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 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // QueryNode defines a method to query an Akash Provider worker node specs + QueryNode(ctx context.Context, in *VoidNoParam, opts ...grpc.CallOption) (Msg_QueryNodeClient, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) QueryNode(ctx context.Context, in *VoidNoParam, opts ...grpc.CallOption) (Msg_QueryNodeClient, error) { + stream, err := c.cc.NewStream(ctx, &_Msg_serviceDesc.Streams[0], "/akash.inventory.v1.Msg/QueryNode", opts...) + if err != nil { + return nil, err + } + x := &msgQueryNodeClient{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 Msg_QueryNodeClient interface { + Recv() (*Node, error) + grpc.ClientStream +} + +type msgQueryNodeClient struct { + grpc.ClientStream +} + +func (x *msgQueryNodeClient) Recv() (*Node, error) { + m := new(Node) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // QueryNode defines a method to query an Akash Provider worker node specs + QueryNode(*VoidNoParam, Msg_QueryNodeServer) error +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) QueryNode(req *VoidNoParam, srv Msg_QueryNodeServer) error { + return status.Errorf(codes.Unimplemented, "method QueryNode not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_QueryNode_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(VoidNoParam) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(MsgServer).QueryNode(m, &msgQueryNodeServer{stream}) +} + +type Msg_QueryNodeServer interface { + Send(*Node) error + grpc.ServerStream +} + +type msgQueryNodeServer struct { + grpc.ServerStream +} + +func (x *msgQueryNodeServer) Send(m *Node) error { + return x.ServerStream.SendMsg(m) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "akash.inventory.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "QueryNode", + Handler: _Msg_QueryNode_Handler, + ServerStreams: true, + }, + }, + Metadata: "akash/inventory/v1/service.proto", +} + +func (m *VoidNoParam) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VoidNoParam) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VoidNoParam) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintService(dAtA []byte, offset int, v uint64) int { + offset -= sovService(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *VoidNoParam) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovService(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozService(x uint64) (n int) { + return sovService(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *VoidNoParam) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: voidNoParam: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: voidNoParam: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipService(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowService + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowService + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowService + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthService + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupService + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthService + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthService = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowService = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupService = fmt.Errorf("proto: unexpected end of group") +) diff --git a/go/inventory/v1/storage.pb.go b/go/inventory/v1/storage.pb.go new file mode 100644 index 00000000..ceb73cee --- /dev/null +++ b/go/inventory/v1/storage.pb.go @@ -0,0 +1,604 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: akash/inventory/v1/storage.proto + +package v1 + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/golang/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// 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.ProtoPackageIsVersion3 // please upgrade the proto package + +type StorageInfo struct { + Class string `protobuf:"bytes,1,opt,name=class,proto3" json:"class" yaml:"class"` + IOPS string `protobuf:"bytes,2,opt,name=IOPS,proto3" json:"iops" yaml:"iops"` +} + +func (m *StorageInfo) Reset() { *m = StorageInfo{} } +func (m *StorageInfo) String() string { return proto.CompactTextString(m) } +func (*StorageInfo) ProtoMessage() {} +func (*StorageInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_98ef685b221b1af7, []int{0} +} +func (m *StorageInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StorageInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StorageInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StorageInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_StorageInfo.Merge(m, src) +} +func (m *StorageInfo) XXX_Size() int { + return m.Size() +} +func (m *StorageInfo) XXX_DiscardUnknown() { + xxx_messageInfo_StorageInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_StorageInfo proto.InternalMessageInfo + +func (m *StorageInfo) GetClass() string { + if m != nil { + return m.Class + } + return "" +} + +func (m *StorageInfo) GetIOPS() string { + if m != nil { + return m.IOPS + } + return "" +} + +type Storage struct { + Quantity ResourcePair `protobuf:"bytes,1,opt,name=quantity,proto3" json:"quantity" yaml:"quantity"` + Info StorageInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info" yaml:"info"` +} + +func (m *Storage) Reset() { *m = Storage{} } +func (m *Storage) String() string { return proto.CompactTextString(m) } +func (*Storage) ProtoMessage() {} +func (*Storage) Descriptor() ([]byte, []int) { + return fileDescriptor_98ef685b221b1af7, []int{1} +} +func (m *Storage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Storage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Storage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Storage) XXX_Merge(src proto.Message) { + xxx_messageInfo_Storage.Merge(m, src) +} +func (m *Storage) XXX_Size() int { + return m.Size() +} +func (m *Storage) XXX_DiscardUnknown() { + xxx_messageInfo_Storage.DiscardUnknown(m) +} + +var xxx_messageInfo_Storage proto.InternalMessageInfo + +func (m *Storage) GetQuantity() ResourcePair { + if m != nil { + return m.Quantity + } + return ResourcePair{} +} + +func (m *Storage) GetInfo() StorageInfo { + if m != nil { + return m.Info + } + return StorageInfo{} +} + +func init() { + proto.RegisterType((*StorageInfo)(nil), "akash.inventory.v1.StorageInfo") + proto.RegisterType((*Storage)(nil), "akash.inventory.v1.Storage") +} + +func init() { proto.RegisterFile("akash/inventory/v1/storage.proto", fileDescriptor_98ef685b221b1af7) } + +var fileDescriptor_98ef685b221b1af7 = []byte{ + // 354 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x51, 0xbf, 0x4e, 0xc2, 0x40, + 0x1c, 0x6e, 0x4d, 0x51, 0x6c, 0x4d, 0x4c, 0x1a, 0x07, 0xc2, 0xd0, 0x23, 0x67, 0x4c, 0x5c, 0x6c, + 0x03, 0x2c, 0xc6, 0xb1, 0x4e, 0x4c, 0x62, 0x59, 0x8c, 0xdb, 0x41, 0xda, 0x72, 0x01, 0xee, 0x57, + 0xaf, 0x05, 0x43, 0xe2, 0x43, 0x38, 0xfa, 0x48, 0x8c, 0xc4, 0xc9, 0xe9, 0x62, 0xda, 0x8d, 0x91, + 0x27, 0x30, 0xbd, 0xab, 0x04, 0x23, 0x5b, 0xbf, 0x7f, 0xf7, 0xf5, 0xbb, 0x33, 0x5b, 0x64, 0x42, + 0xd2, 0xb1, 0x47, 0xd9, 0x22, 0x64, 0x19, 0xf0, 0xa5, 0xb7, 0x68, 0x7b, 0x69, 0x06, 0x9c, 0xc4, + 0xa1, 0x9b, 0x70, 0xc8, 0xc0, 0xb6, 0xa5, 0xc3, 0xdd, 0x39, 0xdc, 0x45, 0xbb, 0x79, 0x11, 0x43, + 0x0c, 0x52, 0xf6, 0xca, 0x2f, 0xe5, 0x6c, 0x5e, 0x1d, 0x38, 0x8b, 0x87, 0x29, 0xcc, 0xf9, 0x28, + 0x4c, 0x08, 0xe5, 0xca, 0x86, 0xdf, 0x4c, 0x6b, 0xa0, 0x1a, 0x7a, 0x2c, 0x02, 0xfb, 0xd6, 0xac, + 0x8d, 0xa6, 0x24, 0x4d, 0x1b, 0x7a, 0x4b, 0xbf, 0x3e, 0xf5, 0x71, 0x2e, 0x50, 0xed, 0xbe, 0x24, + 0x36, 0x02, 0x29, 0x65, 0x2b, 0xd0, 0xd9, 0x92, 0xcc, 0xa6, 0x77, 0x58, 0x42, 0x1c, 0x28, 0xda, + 0xee, 0x9a, 0x46, 0xef, 0xa1, 0x3f, 0x68, 0x1c, 0xc9, 0x20, 0xca, 0x05, 0x92, 0x78, 0x23, 0x90, + 0x41, 0x21, 0x29, 0x63, 0x96, 0x8a, 0x95, 0x08, 0x07, 0x52, 0xc4, 0x9f, 0xba, 0x79, 0x52, 0xd5, + 0xdb, 0x33, 0xb3, 0xfe, 0x32, 0x27, 0x2c, 0xa3, 0xd9, 0x52, 0xb6, 0x5b, 0x9d, 0x96, 0xfb, 0x7f, + 0xad, 0x1b, 0x54, 0x1b, 0xfa, 0x84, 0x72, 0xdf, 0x5b, 0x09, 0xa4, 0xe5, 0x02, 0xd5, 0x1f, 0xab, + 0xe4, 0x46, 0xa0, 0xdd, 0x29, 0x5b, 0x81, 0xce, 0x55, 0xe5, 0x2f, 0x83, 0x83, 0x9d, 0x68, 0x3f, + 0x99, 0x06, 0x65, 0x11, 0xc8, 0xff, 0xb5, 0x3a, 0xe8, 0x50, 0xd5, 0xde, 0xc5, 0xf8, 0x97, 0x55, + 0x93, 0x51, 0x22, 0x39, 0x8a, 0x45, 0xb0, 0x37, 0x8a, 0x45, 0x80, 0x03, 0x49, 0xfa, 0xfd, 0x55, + 0xee, 0xe8, 0xeb, 0xdc, 0xd1, 0xbf, 0x73, 0x47, 0x7f, 0x2f, 0x1c, 0xed, 0xa3, 0x70, 0xb4, 0x75, + 0xe1, 0x68, 0x5f, 0x85, 0xa3, 0x3d, 0x77, 0x62, 0x9a, 0x8d, 0xe7, 0x43, 0x77, 0x04, 0x33, 0x4f, + 0x76, 0xde, 0xb0, 0x30, 0x7b, 0x05, 0x3e, 0xa9, 0x10, 0x49, 0xa8, 0x17, 0xc3, 0x9f, 0x77, 0x1b, + 0x1e, 0xcb, 0xb7, 0xea, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0xad, 0xe9, 0xbb, 0xb5, 0x20, 0x02, + 0x00, 0x00, +} + +func (m *StorageInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StorageInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StorageInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.IOPS) > 0 { + i -= len(m.IOPS) + copy(dAtA[i:], m.IOPS) + i = encodeVarintStorage(dAtA, i, uint64(len(m.IOPS))) + i-- + dAtA[i] = 0x12 + } + if len(m.Class) > 0 { + i -= len(m.Class) + copy(dAtA[i:], m.Class) + i = encodeVarintStorage(dAtA, i, uint64(len(m.Class))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Storage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Storage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Storage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Info.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Quantity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintStorage(dAtA []byte, offset int, v uint64) int { + offset -= sovStorage(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *StorageInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Class) + if l > 0 { + n += 1 + l + sovStorage(uint64(l)) + } + l = len(m.IOPS) + if l > 0 { + n += 1 + l + sovStorage(uint64(l)) + } + return n +} + +func (m *Storage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Quantity.Size() + n += 1 + l + sovStorage(uint64(l)) + l = m.Info.Size() + n += 1 + l + sovStorage(uint64(l)) + return n +} + +func sovStorage(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozStorage(x uint64) (n int) { + return sovStorage(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *StorageInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStorage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StorageInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StorageInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Class", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStorage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthStorage + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStorage + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Class = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IOPS", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStorage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthStorage + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStorage + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IOPS = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStorage(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStorage + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Storage) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStorage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Storage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Storage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quantity", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStorage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStorage + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStorage + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Quantity.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStorage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStorage + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStorage + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStorage(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStorage + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipStorage(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStorage + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStorage + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowStorage + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthStorage + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStorage + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthStorage + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthStorage = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStorage = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStorage = fmt.Errorf("proto: unexpected end of group") +) diff --git a/go/inventory/v1/types.go b/go/inventory/v1/types.go new file mode 100644 index 00000000..5718e8e7 --- /dev/null +++ b/go/inventory/v1/types.go @@ -0,0 +1,109 @@ +package v1 + +import ( + "sort" +) + +type CPUInfoS []CPUInfo +type GPUs []GPU + +type Nodes []Node +type ClusterStorage []Storage + +var _ sort.Interface = (*GPUs)(nil) +var _ sort.Interface = (*CPUInfoS)(nil) +var _ sort.Interface = (*ClusterStorage)(nil) + +func (s CPUInfoS) Len() int { + return len(s) +} + +func (s CPUInfoS) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} + +func (s CPUInfoS) Less(i, j int) bool { + a, b := s[i], s[j] + + if a.Vendor != b.Vendor { + return a.Vendor < b.Vendor + } + + if a.ID != b.ID { + return a.ID < b.ID + } + + if a.Model != b.Model { + return a.Model < b.Model + } + + return false +} + +func (s GPUs) Len() int { + return len(s) +} + +func (s GPUs) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} + +func (s GPUs) Less(i, j int) bool { + a, b := s[i], s[j] + + if !a.Quantity.Equal(b.Quantity) { + return a.Quantity.LT(b.Quantity) + } + + if a.Info.Vendor != b.Info.Vendor { + return a.Info.Vendor < b.Info.Vendor + } + + if a.Info.Vendor != b.Info.Vendor { + return a.Info.Vendor < b.Info.Vendor + } + + if a.Info.Name != b.Info.Name { + return a.Info.Name < b.Info.Name + } + + if a.Info.ModelID != b.Info.ModelID { + return a.Info.ModelID < b.Info.ModelID + } + + if a.Info.Interface != b.Info.Interface { + return a.Info.Interface < b.Info.Interface + } + + if a.Info.MemorySize != b.Info.MemorySize { + return a.Info.MemorySize < b.Info.MemorySize + } + + return false +} + +func (s ClusterStorage) Len() int { + return len(s) +} + +func (s ClusterStorage) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} + +func (s ClusterStorage) Less(i, j int) bool { + a, b := s[i], s[j] + + if !a.Quantity.Equal(b.Quantity) { + return a.Quantity.LT(b.Quantity) + } + + if a.Info.Class != b.Info.Class { + return a.Info.Class < b.Info.Class + } + + if a.Info.IOPS != b.Info.IOPS { + return a.Info.IOPS < b.Info.IOPS + } + + return false +} diff --git a/make/mod.mk b/make/mod.mk index e7693bad..b91d6654 100644 --- a/make/mod.mk +++ b/make/mod.mk @@ -30,9 +30,11 @@ modsensure: deps-tidy deps-vendor modvendor: export VENDOR_BUF:=$(VENDOR_BUF) modvendor: $(MODVENDOR) modsensure @echo "vendoring non-go files..." - $(MODVENDOR) -copy="**/*.proto" -include=github.com/cosmos/cosmos-sdk/proto,github.com/cosmos/cosmos-sdk/third_party/proto,github.com/cosmos/ibc-go/v3/proto + $(MODVENDOR) -copy="**/*.proto" -include=github.com/cosmos/cosmos-sdk/proto,github.com/cosmos/cosmos-sdk/third_party/proto $(MODVENDOR) -copy="**/Makefile" -include=github.com/cosmos/gogoproto $(MODVENDOR) -copy="**/*.proto" -include=github.com/cosmos/cosmos-proto/proto $(MODVENDOR) -copy="**/swagger.yaml" -include=github.com/cosmos/cosmos-proto/client/docs/swagger-ui + $(MODVENDOR) -copy="**/*.proto" -include=k8s.io/apimachinery + @echo "$${VENDOR_BUF}" > vendor/k8s.io/apimachinery/pkg/api/resource/buf.yaml @echo "$${VENDOR_BUF}" > vendor/github.com/cosmos/cosmos-sdk/proto/buf.yaml @echo "$${VENDOR_BUF}" > vendor/github.com/cosmos/cosmos-sdk/third_party/proto/buf.yaml diff --git a/proto/provider/akash/inventory/v1/cluster.proto b/proto/provider/akash/inventory/v1/cluster.proto new file mode 100644 index 00000000..c271ce7a --- /dev/null +++ b/proto/provider/akash/inventory/v1/cluster.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package akash.inventory.v1; + +import "gogoproto/gogo.proto"; +import "akash/inventory/v1/node.proto"; +import "akash/inventory/v1/resourcepair.proto"; +import "akash/inventory/v1/storage.proto"; + +option go_package = "github.com/akash-network/akash-api/go/inventory/v1"; + +message Cluster { + option (gogoproto.equal) = false; + + repeated Node nodes = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "Nodes", + (gogoproto.customname) = "Nodes", + (gogoproto.jsontag) = "nodes", + (gogoproto.moretags) = "yaml:\"nodes\"" + ]; + + repeated Storage storage = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "ClusterStorage", + (gogoproto.customname) = "Storage", + (gogoproto.jsontag) = "storage", + (gogoproto.moretags) = "yaml:\"storage\"" + ]; +} diff --git a/proto/provider/akash/inventory/v1/cpu.proto b/proto/provider/akash/inventory/v1/cpu.proto new file mode 100644 index 00000000..73e3e529 --- /dev/null +++ b/proto/provider/akash/inventory/v1/cpu.proto @@ -0,0 +1,49 @@ +syntax = "proto3"; +package akash.inventory.v1; + +import "gogoproto/gogo.proto"; + +import "akash/inventory/v1/resourcepair.proto"; + +option go_package = "github.com/akash-network/akash-api/go/inventory/v1"; +option (gogoproto.gogoproto_import) = false; + +message CPUInfo { + string id = 1 [ + (gogoproto.customname) = "ID", + (gogoproto.jsontag) = "id", + (gogoproto.moretags) = "yaml:\"id\"" + ]; + string vendor = 2 [ + (gogoproto.customname) = "Vendor", + (gogoproto.jsontag) = "vendor", + (gogoproto.moretags) = "yaml:\"vendor\"" + ]; + string model = 3 [ + (gogoproto.customname) = "Model", + (gogoproto.jsontag) = "model", + (gogoproto.moretags) = "yaml:\"model\"" + ]; + uint32 vcores = 4 [ + (gogoproto.customname) = "Vcores", + (gogoproto.jsontag) = "vcores", + (gogoproto.moretags) = "yaml:\"vcores\"" + ]; +} + +message CPU { + ResourcePair quantity = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customname) = "Quantity", + (gogoproto.jsontag) = "quantity", + (gogoproto.moretags) = "yaml:\"quantity\"" + ]; + + repeated CPUInfo info = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "CPUInfoS", + (gogoproto.customname) = "Info", + (gogoproto.jsontag) = "info", + (gogoproto.moretags) = "yaml:\"info\"" + ]; +} diff --git a/proto/provider/akash/inventory/v1/gpu.proto b/proto/provider/akash/inventory/v1/gpu.proto new file mode 100644 index 00000000..cf8bd114 --- /dev/null +++ b/proto/provider/akash/inventory/v1/gpu.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; + +package akash.inventory.v1; + +import "gogoproto/gogo.proto"; + +import "akash/inventory/v1/resourcepair.proto"; + +option go_package = "github.com/akash-network/akash-api/go/inventory/v1"; +option (gogoproto.gogoproto_import) = false; + +message GPUInfo { + string vendor = 1 [ + (gogoproto.customname) = "Vendor", + (gogoproto.jsontag) = "vendor", + (gogoproto.moretags) = "yaml:\"vendor\"" + ]; + string name = 2 [ + (gogoproto.customname) = "Name", + (gogoproto.jsontag) = "name", + (gogoproto.moretags) = "yaml:\"name\"" + ]; + string modelid = 3 [ + (gogoproto.customname) = "ModelID", + (gogoproto.jsontag) = "model_id", + (gogoproto.moretags) = "yaml:\"model_id\"" + ]; + string interface = 4 [ + (gogoproto.customname) = "Interface", + (gogoproto.jsontag) = "interface", + (gogoproto.moretags) = "yaml:\"interface\"" + ]; + string memory_size = 5 [ + (gogoproto.customname) = "MemorySize", + (gogoproto.jsontag) = "memory_size", + (gogoproto.moretags) = "yaml:\"memory_size\"" + ]; +} + +message GPU { + ResourcePair quantity = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customname) = "Quantity", + (gogoproto.jsontag) = "quantity", + (gogoproto.moretags) = "yaml:\"quantity\"" + ]; + GPUInfo info = 2 [ + (gogoproto.nullable) = false, + (gogoproto.customname) = "Info", + (gogoproto.jsontag) = "info", + (gogoproto.moretags) = "yaml:\"info\"" + ]; +} diff --git a/proto/provider/akash/inventory/v1/memory.proto b/proto/provider/akash/inventory/v1/memory.proto new file mode 100644 index 00000000..9b281b1d --- /dev/null +++ b/proto/provider/akash/inventory/v1/memory.proto @@ -0,0 +1,49 @@ +syntax = "proto3"; + +package akash.inventory.v1; + +import "gogoproto/gogo.proto"; + +import "akash/inventory/v1/resourcepair.proto"; + +option go_package = "github.com/akash-network/akash-api/go/inventory/v1"; +option (gogoproto.gogoproto_import) = false; + +message MemoryInfo { + string vendor = 1 [ + (gogoproto.customname) = "Vendor", + (gogoproto.jsontag) = "vendor", + (gogoproto.moretags) = "yaml:\"vendor\"" + ]; + string type = 2 [ + (gogoproto.customname) = "Type", + (gogoproto.jsontag) = "type", + (gogoproto.moretags) = "yaml:\"type\"" + ]; + string total_size = 3 [ + (gogoproto.customname) = "TotalSize", + (gogoproto.jsontag) = "total_size", + (gogoproto.moretags) = "yaml:\"total_size\"" + ]; + string speed = 4 [ + (gogoproto.customname) = "Speed", + (gogoproto.jsontag) = "speed", + (gogoproto.moretags) = "yaml:\"speed\"" + ]; +} + +message Memory { + ResourcePair quantity = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customname) = "Quantity", + (gogoproto.jsontag) = "quantity", + (gogoproto.moretags) = "yaml:\"quantity\"" + ]; + + repeated MemoryInfo info = 2 [ + (gogoproto.nullable) = false, + (gogoproto.customname) = "Info", + (gogoproto.jsontag) = "info", + (gogoproto.moretags) = "yaml:\"info\"" + ]; +} diff --git a/proto/provider/akash/inventory/v1/node.proto b/proto/provider/akash/inventory/v1/node.proto new file mode 100644 index 00000000..94ff9d64 --- /dev/null +++ b/proto/provider/akash/inventory/v1/node.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package akash.inventory.v1; + +import "gogoproto/gogo.proto"; +import "akash/inventory/v1/cpu.proto"; +import "akash/inventory/v1/gpu.proto"; +import "akash/inventory/v1/storage.proto"; +import "akash/inventory/v1/memory.proto"; + + +option go_package = "github.com/akash-network/akash-api/go/inventory/v1"; + +message Node { + CPU cpu = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customname) = "CPU", + (gogoproto.jsontag) = "cpu", + (gogoproto.moretags) = "yaml:\"cpu\"" + ]; + + Memory memory = 2 [ + (gogoproto.nullable) = false, + (gogoproto.customname) = "Memory", + (gogoproto.jsontag) = "memory", + (gogoproto.moretags) = "yaml:\"memory\"" + ]; + + repeated GPU gpu = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "GPUs", + (gogoproto.customname) = "Gpus", + (gogoproto.jsontag) = "gpus", + (gogoproto.moretags) = "yaml:\"gpus\"" + ]; + + repeated Storage storage = 4 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "ClusterStorage", + (gogoproto.customname) = "Storage", + (gogoproto.jsontag) = "storage", + (gogoproto.moretags) = "yaml:\"storage\"" + ]; +} diff --git a/proto/provider/akash/inventory/v1/resourcepair.proto b/proto/provider/akash/inventory/v1/resourcepair.proto new file mode 100644 index 00000000..0404d213 --- /dev/null +++ b/proto/provider/akash/inventory/v1/resourcepair.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package akash.inventory.v1; + +import "akash/base/v1beta3/attribute.proto"; +import "gogoproto/gogo.proto"; +import "k8s.io/apimachinery/pkg/api/resource/generated.proto"; + +option go_package = "github.com/akash-network/akash-api/go/inventory/v1"; +option (gogoproto.gogoproto_import) = false; + +message ResourcePair { + option (gogoproto.equal) = false; + + k8s.io.apimachinery.pkg.api.resource.Quantity allocatable = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customname) = "Allocatable", + (gogoproto.jsontag) = "allocatable", + (gogoproto.moretags) = "yaml:\"allocatable\"" + ]; + k8s.io.apimachinery.pkg.api.resource.Quantity allocated = 2 [ + (gogoproto.nullable) = false, + (gogoproto.customname) = "Allocated", + (gogoproto.jsontag) = "allocated", + (gogoproto.moretags) = "yaml:\"allocated\"" + ]; + repeated akash.base.v1beta3.Attribute attributes = 3 [ + (gogoproto.nullable) = true, + (gogoproto.jsontag) = "attributes,omitempty", + (gogoproto.moretags) = "yaml:\"attributes,omitempty\"" + ]; +} diff --git a/proto/provider/akash/inventory/v1/service.proto b/proto/provider/akash/inventory/v1/service.proto new file mode 100644 index 00000000..42658369 --- /dev/null +++ b/proto/provider/akash/inventory/v1/service.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package akash.inventory.v1; + +import "akash/inventory/v1/node.proto"; + + +option go_package = "github.com/akash-network/akash-api/go/inventory/v1"; + +message voidNoParam {} + +// Msg defines the deployment Msg service. +service Msg { + // QueryNode defines a method to query an Akash Provider worker node specs + rpc QueryNode(voidNoParam) returns (stream Node); + +} \ No newline at end of file diff --git a/proto/provider/akash/inventory/v1/storage.proto b/proto/provider/akash/inventory/v1/storage.proto new file mode 100644 index 00000000..2ab086e2 --- /dev/null +++ b/proto/provider/akash/inventory/v1/storage.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; + +package akash.inventory.v1; + +import "gogoproto/gogo.proto"; + +import "akash/inventory/v1/resourcepair.proto"; + +option go_package = "github.com/akash-network/akash-api/go/inventory/v1"; +option (gogoproto.gogoproto_import) = false; + +message StorageInfo { + string class = 1 [ + (gogoproto.customname) = "Class", + (gogoproto.jsontag) = "class", + (gogoproto.moretags) = "yaml:\"class\"" + ]; + string IOPS = 2 [ + (gogoproto.customname) = "IOPS", + (gogoproto.jsontag) = "iops", + (gogoproto.moretags) = "yaml:\"iops\"" + ]; + } + + message Storage { + ResourcePair quantity = 1 [ + (gogoproto.nullable) = false, + (gogoproto.customname) = "Quantity", + (gogoproto.jsontag) = "quantity", + (gogoproto.moretags) = "yaml:\"quantity\"" + ]; + StorageInfo info = 2 [ + (gogoproto.nullable) = false, + (gogoproto.customname) = "Info", + (gogoproto.jsontag) = "info", + (gogoproto.moretags) = "yaml:\"info\"" + ]; + } diff --git a/script/protocgen-legacy.sh b/script/protocgen-legacy.sh index dc869b13..d26e846a 100755 --- a/script/protocgen-legacy.sh +++ b/script/protocgen-legacy.sh @@ -39,6 +39,7 @@ for dir in $proto_dirs; do -I "proto/node" \ -I "vendor/github.com/cosmos/cosmos-sdk/proto" \ -I "vendor/github.com/cosmos/cosmos-sdk/third_party/proto" \ + -I "vendor" \ --gocosmos_out=plugins=interfacetype+grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. \ $(find "${dir}" -maxdepth 1 -name '*.proto') done