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..8f94715a --- /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,casttype=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{ + // 312 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, 0x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98, 0xc4, 0x06, 0x0e, 0x3e, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x6e, 0x7d, 0x4d, 0xbd, 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, ClusterStorage{}) + 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..d9289cef --- /dev/null +++ b/go/inventory/v1/cpu.pb.go @@ -0,0 +1,710 @@ +// 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/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 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 nil +} + +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{ + // 418 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x41, 0x8b, 0xd3, 0x40, + 0x14, 0xc7, 0x3b, 0x69, 0xb7, 0xee, 0x4e, 0x5d, 0x84, 0xe0, 0x21, 0xae, 0x92, 0x57, 0x06, 0x16, + 0x2a, 0x62, 0xc2, 0xd6, 0x8b, 0x08, 0x5e, 0xba, 0x5e, 0x16, 0x14, 0x6a, 0x60, 0x3d, 0x78, 0xcb, + 0x36, 0x69, 0x77, 0xd8, 0xed, 0x4c, 0x9d, 0x26, 0x91, 0x7e, 0x0b, 0x3f, 0x93, 0x27, 0x8f, 0x7b, + 0xf4, 0x34, 0xc8, 0xf4, 0x16, 0x3c, 0xe5, 0x13, 0x48, 0xde, 0x8c, 0x45, 0xd9, 0xde, 0xde, 0xfb, + 0xff, 0xdf, 0x7f, 0x7e, 0xe4, 0xe5, 0xd1, 0x67, 0xe9, 0x4d, 0xba, 0xbe, 0x8e, 0xb9, 0xa8, 0x72, + 0x51, 0x48, 0xb5, 0x89, 0xab, 0xb3, 0x78, 0xb6, 0x2a, 0xa3, 0x95, 0x92, 0x85, 0xf4, 0x7d, 0x74, + 0xa3, 0x9d, 0x1b, 0x55, 0x67, 0x27, 0x8f, 0x17, 0x72, 0x21, 0xd1, 0x8e, 0xdb, 0xca, 0x4e, 0x9e, + 0x9c, 0xee, 0x79, 0x47, 0xe5, 0x6b, 0x59, 0xaa, 0x59, 0xbe, 0x4a, 0xb9,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0x0d, 0xbb, 0xa3, 0xc1, 0xf8, 0xe9, 0x3e, 0x8c, 0xfb, 0x01, 0x13, 0x30, 0x1a, 0x7a, 0x6d, + 0x55, 0x6b, 0xc0, 0x50, 0xa3, 0x61, 0xe0, 0x16, 0x2f, 0xe6, 0x92, 0x25, 0x28, 0x4e, 0xde, 0xff, + 0x30, 0x21, 0xb9, 0x33, 0x21, 0xf9, 0x65, 0x42, 0xf2, 0x6d, 0x1b, 0x76, 0xee, 0xb6, 0x61, 0xe7, + 0xe7, 0x36, 0xec, 0x7c, 0x1e, 0x2f, 0x78, 0x71, 0x5d, 0x5e, 0x45, 0x33, 0xb9, 0x8c, 0x91, 0xf3, + 0x52, 0xe4, 0xc5, 0x57, 0xa9, 0x6e, 0x5c, 0x97, 0xae, 0x78, 0xbc, 0x90, 0xff, 0x1d, 0xc5, 0x55, + 0x1f, 0x0f, 0xe1, 0xd5, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x23, 0x41, 0x15, 0x12, 0x79, 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 + } + } + if m.Quantity != nil { + { + 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 + if m.Quantity != nil { + 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 m.Quantity == nil { + m.Quantity = &ResourcePair{} + } + 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..ba652d56 --- /dev/null +++ b/go/inventory/v1/gpu.pb.go @@ -0,0 +1,778 @@ +// 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/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 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:"modelid" yaml:"modelid"` + Interface string `protobuf:"bytes,4,opt,name=interface,proto3" json:"interface" yaml:"interface"` + Memory string `protobuf:"bytes,5,opt,name=memory,proto3" json:"memory" yaml:"memory"` +} + +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) GetMemory() string { + if m != nil { + return m.Memory + } + return "" +} + +type GPU struct { + Quantity *ResourcePair `protobuf:"bytes,1,opt,name=quantity,proto3" json:"quantity" yaml:"quantity"` + Info []*GPUInfo `protobuf:"bytes,2,rep,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 nil +} + +func (m *GPU) GetInfo() []*GPUInfo { + if m != nil { + return m.Info + } + return nil +} + +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{ + // 448 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcf, 0x6a, 0xdb, 0x40, + 0x10, 0xc6, 0x2d, 0xdb, 0xb5, 0xe3, 0x35, 0xfd, 0x83, 0xe8, 0x41, 0xa4, 0x45, 0x63, 0x16, 0x02, + 0x86, 0x52, 0x89, 0x38, 0xb7, 0x42, 0x2f, 0xa6, 0x10, 0x0c, 0x49, 0x71, 0x05, 0xe9, 0xa1, 0xb7, + 0x8d, 0xbd, 0x56, 0x96, 0x44, 0xbb, 0xee, 0x46, 0x76, 0xf1, 0x5b, 0xf4, 0x99, 0x7a, 0xea, 0xa9, + 0xe4, 0xd8, 0xd3, 0x52, 0xe4, 0x9b, 0x8e, 0x7a, 0x82, 0xb2, 0x7f, 0x2c, 0x51, 0x9a, 0xdb, 0xce, + 0xf7, 0x9b, 0x6f, 0x06, 0xe6, 0x5b, 0xf4, 0x9a, 0xdc, 0x92, 0xfb, 0x9b, 0x98, 0xf1, 0x2d, 0xe5, + 0xb9, 0x90, 0xbb, 0x78, 0x7b, 0x1a, 0xa7, 0xeb, 0x4d, 0xb4, 0x96, 0x22, 0x17, 0xbe, 0x6f, 0x68, + 0x54, 0xd3, 0x68, 0x7b, 0x7a, 0xfc, 0x32, 0x15, 0xa9, 0x30, 0x38, 0xd6, 0x2f, 0xdb, 0x79, 0x7c, + 0xf2, 0xc8, 0x1c, 0x49, 0xef, 0xc5, 0x46, 0x2e, 0xe8, 0x9a, 0x30, 0x69, 0xdb, 0xf0, 0xaf, 0x36, + 0xea, 0x9f, 0x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0xdf, 0x14, 0x0a, 0x8e, 0x3e, 0x39, 0x57, + 0xa9, 0xa0, 0x9e, 0x50, 0x29, 0x78, 0x6e, 0xd7, 0x1d, 0x14, 0x9c, 0xd4, 0xd0, 0x9f, 0xa3, 0x2e, + 0xe3, 0x2b, 0x11, 0xb4, 0x47, 0x9d, 0xf1, 0x70, 0xf2, 0xea, 0xb1, 0x35, 0x2e, 0x62, 0x9b, 0x8a, + 0x7e, 0xe9, 0x54, 0xb4, 0xa9, 0x49, 0x45, 0x57, 0x38, 0x31, 0xe2, 0xf4, 0xe2, 0x67, 0x11, 0x7a, + 0x0f, 0x45, 0xe8, 0xfd, 0x29, 0x42, 0xef, 0xfb, 0x3e, 0x6c, 0x3d, 0xec, 0xc3, 0xd6, 0xef, 0x7d, + 0xd8, 0xfa, 0x32, 0x49, 0x59, 0x7e, 0xb3, 0xb9, 0x8e, 0x16, 0x22, 0x8b, 0xcd, 0x9e, 0xb7, 0x9c, + 0xe6, 0xdf, 0x84, 0xbc, 0x75, 0x15, 0x59, 0xb3, 0x38, 0x15, 0xff, 0x7c, 0xbb, 0xeb, 0x9e, 0xf9, + 0x6a, 0x67, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x72, 0x70, 0x9d, 0xb3, 0xdb, 0x02, 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.Memory) > 0 { + i -= len(m.Memory) + copy(dAtA[i:], m.Memory) + i = encodeVarintGpu(dAtA, i, uint64(len(m.Memory))) + 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 + 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 = encodeVarintGpu(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Quantity != nil { + { + 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.Memory) + 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 + if m.Quantity != nil { + l = m.Quantity.Size() + n += 1 + l + sovGpu(uint64(l)) + } + if len(m.Info) > 0 { + for _, e := range m.Info { + l = e.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 Memory", 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.Memory = 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 m.Quantity == nil { + m.Quantity = &ResourcePair{} + } + 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 + } + m.Info = append(m.Info, &GPUInfo{}) + if err := m.Info[len(m.Info)-1].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..0b15525e --- /dev/null +++ b/go/inventory/v1/memory.pb.go @@ -0,0 +1,725 @@ +// 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/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 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"` + Size_ string `protobuf:"bytes,3,opt,name=size,proto3" json:"size" yaml:"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) GetSize_() string { + if m != nil { + return m.Size_ + } + 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 nil +} + +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{ + // 405 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x41, 0x8b, 0xda, 0x40, + 0x1c, 0xc5, 0x8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b, 0xd0, + 0x57, 0xaf, 0x63, 0x69, 0xc8, 0x17, 0x31, 0x7b, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x57, 0x57, 0x22, + 0x9e, 0x85, 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.Size_) > 0 { + i -= len(m.Size_) + copy(dAtA[i:], m.Size_) + i = encodeVarintMemory(dAtA, i, uint64(len(m.Size_))) + 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 + } + } + if m.Quantity != nil { + { + 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.Size_) + 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 + if m.Quantity != nil { + 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 Size_", 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.Size_ = 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 m.Quantity == nil { + m.Quantity = &ResourcePair{} + } + 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..2044b47d --- /dev/null +++ b/go/inventory/v1/node.pb.go @@ -0,0 +1,491 @@ +// 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,castrepeated=CPUs" json:"cpu" yaml:"cpu"` + Memory Memory `protobuf:"bytes,2,opt,name=memory,proto3,castrepeated=Memory" json:"memory" yaml:"memory"` + Gpus GPU `protobuf:"bytes,3,opt,name=gpu,proto3,castrepeated=GPUs" json:"gpus" yaml:"gpus"` + Storage Storage `protobuf:"bytes,4,opt,name=storage,proto3,castrepeated=Storage" 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() GPU { + if m != nil { + return m.Gpus + } + return GPU{} +} + +func (m *Node) GetStorage() Storage { + if m != nil { + return m.Storage + } + return Storage{} +} + +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{ + // 385 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xc1, 0x6a, 0xa3, 0x40, + 0x1c, 0xc6, 0x75, 0x95, 0x04, 0x0c, 0xbb, 0x07, 0x59, 0x58, 0x71, 0x77, 0x9d, 0x90, 0x53, 0xa0, + 0x54, 0x49, 0x72, 0x28, 0xf4, 0x68, 0x0e, 0xb9, 0xb4, 0x45, 0x12, 0xec, 0xa1, 0x37, 0x63, 0x64, + 0x12, 0x52, 0x9d, 0x41, 0x9d, 0x94, 0xbc, 0x43, 0x0f, 0x7d, 0x8e, 0x3e, 0x49, 0x8e, 0x39, 0xf6, + 0x34, 0x2d, 0xe6, 0xe6, 0xd1, 0x27, 0x28, 0xce, 0x4c, 0x02, 0xa5, 0xb6, 0x37, 0xff, 0xf3, 0xfd, + 0xfe, 0xdf, 0xf7, 0x8d, 0xa3, 0xfd, 0x0f, 0xd6, 0x41, 0xb6, 0x74, 0x56, 0xc9, 0x26, 0x4a, 0x72, + 0x94, 0x6e, 0x9d, 0xcd, 0xc0, 0x49, 0xd0, 0x22, 0xb2, 0x71, 0x8a, 0x72, 0xa4, 0xeb, 0x4c, 0xb6, + 0x4f, 0xb2, 0xbd, 0x19, 0x98, 0xbf, 0x21, 0x82, 0x88, 0xc9, 0x4e, 0xfd, 0xc5, 0x49, 0xf3, 0x5f, + 0x83, 0x51, 0x88, 0xc9, 0x37, 0x2a, 0x3c, 0xa9, 0xdd, 0x06, 0x35, 0xcb, 0x51, 0x1a, 0x40, 0xd1, + 0xc3, 0x04, 0x0d, 0x44, 0x1c, 0xc5, 0x75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fe, 0x60, 0x49, + 0x2f, 0x07, 0x4b, 0xba, 0x1b, 0xc2, 0x55, 0xbe, 0x24, 0x73, 0x3b, 0x44, 0xb1, 0xc3, 0x2a, 0x9c, + 0x27, 0x51, 0xfe, 0x80, 0xd2, 0xb5, 0x98, 0x02, 0xbc, 0x72, 0x20, 0xfa, 0xf0, 0xd2, 0xf3, 0x16, + 0x7b, 0xe3, 0xd1, 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, 0x69, 0x72, 0x8d, 0xb4, 0xad, 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 + { + size, err := m.Storage.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.Gpus.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)) + l = m.Gpus.Size() + n += 1 + l + sovNode(uint64(l)) + l = m.Storage.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 + } + if err := m.Gpus.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 + } + if err := m.Storage.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..dcabf4a4 --- /dev/null +++ b/go/inventory/v1/resourcepair.go @@ -0,0 +1,9 @@ +package v1 + +func (m *ResourcePair) Equal(rhs ResourcePair) bool { + if m == nil { + return false + } + + return (m.Allocated.Cmp(rhs.Allocated) == 0) && (m.Allocatable.Cmp(rhs.Allocatable) == 0) +} diff --git a/go/inventory/v1/resourcepair.pb.go b/go/inventory/v1/resourcepair.pb.go new file mode 100644 index 00000000..88fe7dfe --- /dev/null +++ b/go/inventory/v1/resourcepair.pb.go @@ -0,0 +1,454 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: akash/inventory/v1/resourcepair.proto + +package v1 + +import ( + fmt "fmt" + github_com_akash_network_akash_api_go_node_types_v1beta3 "github.com/akash-network/akash-api/go/node/types/v1beta3" + v1beta3 "github.com/akash-network/akash-api/go/node/types/v1beta3" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/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.GoGoProtoPackageIsVersion3 // 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 github_com_akash_network_akash_api_go_node_types_v1beta3.Attributes `protobuf:"bytes,3,rep,name=attributes,proto3,castrepeated=github.com/akash-network/akash-api/go/node/types/v1beta3.Attributes" 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() github_com_akash_network_akash_api_go_node_types_v1beta3.Attributes { + 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{ + // 425 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0x3d, 0x8f, 0xd3, 0x30, + 0x18, 0x8e, 0x29, 0x42, 0xba, 0x94, 0x01, 0x45, 0x37, 0x54, 0x87, 0x88, 0x4f, 0x91, 0x90, 0x6e, + 0x00, 0x5b, 0xed, 0x31, 0x9c, 0x6e, 0x6b, 0x59, 0x19, 0x20, 0x23, 0x9b, 0x93, 0xbc, 0x4a, 0xad,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03, 0xba, 0xfe, 0x1d, 0x00, 0x00, 0xff, + 0xff, 0xc1, 0xb0, 0xd7, 0x21, 0xed, 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/storage.pb.go b/go/inventory/v1/storage.pb.go new file mode 100644 index 00000000..9c73e388 --- /dev/null +++ b/go/inventory/v1/storage.pb.go @@ -0,0 +1,724 @@ +// 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/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 StorageInfo struct { + Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor" yaml:"vendor"` + Class string `protobuf:"bytes,2,opt,name=class,proto3" json:"class" yaml:"class"` + Capacity string `protobuf:"bytes,3,opt,name=capacity,proto3" json:"capacity" yaml:"capacity"` + IO string `protobuf:"bytes,4,opt,name=IO,proto3" json:"io" yaml:"io"` +} + +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) GetVendor() string { + if m != nil { + return m.Vendor + } + return "" +} + +func (m *StorageInfo) GetClass() string { + if m != nil { + return m.Class + } + return "" +} + +func (m *StorageInfo) GetCapacity() string { + if m != nil { + return m.Capacity + } + return "" +} + +func (m *StorageInfo) GetIO() string { + if m != nil { + return m.IO + } + 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 nil +} + +func (m *Storage) GetInfo() *StorageInfo { + if m != nil { + return m.Info + } + return nil +} + +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{ + // 419 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0xb1, 0x8e, 0xd3, 0x40, + 0x10, 0x8d, 0x4d, 0x2e, 0xe4, 0x36, 0x20, 0xa4, 0x15, 0x45, 0xb8, 0xc2, 0x13, 0xad, 0x74, 0x12, + 0x08, 0x61, 0xeb, 0x42, 0x83, 0x90, 0x68, 0x72, 0x05, 0x8a, 0x84, 0x14, 0x30, 0x88, 0x82, 0x6e, + 0xcf, 0x38, 0xbe, 0xd5, 0xdd, 0xed, 0x84, 0xb5, 0x13, 0x94, 0xbf, 0xe0, 0xb3, 0x10, 0xd5, 0x95, + 0x54, 0x2b, 0xb4, 0xe9, 0x5c, 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, 0xdf, 0x96, 0x78, 0x64, + 0x34, 0x84, 0xf3, 0x45, 0xad, 0x21, 0x14, 0xd8, 0x68, 0x38, 0x74, 0x32, 0x81, 0x2c, 0x0d, 0xe7, + 0x0b, 0xf6, 0x23, 0x20, 0x77, 0xfd, 0xf0, 0x54, 0x90, 0xe1, 0x97, 0x35, 0x97, 0x55, 0xeb, 0xdf, + 0x8e, 0x3e, 0x9a, 0x4e, 0xe2, 0xdb, 0xcb, 0x8e, 0x53, 0xbf, 0xc2, 0xb7, 0x5c, 0x28, 0xd7, 0xe1, + 0x3b, 0xaf, 0x6a, 0x3b, 0xbc, 0xa9, 0xf0, 0xb7, 0xc3, 0x1b, 0x84, 0xa5, 0x1d, 0x49, 0x3f, 0x90, + 0xbe, 0x90, 0x4b, 0xb4, 0x3b, 0x1a, 0x4d, 0x61, 0x9f, 0xcd, 0x3f, 0x5f, 0x32, 0x03, 0xa3, 0xa1, + 0xdf, 0xbe, 0x6a, 0x0d, 0x56, 0xd8, 0x68, 0x18, 0xf9, 0x41, 0xe4, 0x12, 0x59, 0x6a, 0xc1, 0xd9, + 0x9b, 0xef, 0x26, 0x0a, 0xae, 0x4d, 0x14, 0xfc, 0x32, 0x51, 0xf0, 0x6d, 0x17, 0xf5, 0xae, 0x77, + 0x51, 0xef, 0xe7, 0x2e, 0xea, 0x7d, 0x9a, 0x16, 0xa2, 0x3a, 0x5f, 0x9f, 0xc5, 0x19, 0x5e, 0x25, + 0xd6, 0xeb, 0x99, 0xcc, 0xab, 0xaf, 0xa8, 0x2e, 0x7c, 0xc4, 0x57, 0x22, 0x29, 0xf0, 0xbf, 0x53, + 0x39, 0x1b, 0xd8, 0xf3, 0x78, 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, 0xba, 0x35, 0x4e, 0x23, 0x93, + 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.IO) > 0 { + i -= len(m.IO) + copy(dAtA[i:], m.IO) + i = encodeVarintStorage(dAtA, i, uint64(len(m.IO))) + i-- + dAtA[i] = 0x22 + } + if len(m.Capacity) > 0 { + i -= len(m.Capacity) + copy(dAtA[i:], m.Capacity) + i = encodeVarintStorage(dAtA, i, uint64(len(m.Capacity))) + i-- + dAtA[i] = 0x1a + } + 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] = 0x12 + } + if len(m.Vendor) > 0 { + i -= len(m.Vendor) + copy(dAtA[i:], m.Vendor) + i = encodeVarintStorage(dAtA, i, uint64(len(m.Vendor))) + 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 + if m.Info != nil { + { + 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 + } + if m.Quantity != nil { + { + 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.Vendor) + if l > 0 { + n += 1 + l + sovStorage(uint64(l)) + } + l = len(m.Class) + if l > 0 { + n += 1 + l + sovStorage(uint64(l)) + } + l = len(m.Capacity) + if l > 0 { + n += 1 + l + sovStorage(uint64(l)) + } + l = len(m.IO) + 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 + if m.Quantity != nil { + l = m.Quantity.Size() + n += 1 + l + sovStorage(uint64(l)) + } + if m.Info != nil { + 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 Vendor", 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.Vendor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Capacity", 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.Capacity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IO", 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.IO = 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 m.Quantity == nil { + m.Quantity = &ResourcePair{} + } + 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 m.Info == nil { + m.Info = &StorageInfo{} + } + 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..770b2134 --- /dev/null +++ b/go/inventory/v1/types.go @@ -0,0 +1,70 @@ +package v1 + +import ( + "sort" +) + +type CPUs []CPU +type GPUs []GPU + +type Nodes []Node +type ClusterStorage []Storage + +var _ sort.Interface = (*CPUs)(nil) +var _ sort.Interface = (*GPUs)(nil) + +func (s CPUs) Len() int { + return len(s) +} + +func (s CPUs) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} + +func (s CPUs) 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.Service != b.Service { + // return a.Service < b.Service + // } + // + // if a.Port != b.Port { + // return a.Port < b.Port + // } + // + // if a.Proto != b.Proto { + // return a.Proto < b.Proto + // } + // + // if a.Global != b.Global { + // return a.Global + // } + + return false +} diff --git a/go/node/take/v1beta3/params.pb.go b/go/node/take/v1beta3/params.pb.go index 49283e36..b43aa0f0 100644 --- a/go/node/take/v1beta3/params.pb.go +++ b/go/node/take/v1beta3/params.pb.go @@ -23,6 +23,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// DenomTakeRate describes take rate for specified denom type DenomTakeRate struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom" yaml:"denom"` Rate uint32 `protobuf:"varint,2,opt,name=rate,proto3" json:"rate" yaml:"rate"` 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..8c67be03 --- /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.casttype) = "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..9d9b44ad --- /dev/null +++ b/proto/provider/akash/inventory/v1/cpu.proto @@ -0,0 +1,45 @@ +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"; + +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.customname) = "Quantity", + (gogoproto.jsontag) = "quantity", + (gogoproto.moretags) = "yaml:\"quantity\"" + ]; + + repeated CPUInfo info = 2 [ + (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..70ae4730 --- /dev/null +++ b/proto/provider/akash/inventory/v1/gpu.proto @@ -0,0 +1,50 @@ +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"; + +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) = "modelid", + (gogoproto.moretags) = "yaml:\"modelid\"" + ]; + string interface = 4 [ + (gogoproto.customname) = "Interface", + (gogoproto.jsontag) = "interface", + (gogoproto.moretags) = "yaml:\"interface\"" + ]; + string memory = 5 [ + (gogoproto.customname) = "Memory", + (gogoproto.jsontag) = "memory", + (gogoproto.moretags) = "yaml:\"memory\"" + ]; +} + +message GPU { + ResourcePair quantity = 1 [ + (gogoproto.customname) = "Quantity", + (gogoproto.jsontag) = "quantity", + (gogoproto.moretags) = "yaml:\"quantity\"" + ]; + repeated GPUInfo info = 2 [ + (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..40b775e2 --- /dev/null +++ b/proto/provider/akash/inventory/v1/memory.proto @@ -0,0 +1,46 @@ +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"; + +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 size = 3 [ + (gogoproto.customname) = "Size", + (gogoproto.jsontag) = "size", + (gogoproto.moretags) = "yaml:\"size\"" + ]; + string speed = 4 [ + (gogoproto.customname) = "Speed", + (gogoproto.jsontag) = "speed", + (gogoproto.moretags) = "yaml:\"speed\"" + ]; +} + +message Memory { + ResourcePair quantity = 1 [ + (gogoproto.customname) = "Quantity", + (gogoproto.jsontag) = "quantity", + (gogoproto.moretags) = "yaml:\"quantity\"" + ]; + + repeated MemoryInfo info = 2 [ + (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..7929751c --- /dev/null +++ b/proto/provider/akash/inventory/v1/node.proto @@ -0,0 +1,45 @@ +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.castrepeated) = "CPUs", + (gogoproto.customname) = "CPU", + (gogoproto.jsontag) = "cpu", + (gogoproto.moretags) = "yaml:\"cpu\"" + ]; + + Memory memory = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "Memory", + (gogoproto.customname) = "Memory", + (gogoproto.jsontag) = "memory", + (gogoproto.moretags) = "yaml:\"memory\"" + ]; + + GPU gpu = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "GPUs", + (gogoproto.customname) = "Gpus", + (gogoproto.jsontag) = "gpus", + (gogoproto.moretags) = "yaml:\"gpus\"" + ]; + + Storage storage = 4 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "Storage", + (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..e9895268 --- /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"; + +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.castrepeated) = "github.com/akash-network/akash-api/go/node/types/v1beta3.Attributes", + (gogoproto.jsontag) = "attributes,omitempty", + (gogoproto.moretags) = "yaml:\"attributes,omitempty\"" + ]; +} diff --git a/proto/provider/akash/inventory/v1/storage.proto b/proto/provider/akash/inventory/v1/storage.proto new file mode 100644 index 00000000..19af668f --- /dev/null +++ b/proto/provider/akash/inventory/v1/storage.proto @@ -0,0 +1,45 @@ +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"; + +message StorageInfo { + string vendor = 1 [ + (gogoproto.customname) = "Vendor", + (gogoproto.jsontag) = "vendor", + (gogoproto.moretags) = "yaml:\"vendor\"" + ]; + string class = 2 [ + (gogoproto.customname) = "Class", + (gogoproto.jsontag) = "class", + (gogoproto.moretags) = "yaml:\"class\"" + ]; + string capacity = 3 [ + (gogoproto.customname) = "Capacity", + (gogoproto.jsontag) = "capacity", + (gogoproto.moretags) = "yaml:\"capacity\"" + ]; + string IO = 4 [ + (gogoproto.customname) = "IO", + (gogoproto.jsontag) = "io", + (gogoproto.moretags) = "yaml:\"io\"" + ]; + } + + message Storage { + ResourcePair quantity = 1 [ + (gogoproto.customname) = "Quantity", + (gogoproto.jsontag) = "quantity", + (gogoproto.moretags) = "yaml:\"quantity\"" + ]; + StorageInfo info = 2 [ + (gogoproto.customname) = "Info", + (gogoproto.jsontag) = "info", + (gogoproto.moretags) = "yaml:\"info\"" + ]; + } \ No newline at end of file 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