From a614fa12975025e907610981a40ddf1ceba18458 Mon Sep 17 00:00:00 2001 From: Artur Troian Date: Mon, 18 Dec 2023 09:03:42 -0500 Subject: [PATCH] fix(inventory): refactor base types Signed-off-by: Artur Troian --- go/inventory/v1/cluster.pb.go | 35 +-- go/inventory/v1/cpu.pb.go | 99 ++++--- go/inventory/v1/gpu.pb.go | 162 ++++++------ go/inventory/v1/memory.pb.go | 62 ++--- go/inventory/v1/node.pb.go | 130 +++++---- go/inventory/v1/resourcepair.go | 10 +- go/inventory/v1/resourcepair.pb.go | 58 ++-- go/inventory/v1/storage.pb.go | 250 +++++------------- go/inventory/v1/types.go | 83 ++++-- .../provider/akash/inventory/v1/cluster.proto | 4 +- proto/provider/akash/inventory/v1/cpu.proto | 3 + proto/provider/akash/inventory/v1/gpu.proto | 17 +- .../provider/akash/inventory/v1/memory.proto | 9 +- proto/provider/akash/inventory/v1/node.proto | 8 +- .../akash/inventory/v1/resourcepair.proto | 1 + .../provider/akash/inventory/v1/storage.proto | 25 +- 16 files changed, 441 insertions(+), 515 deletions(-) diff --git a/go/inventory/v1/cluster.pb.go b/go/inventory/v1/cluster.pb.go index 36e493af..ee4c22af 100644 --- a/go/inventory/v1/cluster.pb.go +++ b/go/inventory/v1/cluster.pb.go @@ -24,8 +24,8 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Cluster struct { - Nodes []Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes" yaml:"nodes"` - Storage []Storage `protobuf:"bytes,2,rep,name=storage,proto3" json:"storage" yaml:"storage"` + Nodes Nodes `protobuf:"bytes,1,rep,name=nodes,proto3,castrepeated=Nodes" json:"nodes" yaml:"nodes"` + Storage ClusterStorage `protobuf:"bytes,2,rep,name=storage,proto3,castrepeated=ClusterStorage" json:"storage" yaml:"storage"` } func (m *Cluster) Reset() { *m = Cluster{} } @@ -61,14 +61,14 @@ func (m *Cluster) XXX_DiscardUnknown() { var xxx_messageInfo_Cluster proto.InternalMessageInfo -func (m *Cluster) GetNodes() []Node { +func (m *Cluster) GetNodes() Nodes { if m != nil { return m.Nodes } return nil } -func (m *Cluster) GetStorage() []Storage { +func (m *Cluster) GetStorage() ClusterStorage { if m != nil { return m.Storage } @@ -82,26 +82,27 @@ func init() { func init() { proto.RegisterFile("akash/inventory/v1/cluster.proto", fileDescriptor_205585ebfe7f68ce) } var fileDescriptor_205585ebfe7f68ce = []byte{ - // 299 bytes of a gzipped FileDescriptorProto + // 309 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xcc, 0x4e, 0x2c, 0xce, 0xd0, 0xcf, 0xcc, 0x2b, 0x4b, 0xcd, 0x2b, 0xc9, 0x2f, 0xaa, 0xd4, 0x2f, 0x33, 0xd4, 0x4f, 0xce, 0x29, 0x2d, 0x2e, 0x49, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x02, 0xab, 0xd0, 0x83, 0xab, 0xd0, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xeb, 0x83, 0x58, 0x10, 0x95, 0x52, 0xb2, 0x58, 0xcc, 0xca, 0xcb, 0x4f, 0x49, 0x85, 0x4a, 0xab, 0x62, 0x91, 0x2e, 0x4a, 0x2d, 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0x2d, 0x48, 0xcc, 0x84, 0xda, 0x27, 0x85, 0xcd, - 0x45, 0xc5, 0x25, 0xf9, 0x45, 0x89, 0xe9, 0x50, 0x83, 0x94, 0xce, 0x30, 0x72, 0xb1, 0x3b, 0x43, - 0xdc, 0x28, 0x14, 0xc6, 0xc5, 0x0a, 0xb2, 0xa2, 0x58, 0x82, 0x51, 0x81, 0x59, 0x83, 0xdb, 0x48, - 0x42, 0x0f, 0xd3, 0xb5, 0x7a, 0x7e, 0xf9, 0x29, 0x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x89, - 0x05, 0x99, 0xfa, 0xe9, 0xf9, 0x28, 0x41, 0x95, 0xc4, 0x06, 0x0e, 0x23, 0x63, 0x40, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x66, 0x15, 0x3e, 0x60, 0xd9, 0x01, 0x00, 0x00, + 0x65, 0x62, 0x6e, 0x8e, 0x95, 0x12, 0x98, 0xab, 0xb4, 0xea, 0x3e, 0x54, 0x45, 0x10, 0x44, 0x5e, + 0xa8, 0x94, 0x8b, 0x1d, 0x6a, 0xbb, 0x04, 0x13, 0xd8, 0x0a, 0x69, 0x6c, 0x56, 0x04, 0x43, 0x94, + 0x38, 0xd9, 0x41, 0x6d, 0x61, 0x87, 0x0a, 0xbc, 0xba, 0x27, 0x0f, 0xd3, 0xfe, 0xe9, 0x9e, 0x3c, + 0x1f, 0xc4, 0x26, 0xa8, 0x00, 0xc8, 0x2e, 0x3e, 0xa8, 0x3f, 0xa0, 0xca, 0x83, 0x60, 0x8a, 0xad, + 0x58, 0x5e, 0x2c, 0x90, 0x67, 0x70, 0xf2, 0x39, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, + 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, + 0x86, 0x28, 0xa3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xb0, 0x7b, + 0x74, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xa1, 0xbc, 0xc4, 0x82, 0x4c, 0xfd, 0xf4, 0x7c, + 0x94, 0x50, 0x4c, 0x62, 0x03, 0x07, 0x9f, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x54, 0xea, + 0xeb, 0xf4, 0x01, 0x00, 0x00, } func (m *Cluster) Marshal() (dAtA []byte, err error) { diff --git a/go/inventory/v1/cpu.pb.go b/go/inventory/v1/cpu.pb.go index d9289cef..04ea62c0 100644 --- a/go/inventory/v1/cpu.pb.go +++ b/go/inventory/v1/cpu.pb.go @@ -6,7 +6,7 @@ package v1 import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + proto "github.com/golang/protobuf/proto" io "io" math "math" math_bits "math/bits" @@ -21,7 +21,7 @@ var _ = math.Inf // 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 +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type CPUInfo struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" yaml:"id"` @@ -92,8 +92,8 @@ func (m *CPUInfo) GetVcores() uint32 { } 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"` + 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{} } @@ -129,14 +129,14 @@ func (m *CPU) XXX_DiscardUnknown() { var xxx_messageInfo_CPU proto.InternalMessageInfo -func (m *CPU) GetQuantity() *ResourcePair { +func (m *CPU) GetQuantity() ResourcePair { if m != nil { return m.Quantity } - return nil + return ResourcePair{} } -func (m *CPU) GetInfo() []*CPUInfo { +func (m *CPU) GetInfo() []CPUInfo { if m != nil { return m.Info } @@ -151,34 +151,34 @@ func init() { 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, 0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, 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, + // 424 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x31, 0x6f, 0xd4, 0x30, + 0x1c, 0xc5, 0xe3, 0xdc, 0xf5, 0x68, 0x7d, 0x54, 0x48, 0x11, 0x43, 0x28, 0x28, 0x3e, 0x19, 0x55, + 0x3a, 0x06, 0x12, 0xf5, 0x58, 0x10, 0x12, 0xcb, 0x95, 0xa5, 0x03, 0xd2, 0x11, 0x51, 0x06, 0xb6, + 0x34, 0xc9, 0xa5, 0x56, 0x1b, 0x3b, 0xf8, 0x92, 0xa0, 0xfb, 0x16, 0x8c, 0x7c, 0xa4, 0x8a, 0xa9, + 0x23, 0x93, 0x85, 0x92, 0x2d, 0x62, 0xca, 0x27, 0x40, 0xf9, 0xdb, 0x9c, 0x40, 0xed, 0xf6, 0x7f, + 0xef, 0xfd, 0x5f, 0x7e, 0x8a, 0x6d, 0xfc, 0x2c, 0xba, 0x8a, 0x36, 0x97, 0x01, 0xe3, 0x75, 0xca, + 0x4b, 0x21, 0xb7, 0x41, 0x7d, 0x12, 0xc4, 0x45, 0xe5, 0x17, 0x52, 0x94, 0xc2, 0x71, 0x20, 0xf5, + 0x77, 0xa9, 0x5f, 0x9f, 0x1c, 0x3d, 0xce, 0x44, 0x26, 0x20, 0x0e, 0x86, 0x49, 0x6f, 0x1e, 0x1d, + 0xdf, 0xf3, 0x1d, 0x99, 0x6e, 0x44, 0x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, 0x17, 0x3a, 0x1f, 0xf1, + 0x98, 0xf1, 0xb5, 0x70, 0xed, 0xd9, 0x68, 0x3e, 0x5d, 0x3c, 0xbd, 0x0f, 0x65, 0x2e, 0x61, 0xf9, + 0xdc, 0x50, 0xc6, 0x83, 0xea, 0x14, 0x81, 0x62, 0xaf, 0xc8, 0xd4, 0x5c, 0x00, 0x5f, 0x0b, 0x1a, + 0x82, 0xb9, 0x5c, 0xdd, 0x34, 0x1e, 0xba, 0x6d, 0x3c, 0xf4, 0xab, 0xf1, 0xd0, 0xb7, 0xd6, 0xb3, + 0xbe, 0xb7, 0x9e, 0x75, 0xdb, 0x7a, 0xd6, 0xcf, 0xd6, 0xb3, 0x3e, 0x2f, 0x32, 0x56, 0x5e, 0x56, + 0x17, 0x7e, 0x2c, 0xf2, 0x00, 0x78, 0x2f, 0x79, 0x5a, 0x7e, 0x15, 0xf2, 0xca, 0xa8, 0xa8, 0x60, + 0x41, 0x26, 0xfe, 0x7b, 0x20, 0x17, 0x13, 0x78, 0x14, 0xaf, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, + 0x34, 0x07, 0x23, 0x38, 0x85, 0x02, 0x00, 0x00, } func (m *CPUInfo) Marshal() (dAtA []byte, err error) { @@ -264,18 +264,16 @@ func (m *CPU) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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)) + { + size, err := m.Quantity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i -= size + i = encodeVarintCpu(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -320,10 +318,8 @@ func (m *CPU) Size() (n int) { } var l int _ = l - if m.Quantity != nil { - l = m.Quantity.Size() - n += 1 + l + sovCpu(uint64(l)) - } + l = m.Quantity.Size() + n += 1 + l + sovCpu(uint64(l)) if len(m.Info) > 0 { for _, e := range m.Info { l = e.Size() @@ -562,9 +558,6 @@ func (m *CPU) Unmarshal(dAtA []byte) error { 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 } @@ -598,7 +591,7 @@ func (m *CPU) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Info = append(m.Info, &CPUInfo{}) + m.Info = append(m.Info, CPUInfo{}) if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/go/inventory/v1/gpu.pb.go b/go/inventory/v1/gpu.pb.go index ba652d56..959aa24d 100644 --- a/go/inventory/v1/gpu.pb.go +++ b/go/inventory/v1/gpu.pb.go @@ -6,7 +6,7 @@ package v1 import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + proto "github.com/golang/protobuf/proto" io "io" math "math" math_bits "math/bits" @@ -21,14 +21,14 @@ var _ = math.Inf // 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 +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type GPUInfo struct { - Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor" yaml:"vendor"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name" yaml:"name"` - ModelID string `protobuf:"bytes,3,opt,name=modelid,proto3" json:"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"` + Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor" yaml:"vendor"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name" yaml:"name"` + ModelID string `protobuf:"bytes,3,opt,name=modelid,proto3" json:"model_id" yaml:"model_id"` + Interface string `protobuf:"bytes,4,opt,name=interface,proto3" json:"interface" yaml:"interface"` + MemorySize string `protobuf:"bytes,5,opt,name=memory_size,json=memorySize,proto3" json:"memory_size" yaml:"memory_size"` } func (m *GPUInfo) Reset() { *m = GPUInfo{} } @@ -92,16 +92,16 @@ func (m *GPUInfo) GetInterface() string { return "" } -func (m *GPUInfo) GetMemory() string { +func (m *GPUInfo) GetMemorySize() string { if m != nil { - return m.Memory + return m.MemorySize } return "" } type GPU struct { - Quantity *ResourcePair `protobuf:"bytes,1,opt,name=quantity,proto3" json:"quantity" yaml:"quantity"` - Info []*GPUInfo `protobuf:"bytes,2,rep,name=info,proto3" json:"info" yaml:"info"` + Quantity ResourcePair `protobuf:"bytes,1,opt,name=quantity,proto3" json:"quantity" yaml:"quantity"` + Info GPUInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info" yaml:"info"` } func (m *GPU) Reset() { *m = GPU{} } @@ -137,18 +137,18 @@ func (m *GPU) XXX_DiscardUnknown() { var xxx_messageInfo_GPU proto.InternalMessageInfo -func (m *GPU) GetQuantity() *ResourcePair { +func (m *GPU) GetQuantity() ResourcePair { if m != nil { return m.Quantity } - return nil + return ResourcePair{} } -func (m *GPU) GetInfo() []*GPUInfo { +func (m *GPU) GetInfo() GPUInfo { if m != nil { return m.Info } - return nil + return GPUInfo{} } func init() { @@ -159,35 +159,37 @@ func init() { 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, 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42, 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, + // 474 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x4f, 0x6b, 0xdb, 0x30, + 0x18, 0xc6, 0xe3, 0xd6, 0xcb, 0x1f, 0x85, 0xb1, 0x21, 0x76, 0x30, 0xdd, 0xb0, 0x8a, 0x46, 0x61, + 0x0c, 0x66, 0xd3, 0xe4, 0x36, 0xd8, 0x25, 0x14, 0x4a, 0x60, 0x1d, 0x99, 0xd7, 0xee, 0xb0, 0x4b, + 0x51, 0x13, 0xc5, 0x15, 0xad, 0xa4, 0x4c, 0x71, 0x32, 0xd2, 0x4f, 0xb1, 0xe3, 0x3e, 0x52, 0xd9, + 0xa9, 0xc7, 0x9d, 0xc4, 0x50, 0x0e, 0x83, 0x1c, 0xfd, 0x09, 0x86, 0x64, 0x3b, 0xde, 0x68, 0x6f, + 0x7e, 0x7f, 0xcf, 0xfb, 0x3c, 0x32, 0x7a, 0x04, 0x5e, 0x90, 0x2b, 0x32, 0xbf, 0x8c, 0x99, 0x58, + 0x52, 0x91, 0x49, 0xb5, 0x8a, 0x97, 0x87, 0x71, 0x3a, 0x5b, 0x44, 0x33, 0x25, 0x33, 0x09, 0xa1, + 0x53, 0xa3, 0xad, 0x1a, 0x2d, 0x0f, 0xf7, 0x9e, 0x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, 0x87, 0x3f, + 0xb1, 0x1b, 0x1b, 0xf8, 0xef, 0x52, 0xae, 0x11, 0x2c, 0xff, 0xae, 0x86, 0x38, 0x01, 0x7c, 0x6b, + 0xc0, 0x3f, 0x3d, 0xb0, 0x7b, 0x3c, 0x3a, 0x83, 0x1c, 0xb4, 0xbf, 0x2e, 0x88, 0xc8, 0x58, 0xb6, + 0x72, 0xf7, 0xdc, 0xed, 0xed, 0x47, 0xf7, 0x5b, 0x8d, 0x92, 0xb2, 0xab, 0x11, 0x61, 0x6a, 0x10, + 0xdf, 0x6a, 0xd4, 0x30, 0x1a, 0xb5, 0x3f, 0x96, 0x4e, 0x7b, 0x33, 0x55, 0x4a, 0x7d, 0x33, 0x15, + 0xc1, 0xc9, 0x56, 0x84, 0xa7, 0xc0, 0x67, 0x62, 0x2a, 0x5d, 0x2b, 0xdd, 0xde, 0xf3, 0x87, 0x8e, + 0x2a, 0xfb, 0x1f, 0xbc, 0x2c, 0x4f, 0xf1, 0xed, 0x64, 0x6b, 0xb3, 0xc6, 0xba, 0x36, 0x3b, 0xe1, + 0xc4, 0xc1, 0xc1, 0xe8, 0xd6, 0x84, 0xde, 0x9d, 0x09, 0xbd, 0xdf, 0x26, 0xf4, 0xbe, 0xaf, 0xc3, + 0xc6, 0x8f, 0x75, 0xd8, 0xb8, 0x5b, 0x87, 0x8d, 0x5f, 0xeb, 0xb0, 0xf1, 0xa5, 0x97, 0xb2, 0xec, + 0x72, 0x71, 0x11, 0x8d, 0x25, 0x8f, 0xdd, 0x79, 0x6f, 0x04, 0xcd, 0xbe, 0x49, 0x75, 0x55, 0x4e, + 0x64, 0xc6, 0xe2, 0x54, 0xfe, 0xf7, 0x36, 0x2f, 0x9a, 0xee, 0x3d, 0xf6, 0xff, 0x06, 0x00, 0x00, + 0xff, 0xff, 0x2c, 0x99, 0x43, 0xfe, 0x00, 0x03, 0x00, 0x00, } func (m *GPUInfo) Marshal() (dAtA []byte, err error) { @@ -210,10 +212,10 @@ func (m *GPUInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = 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))) + if len(m.MemorySize) > 0 { + i -= len(m.MemorySize) + copy(dAtA[i:], m.MemorySize) + i = encodeVarintGpu(dAtA, i, uint64(len(m.MemorySize))) i-- dAtA[i] = 0x2a } @@ -268,32 +270,26 @@ func (m *GPU) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = 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 + { + size, err := m.Info.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintGpu(dAtA, i, uint64(size)) } - 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] = 0x12 + { + size, err := m.Quantity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i -= size + i = encodeVarintGpu(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -330,7 +326,7 @@ func (m *GPUInfo) Size() (n int) { if l > 0 { n += 1 + l + sovGpu(uint64(l)) } - l = len(m.Memory) + l = len(m.MemorySize) if l > 0 { n += 1 + l + sovGpu(uint64(l)) } @@ -343,16 +339,10 @@ func (m *GPU) Size() (n int) { } 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)) - } - } + l = m.Quantity.Size() + n += 1 + l + sovGpu(uint64(l)) + l = m.Info.Size() + n += 1 + l + sovGpu(uint64(l)) return n } @@ -521,7 +511,7 @@ func (m *GPUInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Memory", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MemorySize", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -549,7 +539,7 @@ func (m *GPUInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Memory = string(dAtA[iNdEx:postIndex]) + m.MemorySize = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -630,9 +620,6 @@ func (m *GPU) Unmarshal(dAtA []byte) error { 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 } @@ -666,8 +653,7 @@ func (m *GPU) Unmarshal(dAtA []byte) error { 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 { + if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/go/inventory/v1/memory.pb.go b/go/inventory/v1/memory.pb.go index 10c8fd9c..9e220650 100644 --- a/go/inventory/v1/memory.pb.go +++ b/go/inventory/v1/memory.pb.go @@ -6,7 +6,7 @@ package v1 import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + proto "github.com/golang/protobuf/proto" io "io" math "math" math_bits "math/bits" @@ -21,12 +21,12 @@ var _ = math.Inf // 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 +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type MemoryInfo struct { Vendor string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor" yaml:"vendor"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type" yaml:"type"` - TotalSize string `protobuf:"bytes,3,opt,name=totalsize,proto3" json:"totalsize" yaml:"totalsize"` + TotalSize string `protobuf:"bytes,3,opt,name=total_size,json=totalSize,proto3" json:"total_size" yaml:"total_size"` Speed string `protobuf:"bytes,4,opt,name=speed,proto3" json:"speed" yaml:"speed"` } @@ -151,34 +151,34 @@ func init() { func init() { proto.RegisterFile("akash/inventory/v1/memory.proto", fileDescriptor_bf744888c94a0308) } var fileDescriptor_bf744888c94a0308 = []byte{ - // 419 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0xcf, 0x6a, 0xdb, 0x30, - 0x18, 0x8f, 0xd3, 0x34, 0x34, 0xca, 0xc6, 0x86, 0xd8, 0xc1, 0xf4, 0xe0, 0x2f, 0x08, 0x0a, 0x85, - 0x31, 0x9b, 0xa6, 0x97, 0x31, 0xd8, 0x25, 0xb7, 0x41, 0x07, 0x9b, 0x53, 0x76, 0xd8, 0x4d, 0x6d, - 0xd5, 0x54, 0xb4, 0xb6, 0x3c, 0x59, 0xf1, 0x70, 0x9f, 0x60, 0xc7, 0x3d, 0x56, 0x8f, 0x3d, 0xee, - 0x24, 0x86, 0x72, 0xf3, 0xd1, 0x4f, 0x30, 0x24, 0xb9, 0x31, 0xa3, 0xb9, 0xf9, 0xf7, 0xf7, 0x83, - 0x9f, 0x85, 0x80, 0xde, 0xd2, 0xf2, 0x26, 0xe1, 0x79, 0xc5, 0x72, 0x25, 0x64, 0x9d, 0x54, 0x27, - 0x49, 0xc6, 0x32, 0x21, 0xeb, 0xb8, 0x90, 0x42, 0x09, 0x8c, 0x9d, 0x21, 0xde, 0x1a, 0xe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be, 0x7c, 0x9c, 0x76, 0x7b, 0x7e, 0xa1, 0x5c, 0x2e, 0xde, 0x1a, 0x0d, 0x07, - 0x5f, 0xbb, 0x54, 0xa3, 0x61, 0xdb, 0xd0, 0x6a, 0x78, 0xe5, 0xef, 0x3d, 0x31, 0x24, 0xdd, 0x8a, - 0x78, 0x89, 0x46, 0x3c, 0xbf, 0x16, 0xe1, 0x70, 0xb6, 0x77, 0x3c, 0x9d, 0x47, 0xbb, 0xce, 0xf4, - 0xff, 0xc7, 0x4f, 0x6a, 0xbf, 0xec, 0xa4, 0x36, 0xd7, 0x4f, 0x6a, 0x11, 0x49, 0x1d, 0xb9, 0x38, - 0x7b, 0x30, 0x51, 0xf0, 0x68, 0xa2, 0xe0, 0xaf, 0x89, 0x82, 0xdf, 0x9b, 0x68, 0xf0, 0xb8, 0x89, - 0x06, 0x7f, 0x36, 0xd1, 0xe0, 0xfb, 0x7c, 0xc5, 0xd5, 0xcd, 0xfa, 0x22, 0xbe, 0x14, 0x59, 0xe2, - 0x4e, 0xbd, 0xcb, 0x99, 0xfa, 0x29, 0xe4, 0x6d, 0x87, 0x68, 0xc1, 0x93, 0x95, 0xf8, 0xef, 0xd9, - 0x5c, 0x8c, 0xdd, 0x53, 0x39, 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x14, 0xeb, 0x48, 0x9e, - 0x02, 0x00, 0x00, + // 429 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0xbf, 0x6e, 0x13, 0x31, + 0x18, 0xcf, 0xa5, 0x69, 0xd4, 0x38, 0x20, 0x84, 0xc5, 0x70, 0xea, 0xe0, 0x2f, 0xb2, 0x54, 0xa9, + 0x12, 0xe2, 0x8e, 0xa6, 0x0b, 0x42, 0x62, 0xc9, 0xc6, 0x80, 0x28, 0x97, 0x8a, 0x81, 0x05, 0xb9, + 0xad, 0x9b, 0x5a,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0xe1, 0xdf, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xb7, 0x03, 0x28, 0xed, 0xa5, 0x02, 0x00, 0x00, } func (m *MemoryInfo) Marshal() (dAtA []byte, err error) { diff --git a/go/inventory/v1/node.pb.go b/go/inventory/v1/node.pb.go index 2044b47d..e7302df7 100644 --- a/go/inventory/v1/node.pb.go +++ b/go/inventory/v1/node.pb.go @@ -24,10 +24,10 @@ var _ = math.Inf 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"` + CPU CPU `protobuf:"bytes,1,opt,name=cpu,proto3" json:"cpu" yaml:"cpu"` + Memory Memory `protobuf:"bytes,2,opt,name=memory,proto3" json:"memory" yaml:"memory"` + Gpus GPUs `protobuf:"bytes,3,rep,name=gpu,proto3,castrepeated=GPUs" json:"gpus" yaml:"gpus"` + Storage ClusterStorage `protobuf:"bytes,4,rep,name=storage,proto3,castrepeated=ClusterStorage" json:"storage" yaml:"storage"` } func (m *Node) Reset() { *m = Node{} } @@ -77,18 +77,18 @@ func (m *Node) GetMemory() Memory { return Memory{} } -func (m *Node) GetGpus() GPU { +func (m *Node) GetGpus() GPUs { if m != nil { return m.Gpus } - return GPU{} + return nil } -func (m *Node) GetStorage() Storage { +func (m *Node) GetStorage() ClusterStorage { if m != nil { return m.Storage } - return Storage{} + return nil } func init() { @@ -98,32 +98,32 @@ func init() { 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, 0x23, 0x06, 0xf4, 0x1e, 0x15, 0x4d, 0xbd, 0x41, 0x8b, - 0x48, 0x9f, 0x69, 0x4a, 0x88, 0x89, 0x21, 0x77, 0xe5, 0x7e, 0x67, 0xf8, 0xc7, 0xfe, 0xdc, 0xdf, - 0x1e, 0x7b, 0xbe, 0x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, 0xfa, 0xf0, 0xd2, 0xf3, 0x16, - 0x7b, 0xe3, 0xd1, 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, 0x69, 0x72, 0x8d, 0xb4, 0xad, 0x02, 0x00, - 0x00, + // 389 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xbd, 0x8e, 0x9b, 0x40, + 0x14, 0x85, 0x21, 0x20, 0x5b, 0xc2, 0x8a, 0x0b, 0x14, 0x29, 0x88, 0x24, 0x0c, 0xa2, 0x4a, 0x14, + 0x05, 0x64, 0xa7, 0x4b, 0x91, 0x02, 0x17, 0x2e, 0xf2, 0x23, 0x44, 0x44, 0x8a, 0x48, 0x29, 0x30, + 0x46, 0x63, 0xcb, 0x86, 0x19, 0x01, 0xe3, 0xc8, 0x65, 0xde, 0x60, 0x9f, 0x63, 0x9f, 0xc4, 0xa5, + 0xcb, 0xad, 0x66, 0x57, 0xb8, 0xa3, 0xe4, 0x09, 0x56, 0xcc, 0x8c, 0x2d, 0xad, 0x96, 0xdd, 0x8e, + 0x73, 0xcf, 0xb9, 0xdf, 0x3d, 0x62, 0xb4, 0x77, 0xf1, 0x26, 0x2e, 0x57, 0xde, 0x3a, 0xdf, 0xa5, + 0x79, 0x85, 0x8a, 0xbd, 0xb7, 0x9b, 0x78, 0x39, 0x5a, 0xa6, 0x2e, 0x2e, 0x50, 0x85, 0x74, 0x9d, + 0xd9, 0xee, 0xc5, 0x76, 0x77, 0x13, 0xf3, 0x15, 0x44, 0x10, 0x31, 0xdb, 0xeb, 0xbe, 0x78, 0xd2, + 0x7c, 0xdb, 0x03, 0x4a, 0x30, 0x79, 0xc6, 0x85, 0x17, 0xd7, 0xee, 0x71, 0xcb, 0x0a, 0x15, 0x31, + 0x14, 0x3d, 0x4c, 0xd0, 0x93, 0xc8, 0xd2, 0xac, 0x6b, 0xc4, 0x02, 0xce, 0x7f, 0x45, 0x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 0xb2, 0xa4, 0x3f, 0x53, 0xb8, 0xae, 0x56, 0x64, 0xe1, 0x26, 0x28, + 0xf3, 0x58, 0x93, 0x4f, 0x79, 0x5a, 0xfd, 0x43, 0xc5, 0x46, 0xa8, 0x18, 0xaf, 0x3d, 0x88, 0x1e, + 0x3c, 0xef, 0x62, 0xc0, 0x1e, 0xf6, 0xf3, 0x7d, 0x00, 0x00, 0x00, 0xff, 0xff, 0xca, 0x35, 0xfe, + 0x8f, 0xa2, 0x02, 0x00, 0x00, } func (m *Node) Marshal() (dAtA []byte, err error) { @@ -146,26 +146,34 @@ func (m *Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size, err := m.Storage.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Storage) > 0 { + for iNdEx := len(m.Storage) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Storage[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - 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 + if len(m.Gpus) > 0 { + for iNdEx := len(m.Gpus) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Gpus[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - i -= size - i = encodeVarintNode(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x1a { size, err := m.Memory.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -210,10 +218,18 @@ func (m *Node) Size() (n int) { 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)) + if len(m.Gpus) > 0 { + for _, e := range m.Gpus { + l = e.Size() + n += 1 + l + sovNode(uint64(l)) + } + } + if len(m.Storage) > 0 { + for _, e := range m.Storage { + l = e.Size() + n += 1 + l + sovNode(uint64(l)) + } + } return n } @@ -347,7 +363,8 @@ func (m *Node) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Gpus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Gpus = append(m.Gpus, GPU{}) + if err := m.Gpus[len(m.Gpus)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -380,7 +397,8 @@ func (m *Node) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Storage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Storage = append(m.Storage, Storage{}) + if err := m.Storage[len(m.Storage)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/go/inventory/v1/resourcepair.go b/go/inventory/v1/resourcepair.go index dcabf4a4..1eef26e4 100644 --- a/go/inventory/v1/resourcepair.go +++ b/go/inventory/v1/resourcepair.go @@ -5,5 +5,13 @@ func (m *ResourcePair) Equal(rhs ResourcePair) bool { return false } - return (m.Allocated.Cmp(rhs.Allocated) == 0) && (m.Allocatable.Cmp(rhs.Allocatable) == 0) + return (m.Allocatable.Cmp(rhs.Allocatable) == 0) && (m.Allocated.Cmp(rhs.Allocated) == 0) +} + +func (m *ResourcePair) LT(rhs ResourcePair) bool { + if m == nil { + return false + } + + return m.Allocatable.Cmp(rhs.Allocatable) == -1 } diff --git a/go/inventory/v1/resourcepair.pb.go b/go/inventory/v1/resourcepair.pb.go index c888c2dd..2144eaf2 100644 --- a/go/inventory/v1/resourcepair.pb.go +++ b/go/inventory/v1/resourcepair.pb.go @@ -7,7 +7,7 @@ import ( fmt "fmt" v1beta3 "github.com/akash-network/akash-api/go/node/types/v1beta3" _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + proto "github.com/golang/protobuf/proto" io "io" resource "k8s.io/apimachinery/pkg/api/resource" math "math" @@ -23,7 +23,7 @@ var _ = math.Inf // 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 +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type ResourcePair struct { Allocatable resource.Quantity `protobuf:"bytes,1,opt,name=allocatable,proto3" json:"allocatable" yaml:"allocatable"` @@ -94,33 +94,33 @@ func init() { } var fileDescriptor_995cee7bf7b692e7 = []byte{ - // 403 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0x3d, 0xcf, 0xd3, 0x30, - 0x18, 0x8c, 0x29, 0x42, 0x7a, 0x13, 0x06, 0x14, 0xbd, 0x43, 0x55, 0x44, 0x5c, 0x45, 0x42, 0xea, - 0x00, 0xb6, 0x9a, 0x32, 0x54, 0x65, 0x6a, 0x67, 0x06, 0xc8, 0xc8, 0xe6, 0xa4, 0x56, 0x6a, 0xe5, - 0xc3, 0x91, 0xe3, 0x04, 0x85, 0x89, 0x99, 0x89, 0x9f, 0xd0, 0x9f, 0xd3, 0xb1, 0x23, 0x93, 0x85, - 0xd2, 0x05, 0x75, 0xec, 0x2f, 0x40, 0xf9, 0x68, 0x93, 0x4a, 0x4c, 0xef, 0xe6, 0xe7, 0x9e, 0xbb, - 0x7b, 0x4e, 0xb9, 0xe8, 0x6f, 0x49, 0x48, 0xb2, 0x1d, 0x66, 0x49, 0x41, 0x13, 0xc9, 0x45, 0x89, - 0x8b, 0x39, 0x16, 0x34, 0xe3, 0xb9, 0xf0, 0x69, 0x4a, 0x98, 0x40, 0xa9, 0xe0, 0x92, 0x9b, 0x66, - 0x43, 0x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 0x73, 0x75, 0x4b, 0xa8, 0x6b, 0x09, 0xad, 0xaf, - 0xac, 0xcd, 0xc7, 0x83, 0x82, 0xe0, 0xac, 0xe0, 0x63, 0x2f, 0x7c, 0xc7, 0x63, 0x26, 0x69, 0x9c, - 0xca, 0xf2, 0xa2, 0xe0, 0xeb, 0xee, 0xde, 0x7f, 0xb6, 0xb6, 0x3b, 0xb8, 0xb6, 0x7a, 0xfe, 0x77, - 0x0f, 0xb5, 0xcd, 0xa7, 0x43, 0x65, 0x81, 0x63, 0x65, 0x81, 0x3f, 0x95, 0x05, 0x7e, 0x9d, 0x2c, - 0xed, 0x78, 0xb2, 0xb4, 0xdf, 0x27, 0x4b, 0xfb, 0xea, 0x04, 0x4c, 0xee, 0x72, 0x0f, 0xf9, 0x3c, - 0xc6, 0x4d, 0xa2, 0xf7, 0x09, 0x95, 0xdf, 0xb8, 0x08, 0xbb, 0xa9, 0x6e, 0x3e, 0xe0, 0x77, 0xff, - 0xa1, 0xf7, 0xa2, 0xe9, 0x7d, 0xf1, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x0c, 0x98, 0x3e, 0x4b, 0xa4, - 0x02, 0x00, 0x00, + // 407 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0xbd, 0xae, 0xd3, 0x30, + 0x18, 0x8d, 0x29, 0x42, 0xba, 0x09, 0x03, 0x8a, 0xee, 0x50, 0x5d, 0x44, 0x7c, 0x15, 0x09, 0xe9, + 0x0e, 0x60, 0xab, 0x29, 0x43, 0x55, 0xa6, 0xf6, 0x09, 0x4a, 0x46, 0x36, 0x27, 0xb5, 0x52, 0x2b, + 0x3f, 0x8e, 0x1c, 0x27, 0x28, 0x4c, 0xcc, 0x4c, 0x8c, 0x8c, 0x7d, 0x9c, 0x8e, 0x1d, 0x99, 0x2c, + 0x94, 0x2c, 0xa8, 0x63, 0x9f, 0x00, 0xe5, 0x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d3, + 0xed, 0xf4, 0xd9, 0x7f, 0x45, 0x71, 0xfa, 0x28, 0x77, 0xab, 0x8b, 0xd1, 0x49, 0xc1, 0xc1, 0xf5, + 0xac, 0xe0, 0xab, 0x9b, 0x18, 0x74, 0x6b, 0xbb, 0xc3, 0xda, 0xfc, 0xaa, 0xeb, 0xd7, 0xef, 0x9f, + 0x4d, 0x27, 0x8f, 0x93, 0x27, 0xc3, 0x79, 0x83, 0xba, 0xe6, 0x9a, 0x96, 0x50, 0xdf, 0x12, 0x5a, + 0x5d, 0x58, 0xeb, 0x8f, 0x07, 0x05, 0xc1, 0x49, 0xc1, 0xfb, 0x41, 0xf8, 0x8e, 0xc7, 0x4c, 0xd2, + 0x38, 0x95, 0xe5, 0x59, 0xc1, 0xd7, 0xfd, 0xbd, 0x7f, 0x6c, 0x6d, 0x77, 0x74, 0x6d, 0xf9, 0xfc, + 0xcf, 0x1e, 0x6a, 0xeb, 0xcd, 0xa1, 0xb2, 0xc0, 0xb1, 0xb2, 0xc0, 0xef, 0xca, 0x02, 0x3f, 0x6a, + 0x4b, 0xfb, 0x59, 0x5b, 0xda, 0xb1, 0xb6, 0xb4, 0x5f, 0xb5, 0xa5, 0x7d, 0x76, 0x02, 0x26, 0x77, + 0xb9, 0x87, 0x7c, 0x1e, 0xe3, 0x36, 0xd5, 0xfb, 0x84, 0xca, 0x2f, 0x5c, 0x84, 0xfd, 0xd4, 0xb4, + 0x1f, 0xf0, 0x9b, 0x7f, 0xd1, 0x7b, 0xd1, 0x76, 0x3f, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xc8, + 0xb9, 0xff, 0x7b, 0xa8, 0x02, 0x00, 0x00, } func (m *ResourcePair) Marshal() (dAtA []byte, err error) { diff --git a/go/inventory/v1/storage.pb.go b/go/inventory/v1/storage.pb.go index 9c73e388..ceb73cee 100644 --- a/go/inventory/v1/storage.pb.go +++ b/go/inventory/v1/storage.pb.go @@ -6,7 +6,7 @@ package v1 import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" + proto "github.com/golang/protobuf/proto" io "io" math "math" math_bits "math/bits" @@ -21,13 +21,11 @@ var _ = math.Inf // 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 +const _ = proto.ProtoPackageIsVersion3 // 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"` + Class string `protobuf:"bytes,1,opt,name=class,proto3" json:"class" yaml:"class"` + IOPS string `protobuf:"bytes,2,opt,name=IOPS,proto3" json:"iops" yaml:"iops"` } func (m *StorageInfo) Reset() { *m = StorageInfo{} } @@ -63,13 +61,6 @@ func (m *StorageInfo) XXX_DiscardUnknown() { 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 @@ -77,23 +68,16 @@ func (m *StorageInfo) GetClass() string { return "" } -func (m *StorageInfo) GetCapacity() string { +func (m *StorageInfo) GetIOPS() string { if m != nil { - return m.Capacity - } - return "" -} - -func (m *StorageInfo) GetIO() string { - if m != nil { - return m.IO + return m.IOPS } return "" } type Storage struct { - Quantity *ResourcePair `protobuf:"bytes,1,opt,name=quantity,proto3" json:"quantity" yaml:"quantity"` - Info *StorageInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info" yaml:"info"` + 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{} } @@ -129,18 +113,18 @@ func (m *Storage) XXX_DiscardUnknown() { var xxx_messageInfo_Storage proto.InternalMessageInfo -func (m *Storage) GetQuantity() *ResourcePair { +func (m *Storage) GetQuantity() ResourcePair { if m != nil { return m.Quantity } - return nil + return ResourcePair{} } -func (m *Storage) GetInfo() *StorageInfo { +func (m *Storage) GetInfo() StorageInfo { if m != nil { return m.Info } - return nil + return StorageInfo{} } func init() { @@ -151,34 +135,30 @@ func init() { 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, 0xba, 0xa4, 0x42, 0xde, 0xdd, 0x33, 0xa0, 0x4b, 0xb7, 0xf3, 0xde, - 0xbc, 0x79, 0x33, 0xb3, 0x43, 0x26, 0xfc, 0x82, 0x97, 0xe7, 0x89, 0x90, 0x9b, 0x5c, 0x56, 0xa8, - 0xb6, 0xc9, 0xe6, 0x24, 0x29, 0x2b, 0x54, 0xbc, 0xc8, 0xe3, 0x95, 0xc2, 0x0a, 0x29, 0xb5, 0x19, - 0x71, 0x97, 0x11, 0x6f, 0x4e, 0x8e, 0x1e, 0x16, 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 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, + // 354 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x51, 0xbf, 0x4e, 0xc2, 0x40, + 0x1c, 0x6e, 0x4d, 0x51, 0x6c, 0x4d, 0x4c, 0x1a, 0x07, 0xc2, 0xd0, 0x23, 0x67, 0x4c, 0x5c, 0x6c, + 0x03, 0x2c, 0xc6, 0xb1, 0x4e, 0x4c, 0x62, 0x59, 0x8c, 0xdb, 0x41, 0xda, 0x72, 0x01, 0xee, 0x57, + 0xaf, 0x05, 0x43, 0xe2, 0x43, 0x38, 0xfa, 0x48, 0x8c, 0xc4, 0xc9, 0xe9, 0x62, 0xda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29, 0x5b, 0x81, 0xce, 0x55, 0xe5, 0x2f, 0x83, 0x83, 0x9d, 0x68, 0x3f, + 0x99, 0x06, 0x65, 0x11, 0xc8, 0xff, 0xb5, 0x3a, 0xe8, 0x50, 0xd5, 0xde, 0xc5, 0xf8, 0x97, 0x55, + 0x93, 0x51, 0x22, 0x39, 0x8a, 0x45, 0xb0, 0x37, 0x8a, 0x45, 0x80, 0x03, 0x49, 0xfa, 0xfd, 0x55, + 0xee, 0xe8, 0xeb, 0xdc, 0xd1, 0xbf, 0x73, 0x47, 0x7f, 0x2f, 0x1c, 0xed, 0xa3, 0x70, 0xb4, 0x75, + 0xe1, 0x68, 0x5f, 0x85, 0xa3, 0x3d, 0x77, 0x62, 0x9a, 0x8d, 0xe7, 0x43, 0x77, 0x04, 0x33, 0x4f, + 0x76, 0xde, 0xb0, 0x30, 0x7b, 0x05, 0x3e, 0xa9, 0x10, 0x49, 0xa8, 0x17, 0xc3, 0x9f, 0x77, 0x1b, + 0x1e, 0xcb, 0xb7, 0xea, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0xad, 0xe9, 0xbb, 0xb5, 0x20, 0x02, + 0x00, 0x00, } func (m *StorageInfo) Marshal() (dAtA []byte, err error) { @@ -201,32 +181,18 @@ func (m *StorageInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = 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))) + if len(m.IOPS) > 0 { + i -= len(m.IOPS) + copy(dAtA[i:], m.IOPS) + i = encodeVarintStorage(dAtA, i, uint64(len(m.IOPS))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } if len(m.Class) > 0 { i -= len(m.Class) copy(dAtA[i:], m.Class) i = encodeVarintStorage(dAtA, i, uint64(len(m.Class))) i-- - dAtA[i] = 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 @@ -252,30 +218,26 @@ func (m *Storage) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = 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)) + { + size, err := m.Info.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) } - 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] = 0x12 + { + size, err := m.Quantity.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0xa + i -= size + i = encodeVarintStorage(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -296,19 +258,11 @@ func (m *StorageInfo) Size() (n int) { } 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) + l = len(m.IOPS) if l > 0 { n += 1 + l + sovStorage(uint64(l)) } @@ -321,14 +275,10 @@ func (m *Storage) Size() (n int) { } 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)) - } + l = m.Quantity.Size() + n += 1 + l + sovStorage(uint64(l)) + l = m.Info.Size() + n += 1 + l + sovStorage(uint64(l)) return n } @@ -368,38 +318,6 @@ func (m *StorageInfo) Unmarshal(dAtA []byte) error { } 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) } @@ -431,41 +349,9 @@ func (m *StorageInfo) Unmarshal(dAtA []byte) error { } 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: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IO", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IOPS", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -493,7 +379,7 @@ func (m *StorageInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.IO = string(dAtA[iNdEx:postIndex]) + m.IOPS = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -574,9 +460,6 @@ func (m *Storage) Unmarshal(dAtA []byte) error { 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 } @@ -610,9 +493,6 @@ func (m *Storage) Unmarshal(dAtA []byte) error { 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 } diff --git a/go/inventory/v1/types.go b/go/inventory/v1/types.go index 770b2134..5718e8e7 100644 --- a/go/inventory/v1/types.go +++ b/go/inventory/v1/types.go @@ -4,24 +4,25 @@ import ( "sort" ) -type CPUs []CPU +type CPUInfoS []CPUInfo type GPUs []GPU type Nodes []Node type ClusterStorage []Storage -var _ sort.Interface = (*CPUs)(nil) var _ sort.Interface = (*GPUs)(nil) +var _ sort.Interface = (*CPUInfoS)(nil) +var _ sort.Interface = (*ClusterStorage)(nil) -func (s CPUs) Len() int { +func (s CPUInfoS) Len() int { return len(s) } -func (s CPUs) Swap(i, j int) { +func (s CPUInfoS) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s CPUs) Less(i, j int) bool { +func (s CPUInfoS) Less(i, j int) bool { a, b := s[i], s[j] if a.Vendor != b.Vendor { @@ -48,23 +49,61 @@ func (s GPUs) Swap(i, j int) { } 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 - // } + a, b := s[i], s[j] + + if !a.Quantity.Equal(b.Quantity) { + return a.Quantity.LT(b.Quantity) + } + + if a.Info.Vendor != b.Info.Vendor { + return a.Info.Vendor < b.Info.Vendor + } + + if a.Info.Vendor != b.Info.Vendor { + return a.Info.Vendor < b.Info.Vendor + } + + if a.Info.Name != b.Info.Name { + return a.Info.Name < b.Info.Name + } + + if a.Info.ModelID != b.Info.ModelID { + return a.Info.ModelID < b.Info.ModelID + } + + if a.Info.Interface != b.Info.Interface { + return a.Info.Interface < b.Info.Interface + } + + if a.Info.MemorySize != b.Info.MemorySize { + return a.Info.MemorySize < b.Info.MemorySize + } + + return false +} + +func (s ClusterStorage) Len() int { + return len(s) +} + +func (s ClusterStorage) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} + +func (s ClusterStorage) Less(i, j int) bool { + a, b := s[i], s[j] + + if !a.Quantity.Equal(b.Quantity) { + return a.Quantity.LT(b.Quantity) + } + + if a.Info.Class != b.Info.Class { + return a.Info.Class < b.Info.Class + } + + if a.Info.IOPS != b.Info.IOPS { + return a.Info.IOPS < b.Info.IOPS + } return false } diff --git a/proto/provider/akash/inventory/v1/cluster.proto b/proto/provider/akash/inventory/v1/cluster.proto index e4091e64..c271ce7a 100644 --- a/proto/provider/akash/inventory/v1/cluster.proto +++ b/proto/provider/akash/inventory/v1/cluster.proto @@ -13,7 +13,8 @@ message Cluster { option (gogoproto.equal) = false; repeated Node nodes = 1 [ - (gogoproto.nullable) = false, + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "Nodes", (gogoproto.customname) = "Nodes", (gogoproto.jsontag) = "nodes", (gogoproto.moretags) = "yaml:\"nodes\"" @@ -21,6 +22,7 @@ message Cluster { repeated Storage storage = 2 [ (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "ClusterStorage", (gogoproto.customname) = "Storage", (gogoproto.jsontag) = "storage", (gogoproto.moretags) = "yaml:\"storage\"" diff --git a/proto/provider/akash/inventory/v1/cpu.proto b/proto/provider/akash/inventory/v1/cpu.proto index 9d9b44ad..31306da0 100644 --- a/proto/provider/akash/inventory/v1/cpu.proto +++ b/proto/provider/akash/inventory/v1/cpu.proto @@ -6,6 +6,7 @@ import "gogoproto/gogo.proto"; import "akash/inventory/v1/resourcepair.proto"; option go_package = "github.com/akash-network/akash-api/go/inventory/v1"; +option (gogoproto.gogoproto_import) = false; message CPUInfo { string id = 1 [ @@ -32,12 +33,14 @@ message CPUInfo { message CPU { ResourcePair quantity = 1 [ + (gogoproto.nullable) = false, (gogoproto.customname) = "Quantity", (gogoproto.jsontag) = "quantity", (gogoproto.moretags) = "yaml:\"quantity\"" ]; repeated CPUInfo info = 2 [ + (gogoproto.nullable) = false, (gogoproto.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 index 70ae4730..cf8bd114 100644 --- a/proto/provider/akash/inventory/v1/gpu.proto +++ b/proto/provider/akash/inventory/v1/gpu.proto @@ -7,6 +7,7 @@ import "gogoproto/gogo.proto"; import "akash/inventory/v1/resourcepair.proto"; option go_package = "github.com/akash-network/akash-api/go/inventory/v1"; +option (gogoproto.gogoproto_import) = false; message GPUInfo { string vendor = 1 [ @@ -21,28 +22,30 @@ message GPUInfo { ]; string modelid = 3 [ (gogoproto.customname) = "ModelID", - (gogoproto.jsontag) = "modelid", - (gogoproto.moretags) = "yaml:\"modelid\"" + (gogoproto.jsontag) = "model_id", + (gogoproto.moretags) = "yaml:\"model_id\"" ]; string interface = 4 [ (gogoproto.customname) = "Interface", (gogoproto.jsontag) = "interface", (gogoproto.moretags) = "yaml:\"interface\"" ]; - string memory = 5 [ - (gogoproto.customname) = "Memory", - (gogoproto.jsontag) = "memory", - (gogoproto.moretags) = "yaml:\"memory\"" + string memory_size = 5 [ + (gogoproto.customname) = "MemorySize", + (gogoproto.jsontag) = "memory_size", + (gogoproto.moretags) = "yaml:\"memory_size\"" ]; } message GPU { ResourcePair quantity = 1 [ + (gogoproto.nullable) = false, (gogoproto.customname) = "Quantity", (gogoproto.jsontag) = "quantity", (gogoproto.moretags) = "yaml:\"quantity\"" ]; - repeated GPUInfo info = 2 [ + GPUInfo info = 2 [ + (gogoproto.nullable) = false, (gogoproto.customname) = "Info", (gogoproto.jsontag) = "info", (gogoproto.moretags) = "yaml:\"info\"" diff --git a/proto/provider/akash/inventory/v1/memory.proto b/proto/provider/akash/inventory/v1/memory.proto index a6493872..9b21e0bd 100644 --- a/proto/provider/akash/inventory/v1/memory.proto +++ b/proto/provider/akash/inventory/v1/memory.proto @@ -7,6 +7,7 @@ import "gogoproto/gogo.proto"; import "akash/inventory/v1/resourcepair.proto"; option go_package = "github.com/akash-network/akash-api/go/inventory/v1"; +option (gogoproto.gogoproto_import) = false; message MemoryInfo { string vendor = 1 [ @@ -19,10 +20,10 @@ message MemoryInfo { (gogoproto.jsontag) = "type", (gogoproto.moretags) = "yaml:\"type\"" ]; - string totalsize = 3 [ + string total_size = 3 [ (gogoproto.customname) = "TotalSize", - (gogoproto.jsontag) = "totalsize", - (gogoproto.moretags) = "yaml:\"totalsize\"" + (gogoproto.jsontag) = "total_size", + (gogoproto.moretags) = "yaml:\"total_size\"" ]; string speed = 4 [ (gogoproto.customname) = "Speed", @@ -43,4 +44,4 @@ message Memory { (gogoproto.jsontag) = "info", (gogoproto.moretags) = "yaml:\"info\"" ]; -} \ No newline at end of file +} diff --git a/proto/provider/akash/inventory/v1/node.proto b/proto/provider/akash/inventory/v1/node.proto index 7929751c..94ff9d64 100644 --- a/proto/provider/akash/inventory/v1/node.proto +++ b/proto/provider/akash/inventory/v1/node.proto @@ -13,7 +13,6 @@ 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\"" @@ -21,13 +20,12 @@ message Node { Memory memory = 2 [ (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "Memory", (gogoproto.customname) = "Memory", (gogoproto.jsontag) = "memory", (gogoproto.moretags) = "yaml:\"memory\"" ]; - GPU gpu = 3 [ + repeated GPU gpu = 3 [ (gogoproto.nullable) = false, (gogoproto.castrepeated) = "GPUs", (gogoproto.customname) = "Gpus", @@ -35,9 +33,9 @@ message Node { (gogoproto.moretags) = "yaml:\"gpus\"" ]; - Storage storage = 4 [ + repeated Storage storage = 4 [ (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "Storage", + (gogoproto.castrepeated) = "ClusterStorage", (gogoproto.customname) = "Storage", (gogoproto.jsontag) = "storage", (gogoproto.moretags) = "yaml:\"storage\"" diff --git a/proto/provider/akash/inventory/v1/resourcepair.proto b/proto/provider/akash/inventory/v1/resourcepair.proto index 4c7ac552..0404d213 100644 --- a/proto/provider/akash/inventory/v1/resourcepair.proto +++ b/proto/provider/akash/inventory/v1/resourcepair.proto @@ -7,6 +7,7 @@ import "gogoproto/gogo.proto"; import "k8s.io/apimachinery/pkg/api/resource/generated.proto"; option go_package = "github.com/akash-network/akash-api/go/inventory/v1"; +option (gogoproto.gogoproto_import) = false; message ResourcePair { option (gogoproto.equal) = false; diff --git a/proto/provider/akash/inventory/v1/storage.proto b/proto/provider/akash/inventory/v1/storage.proto index 19af668f..2ab086e2 100644 --- a/proto/provider/akash/inventory/v1/storage.proto +++ b/proto/provider/akash/inventory/v1/storage.proto @@ -7,39 +7,32 @@ import "gogoproto/gogo.proto"; import "akash/inventory/v1/resourcepair.proto"; option go_package = "github.com/akash-network/akash-api/go/inventory/v1"; +option (gogoproto.gogoproto_import) = false; message StorageInfo { - string vendor = 1 [ - (gogoproto.customname) = "Vendor", - (gogoproto.jsontag) = "vendor", - (gogoproto.moretags) = "yaml:\"vendor\"" - ]; - string class = 2 [ + string class = 1 [ (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\"" + string IOPS = 2 [ + (gogoproto.customname) = "IOPS", + (gogoproto.jsontag) = "iops", + (gogoproto.moretags) = "yaml:\"iops\"" ]; } message Storage { ResourcePair quantity = 1 [ + (gogoproto.nullable) = false, (gogoproto.customname) = "Quantity", (gogoproto.jsontag) = "quantity", (gogoproto.moretags) = "yaml:\"quantity\"" ]; StorageInfo info = 2 [ + (gogoproto.nullable) = false, (gogoproto.customname) = "Info", (gogoproto.jsontag) = "info", (gogoproto.moretags) = "yaml:\"info\"" ]; - } \ No newline at end of file + }