From 823d3b0a5ee59ebae3e070a6bfb44db7631f1735 Mon Sep 17 00:00:00 2001 From: Artur Troian Date: Tue, 17 Oct 2023 11:36:57 -0400 Subject: [PATCH] feat: inventory api Signed-off-by: Artur Troian --- go/inventory/v1/cluster.pb.go | 510 ++++++++++++++++++ go/inventory/v1/cpu.pb.go | 424 +++++++++++++++ go/inventory/v1/gpu.pb.go | 262 +++++++++ go/inventory/v1/node.pb.go | 395 ++++++++++++++ go/inventory/v1/resourcepair.go | 9 + go/inventory/v1/resourcepair.pb.go | 454 ++++++++++++++++ go/inventory/v1/types.go | 70 +++ go/node/deployment/v1beta3/resourceunit.pb.go | 40 +- go/node/market/v1beta3/bid.go | 38 ++ go/node/market/v1beta3/bid.pb.go | 426 ++++++++++++--- go/node/take/v1beta3/params.pb.go | 1 + proto/node/akash/base/v1beta3/resources.proto | 8 +- .../deployment/v1beta3/resourceunit.proto | 2 +- proto/node/akash/market/v1beta3/bid.proto | 59 +- .../provider/akash/inventory/v1/cluster.proto | 29 + proto/provider/akash/inventory/v1/cpu.proto | 32 ++ proto/provider/akash/inventory/v1/gpu.proto | 32 ++ proto/provider/akash/inventory/v1/node.proto | 25 + .../akash/inventory/v1/resourcepair.proto | 32 ++ script/protocgen-legacy.sh | 1 + 20 files changed, 2760 insertions(+), 89 deletions(-) create mode 100644 go/inventory/v1/cluster.pb.go create mode 100644 go/inventory/v1/cpu.pb.go create mode 100644 go/inventory/v1/gpu.pb.go create mode 100644 go/inventory/v1/node.pb.go create mode 100644 go/inventory/v1/resourcepair.go create mode 100644 go/inventory/v1/resourcepair.pb.go create mode 100644 go/inventory/v1/types.go create mode 100644 go/node/market/v1beta3/bid.go create mode 100644 proto/provider/akash/inventory/v1/cluster.proto create mode 100644 proto/provider/akash/inventory/v1/cpu.proto create mode 100644 proto/provider/akash/inventory/v1/gpu.proto create mode 100644 proto/provider/akash/inventory/v1/node.proto create mode 100644 proto/provider/akash/inventory/v1/resourcepair.proto diff --git a/go/inventory/v1/cluster.pb.go b/go/inventory/v1/cluster.pb.go new file mode 100644 index 00000000..fb2f8675 --- /dev/null +++ b/go/inventory/v1/cluster.pb.go @@ -0,0 +1,510 @@ +// 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" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +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") + proto.RegisterMapType((ClusterStorage)(nil), "akash.inventory.v1.Cluster.StorageEntry") +} + +func init() { proto.RegisterFile("akash/inventory/v1/cluster.proto", fileDescriptor_205585ebfe7f68ce) } + +var fileDescriptor_205585ebfe7f68ce = []byte{ + // 368 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0x31, 0x4b, 0xfb, 0x40, + 0x18, 0xc6, 0x73, 0xed, 0xbf, 0xff, 0x62, 0x5a, 0x8a, 0x04, 0x87, 0x50, 0x30, 0x17, 0x02, 0x42, + 0x16, 0x13, 0x5a, 0x41, 0xa4, 0x83, 0x43, 0xc5, 0x4d, 0x44, 0xe2, 0x26, 0x82, 0x5c, 0xdb, 0x23, + 0x0d, 0x6d, 0x73, 0xe5, 0x72, 0x89, 0x64, 0xf5, 0x13, 0xf8, 0x11, 0x9c, 0xfd, 0x24, 0x1d, 0x0b, + 0x2e, 0x4e, 0xa7, 0xa4, 0x8b, 0x74, 0xec, 0xe8, 0x24, 0xc9, 0x5d, 0x45, 0x31, 0xdb, 0xfb, 0xe6, + 0xf9, 0xdd, 0xf3, 0x3c, 0xe4, 0x55, 0x4d, 0x34, 0x41, 0xd1, 0xd8, 0x0d, 0xc2, 0x04, 0x87, 0x8c, + 0xd0, 0xd4, 0x4d, 0x3a, 0xee, 0x70, 0x1a, 0x47, 0x0c, 0x53, 0x67, 0x4e, 0x09, 0x23, 0x9a, 0x56, + 0x10, 0xce, 0x37, 0xe1, 0x24, 0x9d, 0xf6, 0x9e, 0x4f, 0x7c, 0x52, 0xc8, 0x6e, 0x3e, 0x09,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0xef, 0x99, 0x01, 0x1e, 0x57, 0x86, 0xb2, 0x5c, 0x19, 0xca, 0xeb, + 0xca, 0x50, 0x6e, 0xba, 0x7e, 0xc0, 0xc6, 0xf1, 0xc0, 0x19, 0x92, 0x99, 0x5b, 0xd8, 0x1e, 0x86, + 0x98, 0xdd, 0x13, 0x3a, 0x91, 0x1b, 0x9a, 0x07, 0xae, 0x4f, 0x7e, 0x9d, 0x6d, 0xf0, 0xbf, 0x38, + 0xd5, 0xd1, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x26, 0x2a, 0xd8, 0x11, 0x3e, 0x02, 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 k := range m.Storage { + v := m.Storage[k] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCluster(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintCluster(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintCluster(dAtA, i, uint64(baseI-i)) + 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 k, v := range m.Storage { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovCluster(uint64(len(k))) + 1 + l + sovCluster(uint64(l)) + n += mapEntrySize + 1 + sovCluster(uint64(mapEntrySize)) + } + } + 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 + } + if m.Storage == nil { + m.Storage = make(ClusterStorage) + } + var mapkey string + mapvalue := &ResourcePair{} + for iNdEx < postIndex { + entryPreIndex := 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) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCluster + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthCluster + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthCluster + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCluster + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthCluster + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthCluster + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &ResourcePair{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipCluster(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCluster + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Storage[mapkey] = *mapvalue + 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..b0753669 --- /dev/null +++ b/go/inventory/v1/cpu.pb.go @@ -0,0 +1,424 @@ +// 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 CPU 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"` +} + +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{0} +} +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) GetID() string { + if m != nil { + return m.ID + } + return "" +} + +func (m *CPU) GetVendor() string { + if m != nil { + return m.Vendor + } + return "" +} + +func (m *CPU) GetModel() string { + if m != nil { + return m.Model + } + return "" +} + +func init() { + proto.RegisterType((*CPU)(nil), "akash.inventory.v1.CPU") +} + +func init() { proto.RegisterFile("akash/inventory/v1/cpu.proto", fileDescriptor_ed2b8a0bd798e5a3) } + +var fileDescriptor_ed2b8a0bd798e5a3 = []byte{ + // 272 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xcc, 0x4e, 0x2c, + 0xce, 0xd0, 0xcf, 0xcc, 0x2b, 0x4b, 0xcd, 0x2b, 0xc9, 0x2f, 0xaa, 0xd4, 0x2f, 0x33, 0xd4, 0x4f, + 0x2e, 0x28, 0xd5, 0x2b, 0x28, 0xca, 0x2f,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f, 0x2c, + 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x07, 0x7b, 0x5d, 0x37, 0x2f, 0xb5, 0xa4, 0x3c, + 0xbf, 0x28, 0x1b, 0xca, 0x4b, 0x2c, 0xc8, 0xd4, 0x4f, 0xcf, 0x47, 0x09, 0xad, 0x24, 0x36, 0x70, + 0x00, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x6b, 0x9a, 0xe6, 0xfa, 0x4a, 0x01, 0x00, 0x00, +} + +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.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 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 *CPU) 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)) + } + 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 *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 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 + 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..791d30a1 --- /dev/null +++ b/go/inventory/v1/gpu.pb.go @@ -0,0 +1,262 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: akash/inventory/v1/gpu.proto + +package v1 + +import ( + fmt "fmt" + 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 GPU struct { +} + +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{0} +} +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 init() { + proto.RegisterType((*GPU)(nil), "akash.inventory.v1.GPU") +} + +func init() { proto.RegisterFile("akash/inventory/v1/gpu.proto", fileDescriptor_2cc01b12bd00ffcc) } + +var fileDescriptor_2cc01b12bd00ffcc = []byte{ + // 136 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xcc, 0x4e, 0x2c, + 0xce, 0xd0, 0xcf, 0xcc, 0x2b, 0x4b, 0xcd, 0x2b, 0xc9, 0x2f, 0xaa, 0xd4, 0x2f, 0x33, 0xd4, 0x4f, + 0x2f, 0x28, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x02, 0xcb, 0xea, 0xc1, 0x65, 0xf5, + 0xca, 0x0c, 0x95, 0x58, 0xb9, 0x98, 0xdd, 0x03, 0x42, 0x9d, 0x7c, 0x4e, 0x3c, 0x92, 0x63, 0xbc, + 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, + 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x28, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, + 0x57, 0x1f, 0xac, 0x5f, 0x37, 0x2f, 0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x1b, 0xca, 0x4b, 0x2c, 0xc8, + 0xd4, 0x4f, 0xcf, 0x47, 0xb1, 0x32, 0x89, 0x0d, 0x6c, 0x9f, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, + 0x8a, 0x85, 0xa8, 0x98, 0x8f, 0x00, 0x00, 0x00, +} + +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 + 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 *GPU) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = 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 *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 { + 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/node.pb.go b/go/inventory/v1/node.pb.go new file mode 100644 index 00000000..701702da --- /dev/null +++ b/go/inventory/v1/node.pb.go @@ -0,0 +1,395 @@ +// 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 CPUs `protobuf:"bytes,1,rep,name=cpu,proto3,castrepeated=CPUs" json:"cpu" yaml:"cpu"` + GPU GPUs `protobuf:"bytes,2,rep,name=gpu,proto3,castrepeated=GPUs" json:"gpu" yaml:"gpu"` +} + +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() CPUs { + if m != nil { + return m.CPU + } + return nil +} + +func (m *Node) GetGPU() GPUs { + if m != nil { + return m.GPU + } + return nil +} + +func init() { + proto.RegisterType((*Node)(nil), "akash.inventory.v1.Node") +} + +func init() { proto.RegisterFile("akash/inventory/v1/node.proto", fileDescriptor_5f97c0fb35079221) } + +var fileDescriptor_5f97c0fb35079221 = []byte{ + // 260 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0xcc, 0x4e, 0x2c, + 0xce, 0xd0, 0xcf, 0xcc, 0x2b, 0x4b, 0xcd, 0x2b, 0xc9, 0x2f, 0xaa, 0xd4, 0x2f, 0x33, 0xd4, 0xcf, + 0xcb, 0x4f, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x02, 0x4b, 0xeb, 0xc1, 0xa5, + 0xf5, 0xca, 0x0c, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0xd2, 0xfa, 0x20, 0x16, 0x44, 0xa5, + 0x94, 0x0c, 0x16, 0x83, 0x92, 0x0b, 0x4a, 0xf1, 0xc8, 0xa6, 0xc3, 0x64, 0x95, 0x36, 0x30, 0x72, + 0xb1, 0xf8, 0xe5, 0xa7, 0xa4, 0x0a, 0x05, 0x73, 0x31, 0x27, 0x17, 0x94, 0x4a, 0x30, 0x2a, 0x30, + 0x6b, 0x70, 0x1b, 0x89, 0xeb, 0x61, 0x5a, 0xae, 0xe7, 0x1c, 0x10, 0xea, 0xa4, 0x71, 0xe2, 0x9e, + 0x3c, 0xc3, 0xa3, 0x7b, 0xf2, 0xcc, 0xce, 0x01, 0xa1, 0xaf, 0xee, 0xc9, 0x83, 0xb4, 0x7c, 0xba, + 0x27, 0xcf, 0x55, 0x99, 0x98, 0x9b, 0x63, 0xa5, 0x94, 0x5c, 0x50, 0xaa, 0xb4, 0xea, 0xbe, 0x3c, + 0x8b, 0x73, 0x40, 0x68, 0x71, 0x10, 0x48, 0x0a, 0x64, 0x68, 0x7a, 0x41, 0xa9, 0x04, 0x13, 0x6e, + 0x43, 0xdd, 0x91, 0x0d, 0x75, 0x87, 0x18, 0x9a, 0x8e, 0x6c, 0x68, 0x3a, 0xd4, 0x50, 0x77, 0xb0, + 0xa1, 0xe9, 0x05, 0xa5, 0x4e, 0x3e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, + 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, + 0x65, 0x94, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0xb6, 0x4b, 0x37, + 0x2f, 0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x1b, 0xca, 0x4b, 0x2c, 0xc8, 0xd4, 0x4f, 0xcf, 0x47, 0x09, + 0x8a, 0x24, 0x36, 0x70, 0x38, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe3, 0x94, 0x95, 0x02, + 0x8e, 0x01, 0x00, 0x00, +} + +func (m *Node) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Node) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Node) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GPU) > 0 { + for iNdEx := len(m.GPU) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.GPU[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNode(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.CPU) > 0 { + for iNdEx := len(m.CPU) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CPU[iNdEx].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 + if len(m.CPU) > 0 { + for _, e := range m.CPU { + l = e.Size() + n += 1 + l + sovNode(uint64(l)) + } + } + if len(m.GPU) > 0 { + for _, e := range m.GPU { + l = e.Size() + n += 1 + l + sovNode(uint64(l)) + } + } + return n +} + +func sovNode(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozNode(x uint64) (n int) { + return sovNode(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Node) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Node: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Node: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CPU", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CPU = append(m.CPU, CPU{}) + if err := m.CPU[len(m.CPU)-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 GPU", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNode + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNode + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNode + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GPU = append(m.GPU, GPU{}) + if err := m.GPU[len(m.GPU)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNode(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNode + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipNode(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNode + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNode + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNode + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthNode + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupNode + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthNode + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthNode = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowNode = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupNode = fmt.Errorf("proto: unexpected end of group") +) diff --git a/go/inventory/v1/resourcepair.go b/go/inventory/v1/resourcepair.go new file mode 100644 index 00000000..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..dd4a8db5 --- /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{ + // 427 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xbd, 0x8e, 0xd4, 0x30, + 0x14, 0x85, 0x63, 0x06, 0x21, 0x6d, 0x86, 0x02, 0x45, 0x5b, 0x8c, 0x16, 0x11, 0xaf, 0x22, 0x21, + 0x6d, 0x01, 0xb6, 0x26, 0x4b, 0xb1, 0xda, 0x6e, 0x86, 0x96, 0x02, 0x52, 0xd2, 0x39, 0xc9, 0x55, + 0xc6, 0xca, 0x8f, 0x23, 0xc7, 0x09, 0x4a, 0x87, 0x28, 0xa9, 0x78, 0x04, 0x6a, 0x1e, 0x83, 0x6a, + 0xcb, 0x2d, 0xa9, 0x0c, 0xca, 0x34, 0x30, 0xe5, 0x3c, 0x01, 0xca, 0xcf, 0x4c, 0x82, 0xa0, 0x40, + 0xdb, 0xc5, 0xf7, 0x1e, 0x7f, 0xe7, 0x28, 0xc7, 0xe6, 0x53, 0x16, 0xb3, 0x62, 0x43, 0x79, 0x56, + 0x41, 0xa6, 0x84, 0xac, 0x69, 0xb5, 0xa4, 0x12, 0x0a, 0x51, 0xca, 0x00, 0x72, 0xc6, 0x25, 0xc9, + 0xa5, 0x50, 0xc2, 0xb2, 0x3a, 0x19, 0x39, 0xca, 0x48, 0xb5, 0x3c, 0x3b, 0x8d, 0x44, 0x24, 0xba, + 0x35, 0x6d, 0xbf, 0x7a, 0xe5, 0x99, 0xd3, 0x03, 0x7d, 0x56, 0x00, 0xad, 0x96, 0x3e, 0x28, 0x76, + 0x49, 0x99, 0x52, 0x92, 0xfb, 0xa5, 0x82, 0x41, 0xf3, 0x22, 0xbe, 0x2a, 0x08, 0x17, 0x94, 0xe5, + 0x3c, 0x65, 0xc1, 0x86, 0x67, 0x20, 0x6b, 0x9a, 0xc7, 0x51, 0x3b, 0x38, 0xba, 0xd3, 0x08, 0x32, + 0x90, 0x4c, 0x41, 0xd8, 0xdf, 0x72, 0x7e, 0xcd, 0xcc, 0x87, 0xde, 0xb0, 0x7c, 0xcd, 0xb8, 0xb4, + 0x3e, 0x22, 0x73, 0xce, 0x92, 0x44, 0x04, 0x4c, 0x31, 0x3f, 0x81, 0x05, 0x3a, 0x47, 0x17, 0x73, + 0x97, 0x90, 0x9e, 0x4e, 0xa6, 0x74, 0x92, 0xc7, 0x51, 0x3b, 0x20, 0x07, 0x3a, 0x79, 0x53, 0xb2, + 0x4c, 0x71, 0x55, 0xaf, 0xaf, 0x6e, 0x34, 0x36, 0x1a, 0x8d, 0xe7, 0xab, 0x11, 0xb5, 0xd3, 0x78, + 0x4a, 0xde, 0x6b, 0x6c, 0xd5, 0x2c, 0x4d, 0xae, 0x9d, 0xc9, 0xd0, 0xf1, 0xa6, 0x12, 0xeb, 0x3d, + 0x32, 0x4f, 0x86, 0x33, 0x84, 0x8b, 0x7b, 0x77, 0x8a, 0xe2, 0x0e, 0x51, 0x4e, 0x56, 0x07, 0xd0, + 0x4e, 0xe3, 0x91, 0xba, 0xd7, 0xf8, 0xd1, 0x1f, 0x31, 0x20, 0x74, 0xbc, 0x71, 0x6d, 0x7d, 0x45, + 0xa6, 0x79, 0xfc, 0xd5, 0xc5, 0x62, 0x76, 0x3e, 0xbb, 0x98, 0xbb, 0x4f, 0x48, 0x5f, 0x5d, 0x5b, + 0x08, 0x19, 0x0a, 0x21, 0xab, 0x83, 0x6a, 0xfd, 0x01, 0xb5, 0x9e, 0x3b, 0x8d, 0x4f, 0xc7, 0x9b, + 0xcf, 0x44, 0xca, 0x15, 0xa4, 0xb9, 0xaa, 0xf7, 0x1a, 0x3f, 0x1e, 0x1c, 0xff, 0xb1, 0x75, 0xbe, + 0x7c, 0xc7, 0x2f, 0x23, 0xae, 0x36, 0xa5, 0x4f, 0x02, 0x91, 0xd2, 0xce, 0xe8, 0x79, 0x06, 0xea, + 0x9d, 0x90, 0xf1, 0x70, 0x6a, 0x1b, 0x8d, 0x04, 0xcd, 0x44, 0x08, 0x54, 0xd5, 0x39, 0x14, 0xf4, + 0xaf, 0x0c, 0x85, 0x37, 0x49, 0x7d, 0x7d, 0xff, 0xe7, 0x67, 0x6c, 0xac, 0x5f, 0xdd, 0x34, 0x36, + 0xba, 0x6d, 0x6c, 0xf4, 0xa3, 0xb1, 0xd1, 0xa7, 0xad, 0x6d, 0xdc, 0x6e, 0x6d, 0xe3, 0xdb, 0xd6, + 0x36, 0xde, 0xba, 0xff, 0x67, 0x38, 0x7d, 0xd0, 0xfe, 0x83, 0xee, 0x01, 0x5d, 0xfe, 0x0e, 0x00, + 0x00, 0xff, 0xff, 0x71, 0x56, 0x38, 0x86, 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/types.go b/go/inventory/v1/types.go new file mode 100644 index 00000000..7a0d8791 --- /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 map[string]ResourcePair + +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/deployment/v1beta3/resourceunit.pb.go b/go/node/deployment/v1beta3/resourceunit.pb.go index 9bbbe3aa..39c5cdbc 100644 --- a/go/node/deployment/v1beta3/resourceunit.pb.go +++ b/go/node/deployment/v1beta3/resourceunit.pb.go @@ -106,13 +106,43 @@ var fileDescriptor_fb431767d5aa2e0f = []byte{ 0x16, 0xb6, 0xa5, 0xdb, 0xd6, 0x36, 0x35, 0x7a, 0x81, 0x96, 0xad, 0x3b, 0xb3, 0x95, 0xe5, 0x2c, 0xa6, 0xf6, 0x6f, 0xd5, 0xe8, 0x0c, 0xeb, 0xab, 0x0e, 0x2b, 0x0d, 0xf0, 0x2d, 0x8d, 0x6f, 0x80, 0x71, 0xbf, 0x5b, 0x15, 0xaa, 0x22, 0x95, 0x65, 0x1f, 0xa9, 0x46, 0x2f, 0xd0, 0xf2, 0xe8, 0xcf, - 0xc7, 0xab, 0x6b, 0xf8, 0x0f, 0x8b, 0x95, 0x83, 0x96, 0x2b, 0x07, 0xbd, 0xaf, 0x1c, 0xf4, 0xb2, - 0x76, 0x8c, 0xe5, 0xda, 0x31, 0xde, 0xd6, 0x8e, 0xf1, 0x78, 0x9d, 0x30, 0x39, 0x29, 0x22, 0x1c, - 0x43, 0x4a, 0xd4, 0xfd, 0x97, 0x9c, 0xca, 0x67, 0xc8, 0xa7, 0xf5, 0x14, 0x66, 0x8c, 0x24, 0x40, - 0x38, 0x8c, 0xe9, 0x0f, 0xcf, 0x1b, 0xfd, 0x55, 0xbf, 0x77, 0xf8, 0x15, 0x00, 0x00, 0xff, 0xff, - 0xf8, 0x9f, 0xec, 0xd3, 0x01, 0x02, 0x00, 0x00, + 0xc7, 0xab, 0x8b, 0xfc, 0x87, 0xc5, 0xca, 0x41, 0xcb, 0x95, 0x83, 0xde, 0x57, 0x0e, 0x7a, 0x59, + 0x3b, 0xc6, 0x72, 0xed, 0x18, 0x6f, 0x6b, 0xc7, 0x78, 0xbc, 0x4e, 0x98, 0x9c, 0x14, 0x11, 0x8e, + 0x21, 0x25, 0xea, 0xfe, 0x4b, 0x4e, 0xe5, 0x33, 0xe4, 0xd3, 0x7a, 0x0a, 0x33, 0x46, 0x12, 0x20, + 0x1c, 0xc6, 0xf4, 0x87, 0xe7, 0x8d, 0xfe, 0xaa, 0xdf, 0x3b, 0xfc, 0x0a, 0x00, 0x00, 0xff, 0xff, + 0xaf, 0x0a, 0x29, 0xb9, 0x01, 0x02, 0x00, 0x00, } +func (this *ResourceUnit) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ResourceUnit) + if !ok { + that2, ok := that.(ResourceUnit) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Resources.Equal(&that1.Resources) { + return false + } + if this.Count != that1.Count { + return false + } + if !this.Price.Equal(&that1.Price) { + return false + } + return true +} func (m *ResourceUnit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) diff --git a/go/node/market/v1beta3/bid.go b/go/node/market/v1beta3/bid.go new file mode 100644 index 00000000..23c22086 --- /dev/null +++ b/go/node/market/v1beta3/bid.go @@ -0,0 +1,38 @@ +package v1beta3 + +import ( + "sort" +) + +type ResourcesOffer []ResourceOffer + +var _ sort.Interface = (*ResourcesOffer)(nil) + +func (r *ResourceOffer) Dup() ResourceOffer { + return ResourceOffer{ + Resources: r.Resources.Dup(), + Count: r.Count, + } +} + +func (s ResourcesOffer) Len() int { + return len(s) +} + +func (s ResourcesOffer) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} + +func (s ResourcesOffer) Less(i, j int) bool { + return s[i].Resources.ID < s[j].Resources.ID +} + +func (s ResourcesOffer) Dup() ResourcesOffer { + res := make(ResourcesOffer, 0, len(s)) + + for _, ru := range s { + res = append(res, ru.Dup()) + } + + return s +} diff --git a/go/node/market/v1beta3/bid.pb.go b/go/node/market/v1beta3/bid.pb.go index 7786a2c1..4856e0f4 100644 --- a/go/node/market/v1beta3/bid.pb.go +++ b/go/node/market/v1beta3/bid.pb.go @@ -5,6 +5,7 @@ package v1beta3 import ( fmt "fmt" + v1beta3 "github.com/akash-network/akash-api/go/node/types/v1beta3" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" @@ -61,22 +62,75 @@ func (x Bid_State) String() string { } func (Bid_State) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d666bdb5fcae295d, []int{5, 0} + return fileDescriptor_d666bdb5fcae295d, []int{6, 0} +} + +type ResourceOffer struct { + Resources v1beta3.Resources `protobuf:"bytes,1,opt,name=resources,proto3" json:"resources" yaml:"resources"` + Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count" yaml:"count"` +} + +func (m *ResourceOffer) Reset() { *m = ResourceOffer{} } +func (m *ResourceOffer) String() string { return proto.CompactTextString(m) } +func (*ResourceOffer) ProtoMessage() {} +func (*ResourceOffer) Descriptor() ([]byte, []int) { + return fileDescriptor_d666bdb5fcae295d, []int{0} +} +func (m *ResourceOffer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourceOffer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResourceOffer.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 *ResourceOffer) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceOffer.Merge(m, src) +} +func (m *ResourceOffer) XXX_Size() int { + return m.Size() +} +func (m *ResourceOffer) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceOffer.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourceOffer proto.InternalMessageInfo + +func (m *ResourceOffer) GetResources() v1beta3.Resources { + if m != nil { + return m.Resources + } + return v1beta3.Resources{} +} + +func (m *ResourceOffer) GetCount() uint32 { + if m != nil { + return m.Count + } + return 0 } // MsgCreateBid defines an SDK message for creating Bid type MsgCreateBid struct { - Order OrderID `protobuf:"bytes,1,opt,name=order,proto3" json:"order" yaml:"order"` - Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider" yaml:"provider"` - Price types.DecCoin `protobuf:"bytes,3,opt,name=price,proto3" json:"price" yaml:"price"` - Deposit types.Coin `protobuf:"bytes,4,opt,name=deposit,proto3" json:"deposit" yaml:"deposit"` + Order OrderID `protobuf:"bytes,1,opt,name=order,proto3" json:"order" yaml:"order"` + Provider string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider" yaml:"provider"` + Price types.DecCoin `protobuf:"bytes,3,opt,name=price,proto3" json:"price" yaml:"price"` + Deposit types.Coin `protobuf:"bytes,4,opt,name=deposit,proto3" json:"deposit" yaml:"deposit"` + ResourcesOffer ResourcesOffer `protobuf:"bytes,5,rep,name=resources_offer,json=resourcesOffer,proto3,castrepeated=ResourcesOffer" json:"resources_offer" yaml:"resources_offer"` } func (m *MsgCreateBid) Reset() { *m = MsgCreateBid{} } func (m *MsgCreateBid) String() string { return proto.CompactTextString(m) } func (*MsgCreateBid) ProtoMessage() {} func (*MsgCreateBid) Descriptor() ([]byte, []int) { - return fileDescriptor_d666bdb5fcae295d, []int{0} + return fileDescriptor_d666bdb5fcae295d, []int{1} } func (m *MsgCreateBid) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -133,6 +187,13 @@ func (m *MsgCreateBid) GetDeposit() types.Coin { return types.Coin{} } +func (m *MsgCreateBid) GetResourcesOffer() ResourcesOffer { + if m != nil { + return m.ResourcesOffer + } + return nil +} + // MsgCreateBidResponse defines the Msg/CreateBid response type. type MsgCreateBidResponse struct { } @@ -141,7 +202,7 @@ func (m *MsgCreateBidResponse) Reset() { *m = MsgCreateBidResponse{} } func (m *MsgCreateBidResponse) String() string { return proto.CompactTextString(m) } func (*MsgCreateBidResponse) ProtoMessage() {} func (*MsgCreateBidResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d666bdb5fcae295d, []int{1} + return fileDescriptor_d666bdb5fcae295d, []int{2} } func (m *MsgCreateBidResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -179,7 +240,7 @@ func (m *MsgCloseBid) Reset() { *m = MsgCloseBid{} } func (m *MsgCloseBid) String() string { return proto.CompactTextString(m) } func (*MsgCloseBid) ProtoMessage() {} func (*MsgCloseBid) Descriptor() ([]byte, []int) { - return fileDescriptor_d666bdb5fcae295d, []int{2} + return fileDescriptor_d666bdb5fcae295d, []int{3} } func (m *MsgCloseBid) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -223,7 +284,7 @@ func (m *MsgCloseBidResponse) Reset() { *m = MsgCloseBidResponse{} } func (m *MsgCloseBidResponse) String() string { return proto.CompactTextString(m) } func (*MsgCloseBidResponse) ProtoMessage() {} func (*MsgCloseBidResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d666bdb5fcae295d, []int{3} + return fileDescriptor_d666bdb5fcae295d, []int{4} } func (m *MsgCloseBidResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -265,7 +326,7 @@ type BidID struct { func (m *BidID) Reset() { *m = BidID{} } func (*BidID) ProtoMessage() {} func (*BidID) Descriptor() ([]byte, []int) { - return fileDescriptor_d666bdb5fcae295d, []int{4} + return fileDescriptor_d666bdb5fcae295d, []int{5} } func (m *BidID) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -340,7 +401,7 @@ type Bid struct { func (m *Bid) Reset() { *m = Bid{} } func (*Bid) ProtoMessage() {} func (*Bid) Descriptor() ([]byte, []int) { - return fileDescriptor_d666bdb5fcae295d, []int{5} + return fileDescriptor_d666bdb5fcae295d, []int{6} } func (m *Bid) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -411,7 +472,7 @@ func (m *BidFilters) Reset() { *m = BidFilters{} } func (m *BidFilters) String() string { return proto.CompactTextString(m) } func (*BidFilters) ProtoMessage() {} func (*BidFilters) Descriptor() ([]byte, []int) { - return fileDescriptor_d666bdb5fcae295d, []int{6} + return fileDescriptor_d666bdb5fcae295d, []int{7} } func (m *BidFilters) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -484,6 +545,7 @@ func (m *BidFilters) GetState() string { func init() { proto.RegisterEnum("akash.market.v1beta3.Bid_State", Bid_State_name, Bid_State_value) + proto.RegisterType((*ResourceOffer)(nil), "akash.market.v1beta3.ResourceOffer") proto.RegisterType((*MsgCreateBid)(nil), "akash.market.v1beta3.MsgCreateBid") proto.RegisterType((*MsgCreateBidResponse)(nil), "akash.market.v1beta3.MsgCreateBidResponse") proto.RegisterType((*MsgCloseBid)(nil), "akash.market.v1beta3.MsgCloseBid") @@ -496,54 +558,128 @@ func init() { func init() { proto.RegisterFile("akash/market/v1beta3/bid.proto", fileDescriptor_d666bdb5fcae295d) } var fileDescriptor_d666bdb5fcae295d = []byte{ - // 750 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0xbd, 0x6e, 0xdb, 0x48, - 0x10, 0xc7, 0x49, 0x89, 0x94, 0xad, 0x95, 0x3f, 0x04, 0xda, 0x3e, 0xd8, 0xba, 0x33, 0x97, 0xc7, - 0xe2, 0xe0, 0xe6, 0x48, 0xd8, 0xae, 0xce, 0x57, 0x99, 0x16, 0xee, 0x20, 0x20, 0x81, 0x13, 0x3a, - 0x48, 0x91, 0x14, 0x06, 0xc5, 0x5d, 0xd0, 0x0b, 0x4b, 0x5c, 0x9a, 0x64, 0x64, 0xe4, 0x0d, 0x02, - 0x57, 0x01, 0xd2, 0xa4, 0x71, 0x60, 0x20, 0x0f, 0x92, 0xd6, 0xa5, 0xcb, 0xa4, 0x21, 0x02, 0xb9, - 0x09, 0x54, 0xea, 0x09, 0x82, 0xfd, 0xd0, 0x87, 0x03, 0x25, 0x40, 0x0a, 0x77, 0xa9, 0xa4, 0xf9, - 0xcf, 0xfe, 0x86, 0xc3, 0xf9, 0x0f, 0x49, 0x60, 0x06, 0xa7, 0x41, 0x76, 0xe2, 0x76, 0x83, 0xf4, - 0x14, 0xe7, 0x6e, 0x6f, 0xbb, 0x8d, 0xf3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0x39, 0x84, - 0x13, 0x9a, 0x91, 0x7c, 0x5d, 0xe3, 0x45, 0x37, 0x66, 0x16, 0xe5, 0x15, 0xff, 0x94, 0x15, 0x47, - 0xc4, 0xb0, 0x80, 0x4b, 0xa2, 0xa6, 0x14, 0x6c, 0x7f, 0x94, 0xda, 0xd3, 0xbe, 0x5c, 0x41, 0xc5, - 0xfe, 0x0d, 0xac, 0x4e, 0x8f, 0xd6, 0xc7, 0x59, 0x42, 0xe3, 0x0c, 0xdb, 0x04, 0xd4, 0x98, 0xde, - 0xa1, 0x19, 0x9f, 0xf8, 0x13, 0x50, 0x69, 0x13, 0x74, 0x4c, 0x90, 0x1c, 0xf9, 0xef, 0xb3, 0x47, - 0xee, 0x11, 0xd4, 0x6a, 0x7a, 0xd6, 0x68, 0xe0, 0x3c, 0x1c, 0x14, 0xb0, 0x44, 0xd0, 0xb0, 0x80, - 0x55, 0xd1, 0x09, 0x41, 0xb6, 0xaf, 0xb7, 0x09, 0x6a, 0x21, 0xd9, 0xc2, 0x1a, 0x58, 0x99, 0xba, - 0xd4, 0xb8, 0x83, 0x77, 0x25, 0x20, 0x0a, 0x18, 0x2e, 0xd0, 0xe9, 0x79, 0x2c, 0xed, 0xae, 0x7a, - 0x1b, 0xdc, 0x42, 0x26, 0x4c, 0x59, 0xc8, 0x42, 0x66, 0x21, 0xfb, 0x35, 0x76, 0x81, 0x86, 0x32, - 0x7c, 0xc6, 0xed, 0xd3, 0x3c, 0xd8, 0x2f, 0xa0, 0xd6, 0x3c, 0xc2, 0x67, 0x83, 0x02, 0x72, 0x7d, - 0x58, 0xc0, 0x9a, 0x9c, 0x4a, 0x86, 0xcf, 0x6c, 0x9f, 0x8b, 0x0c, 0x8a, 0x18, 0xc4, 0x9c, 0x5b, - 0x14, 0xd0, 0xff, 0x12, 0x8a, 0xee, 0x40, 0x91, 0x80, 0x22, 0x09, 0x51, 0x06, 0x69, 0x13, 0xe8, - 0x50, 0x42, 0xf4, 0x0e, 0x44, 0x05,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 0xe3, 0x47, - 0xeb, 0x25, 0x5e, 0x26, 0xde, 0xd1, 0x75, 0xdf, 0x54, 0x6f, 0xfa, 0xa6, 0xfa, 0xb9, 0x6f, 0xaa, - 0xaf, 0x6f, 0x4d, 0xe5, 0xe6, 0xd6, 0x54, 0x3e, 0xde, 0x9a, 0xca, 0xb3, 0x7f, 0x22, 0x92, 0x9f, - 0xbc, 0x68, 0x3b, 0x21, 0xed, 0xba, 0x7c, 0x97, 0xff, 0x8e, 0x71, 0x7e, 0x4e, 0xd3, 0x53, 0x19, - 0x05, 0x09, 0x71, 0x23, 0xea, 0xc6, 0x14, 0xe1, 0x6f, 0x3e, 0x46, 0xed, 0x0a, 0xff, 0x0e, 0xed, - 0x7e, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x74, 0xc0, 0xb6, 0x17, 0x07, 0x00, 0x00, + // 884 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0xbf, 0x6f, 0xe4, 0x44, + 0x14, 0x5e, 0xef, 0xda, 0xc9, 0xed, 0xec, 0x25, 0x59, 0xf9, 0x72, 0xa7, 0xcd, 0x42, 0x3c, 0x66, + 0x10, 0x28, 0x0d, 0xb6, 0x92, 0x54, 0x84, 0xea, 0x7c, 0x11, 0x28, 0x12, 0x28, 0xe0, 0x00, 0x05, + 0x14, 0x91, 0xd7, 0x33, 0xe7, 0x1b, 0x65, 0xe3, 0xd9, 0x78, 0x9c, 0x9c, 0xf8, 0x0f, 0x50, 0x2a, + 0x24, 0x1a, 0x9a, 0xa0, 0x93, 0xae, 0xbb, 0x7f, 0x82, 0xf6, 0xca, 0x94, 0x54, 0x03, 0xda, 0x34, + 0x68, 0xcb, 0xfd, 0x07, 0x40, 0xf3, 0x63, 0xbd, 0x3f, 0xb4, 0x20, 0x51, 0x5c, 0x77, 0x95, 0xf3, + 0xbe, 0xf7, 0xbe, 0x6f, 0x9e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0x4a, 0x12, 0x51, 0xec, + 0x7e, 0x0f, 0x1c, 0xf5, 0xc2, 0x0b, 0x7d, 0xce, 0xcf, 0x37, 0x38, 0x96, 0x25, 0x47, 0x87, 0xd1, + 0x87, 0xb2, 0xcf, 0xa1, 0x80, 0x8e, 0x02, 0xe4, 0x99, 0x8a, 0x3c, 0x3d, 0x53, 0x85, 0x28, 0xd6, + 0xb0, 0xfb, 0x09, 0xb8, 0x37, 0x28, 0xd8, 0x15, 0x95, 0xfa, 0xb2, 0xcf, 0x66, 0x04, 0x47, 0x02, + 0x56, 0xd8, 0x58, 0xc0, 0x0d, 0x4d, 0x9b, 0x20, 0x28, 0xae, 0x92, 0xee, 0x57, 0xc0, 0x19, 0x14, + 0x34, 0x25, 0x9d, 0x86, 0xea, 0xec, 0xdd, 0x40, 0x6f, 0x73, 0x76, 0x84, 0xbb, 0xc1, 0x21, 0x49, + 0x9f, 0x30, 0x9a, 0x47, 0xdb, 0x66, 0x80, 0x9a, 0x32, 0xed, 0x47, 0x85, 0x28, 0xd6, 0xb0, 0xfb, + 0x2d, 0x58, 0xc5, 0x64, 0xc0, 0x38, 0x2d, 0x3b, 0xb6, 0x12, 0xdd, 0x5a, 0x2a, 0xaa, 0x14, 0xdf, + 0x33, 0x8a, 0x13, 0xc6, 0x58, 0xc0, 0x75, 0xad, 0x69, 0x00, 0x14, 0x4f, 0x52, 0xee, 0x4b, 0x0b, + 0x6c, 0x54, 0xab, 0x39, 0x65, 0xd2, 0x04, 0x1d, 0xc7, 0x6f, 0xec, 0xb4, 0xf6, 0xde, 0x5f, 0x3e, + 0xcf, 0x39, 0xbf, 0x44, 0xdf, 0x98, 0xa9, 0xae, 0x57, 0x86, 0x50, 0xf8, 0x48, 0xc0, 0x45, 0xd5, + 0xb1, 0x80, 0x8f, 0x16, 0x5c, 0xa1, 0x13, 0xe8, 0xd5, 0x1f, 0x8b, 0xf4, 0x78, 0xbd, 0x98, 0x8b, + 0x95, 0x03, 0x6a, 0xe8, 0x11, 0xd8, 0x9c, 0x35, 0x40, 0x4c, 0xf8, 0x80, 0xe5, 0x9c, 0x20, 0x0a, + 0x5a, 0x12, 0xef, 0x33, 0xae, 0x7c, 0xf1, 0x35, 0x58, 0xe9, 0x51, 0x7c, 0x4a, 0xb1, 0x31, 0xc6, + 0x3b, 0xcb, 0x5f, 0x24, 0xa2, 0xf8, 0xe8, 0x30, 0xf2, 0x27, 0xb6, 0x50, 0xe1, 0x48, 0xc0, 0x3a, + 0xc5, 0x63, 0x01, 0x9b, 0xba, 0x55, 0x8a, 0x51, 0xec, 0xf4, 0x28, 0x3e, 0xc2, 0xa6, 0x85, 0x87, + 0xe0, 0xc1, 0xcc, 0x51, 0x55, 0x07, 0xbf, 0xd6, 0x81, 0x16, 0x90, 0xe6, 0x66, 0xcf, 0x73, 0x63, + 0xca, 0xa6, 0x36, 0xb7, 0x02, 0x66, 0x8c, 0x26, 0x43, 0x69, 0x34, 0xf9, 0x74, 0xf7, 0x81, 0x8d, + 0x39, 0xb9, 0x50, 0x26, 0xb3, 0x23, 0x38, 0x14, 0xd0, 0x3e, 0x3c, 0x21, 0x17, 0x23, 0x01, 0x15, + 0x3e, 0x16, 0xb0, 0x65, 0x76, 0xc7, 0xc9, 0x05, 0x8a, 0x15, 0x28, 0x49, 0x99, 0x24, 0x35, 0xd4, + 0x0d, 0x52, 0xa4, 0xcf, 0x0c, 0x29, 0x9b, 0x23, 0x65, 0x9a, 0x94, 0x19, 0x12, 0x93, 0x24, 0x7b, + 0x4a, 0x3a, 0x36, 0x24, 0x36, 0x47, 0x62, 0x9a, 0x24, 0x1f, 0x73, 0xf7, 0xc0, 0xf9, 0x9f, 0xf7, + 0xe0, 0xe0, 0xde, 0x2f, 0x2f, 0x60, 0x4d, 0xcd, 0xed, 0xb7, 0x06, 0x68, 0xbc, 0xb1, 0xdd, 0xb8, + 0x5f, 0x02, 0x87, 0x97, 0x49, 0x49, 0xd4, 0x10, 0xd7, 0xf7, 0xe0, 0xbf, 0x8a,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3e, 0xce, 0x68, 0xf9, 0xec, 0xb2, 0x17, 0xa4, 0xec, 0x3c, 0x54, 0x5e, 0xfe, 0x28, 0x27, + 0xe5, 0x73, 0x56, 0x9c, 0x99, 0x28, 0x19, 0xd0, 0x30, 0x63, 0x61, 0xce, 0x30, 0x59, 0xf8, 0x0d, + 0xd0, 0x5b, 0x51, 0xff, 0xda, 0xf7, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xba, 0x3e, 0x34, 0x30, + 0x8e, 0x08, 0x00, 0x00, +} + +func (this *ResourceOffer) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ResourceOffer) + if !ok { + that2, ok := that.(ResourceOffer) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Resources.Equal(&that1.Resources) { + return false + } + if this.Count != that1.Count { + return false + } + return true +} +func (m *ResourceOffer) 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 *ResourceOffer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceOffer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Count != 0 { + i = encodeVarintBid(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x10 + } + { + size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *MsgCreateBid) Marshal() (dAtA []byte, err error) { @@ -566,6 +702,20 @@ func (m *MsgCreateBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ResourcesOffer) > 0 { + for iNdEx := len(m.ResourcesOffer) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourcesOffer[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBid(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } { size, err := m.Deposit.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -860,6 +1010,20 @@ func encodeVarintBid(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *ResourceOffer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Resources.Size() + n += 1 + l + sovBid(uint64(l)) + if m.Count != 0 { + n += 1 + sovBid(uint64(m.Count)) + } + return n +} + func (m *MsgCreateBid) Size() (n int) { if m == nil { return 0 @@ -876,6 +1040,12 @@ func (m *MsgCreateBid) Size() (n int) { n += 1 + l + sovBid(uint64(l)) l = m.Deposit.Size() n += 1 + l + sovBid(uint64(l)) + if len(m.ResourcesOffer) > 0 { + for _, e := range m.ResourcesOffer { + l = e.Size() + n += 1 + l + sovBid(uint64(l)) + } + } return n } @@ -989,6 +1159,108 @@ func sovBid(x uint64) (n int) { func sozBid(x uint64) (n int) { return sovBid(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *ResourceOffer) 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 ErrIntOverflowBid + } + 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: ResourceOffer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourceOffer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBid + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipBid(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBid + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgCreateBid) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1149,6 +1421,40 @@ func (m *MsgCreateBid) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourcesOffer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBid + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBid + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBid + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourcesOffer = append(m.ResourcesOffer, ResourceOffer{}) + if err := m.ResourcesOffer[len(m.ResourcesOffer)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipBid(dAtA[iNdEx:]) 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/proto/node/akash/base/v1beta3/resources.proto b/proto/node/akash/base/v1beta3/resources.proto index a4e64982..050ed269 100644 --- a/proto/node/akash/base/v1beta3/resources.proto +++ b/proto/node/akash/base/v1beta3/resources.proto @@ -43,9 +43,9 @@ message Resources { (gogoproto.moretags) = "yaml:\"gpu,omitempty\"" ]; repeated Endpoint endpoints = 6 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "Endpoints", - (gogoproto.jsontag) = "endpoints", - (gogoproto.moretags) = "yaml:\"endpoints\"" + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "Endpoints", + (gogoproto.jsontag) = "endpoints", + (gogoproto.moretags) = "yaml:\"endpoints\"" ]; } diff --git a/proto/node/akash/deployment/v1beta3/resourceunit.proto b/proto/node/akash/deployment/v1beta3/resourceunit.proto index d96d6bb9..29c2a7f9 100644 --- a/proto/node/akash/deployment/v1beta3/resourceunit.proto +++ b/proto/node/akash/deployment/v1beta3/resourceunit.proto @@ -9,7 +9,7 @@ option go_package = "github.com/akash-network/akash-api/go/node/deployment/v1bet // ResourceUnit extends Resources and adds Count along with the Price message ResourceUnit { - option (gogoproto.equal) = false; + option (gogoproto.equal) = true; akash.base.v1beta3.Resources resource = 1 [ (gogoproto.nullable) = false, diff --git a/proto/node/akash/market/v1beta3/bid.proto b/proto/node/akash/market/v1beta3/bid.proto index 9026c985..3191ea9b 100644 --- a/proto/node/akash/market/v1beta3/bid.proto +++ b/proto/node/akash/market/v1beta3/bid.proto @@ -4,9 +4,23 @@ package akash.market.v1beta3; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "akash/market/v1beta3/order.proto"; +import "akash/base/v1beta3/resources.proto"; option go_package = "github.com/akash-network/akash-api/go/node/market/v1beta3"; +message ResourceOffer { + option (gogoproto.equal) = true; + akash.base.v1beta3.Resources resources = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "resources", + (gogoproto.moretags) = "yaml:\"resources\"" + ]; + uint32 count = 2 [ + (gogoproto.jsontag) = "count", + (gogoproto.moretags) = "yaml:\"count\"" + ]; +} + // MsgCreateBid defines an SDK message for creating Bid message MsgCreateBid { option (gogoproto.equal) = false; @@ -18,19 +32,26 @@ message MsgCreateBid { (gogoproto.moretags) = "yaml:\"order\"" ]; string provider = 2 [ - (gogoproto.jsontag) = "provider", + (gogoproto.jsontag) = "provider", (gogoproto.moretags) = "yaml:\"provider\"" ]; cosmos.base.v1beta1.DecCoin price = 3 [ (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price", + (gogoproto.jsontag) = "price", (gogoproto.moretags) = "yaml:\"price\"" ]; cosmos.base.v1beta1.Coin deposit = 4 [ (gogoproto.nullable) = false, - (gogoproto.jsontag) = "deposit", + (gogoproto.jsontag) = "deposit", (gogoproto.moretags) = "yaml:\"deposit\"" ]; + repeated ResourceOffer resources_offer = 5 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "ResourcesOffer", + (gogoproto.customname) = "ResourcesOffer", + (gogoproto.jsontag) = "resources_offer", + (gogoproto.moretags) = "yaml:\"resources_offer\"" + ]; } // MsgCreateBidResponse defines the Msg/CreateBid response type. @@ -63,19 +84,19 @@ message BidID { ]; uint64 dseq = 2 [ (gogoproto.customname) = "DSeq", - (gogoproto.jsontag) = "dseq", - (gogoproto.moretags) = "yaml:\"dseq\"" + (gogoproto.jsontag) = "dseq", + (gogoproto.moretags) = "yaml:\"dseq\"" ]; uint32 gseq = 3 [ (gogoproto.customname) = "GSeq", - (gogoproto.jsontag) = "gseq", - (gogoproto.moretags) = "yaml:\"gseq\""]; + (gogoproto.jsontag) = "gseq", + (gogoproto.moretags) = "yaml:\"gseq\""]; uint32 oseq = 4 [ (gogoproto.customname) = "OSeq", - (gogoproto.jsontag) = "oseq", - (gogoproto.moretags) = "yaml:\"oseq\""]; + (gogoproto.jsontag) = "oseq", + (gogoproto.moretags) = "yaml:\"oseq\""]; string provider = 5 [ - (gogoproto.jsontag) = "provider", + (gogoproto.jsontag) = "provider", (gogoproto.moretags) = "yaml:\"provider\"" ]; } @@ -119,12 +140,12 @@ message Bid { } State state = 2 [ - (gogoproto.jsontag) = "state", + (gogoproto.jsontag) = "state", (gogoproto.moretags) = "yaml:\"state\"" ]; cosmos.base.v1beta1.DecCoin price = 3 [ (gogoproto.nullable) = false, - (gogoproto.jsontag) = "price", + (gogoproto.jsontag) = "price", (gogoproto.moretags) = "yaml:\"price\"" ]; int64 created_at = 4; @@ -135,18 +156,18 @@ message BidFilters { option (gogoproto.equal) = false; string owner = 1 [ - (gogoproto.jsontag) = "owner", + (gogoproto.jsontag) = "owner", (gogoproto.moretags) = "yaml:\"owner\"" ]; uint64 dseq = 2 [ (gogoproto.customname) = "DSeq", - (gogoproto.jsontag) = "dseq", - (gogoproto.moretags) = "yaml:\"dseq\"" + (gogoproto.jsontag) = "dseq", + (gogoproto.moretags) = "yaml:\"dseq\"" ]; uint32 gseq = 3 [ (gogoproto.customname) = "GSeq", - (gogoproto.jsontag) = "gseq", - (gogoproto.moretags) = "yaml:\"gseq\"" + (gogoproto.jsontag) = "gseq", + (gogoproto.moretags) = "yaml:\"gseq\"" ]; uint32 oseq = 4 [ (gogoproto.customname) = "OSeq", @@ -154,11 +175,11 @@ message BidFilters { (gogoproto.moretags) = "yaml:\"oseq\"" ]; string provider = 5 [ - (gogoproto.jsontag) = "provider", + (gogoproto.jsontag) = "provider", (gogoproto.moretags) = "yaml:\"provider\"" ]; string state = 6 [ - (gogoproto.jsontag) = "state", + (gogoproto.jsontag) = "state", (gogoproto.moretags) = "yaml:\"state\"" ]; } diff --git a/proto/provider/akash/inventory/v1/cluster.proto b/proto/provider/akash/inventory/v1/cluster.proto new file mode 100644 index 00000000..7a0ee82d --- /dev/null +++ b/proto/provider/akash/inventory/v1/cluster.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; + +package akash.inventory.v1; + +import "gogoproto/gogo.proto"; +import "akash/inventory/v1/node.proto"; +import "akash/inventory/v1/resourcepair.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\"" + ]; + + map 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..ae29e0ab --- /dev/null +++ b/proto/provider/akash/inventory/v1/cpu.proto @@ -0,0 +1,32 @@ +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 CPU { + ResourcePair quantity = 1 [ + (gogoproto.customname) = "Quantity", + (gogoproto.jsontag) = "quantity", + (gogoproto.moretags) = "yaml:\"quantity\"" + ]; + + string id = 2 [ + (gogoproto.customname) = "ID", + (gogoproto.jsontag) = "id", + (gogoproto.moretags) = "yaml:\"id\"" + ]; + string vendor = 3 [ + (gogoproto.customname) = "Vendor", + (gogoproto.jsontag) = "vendor", + (gogoproto.moretags) = "yaml:\"vendor\"" + ]; + string model = 4 [ + (gogoproto.customname) = "Model", + (gogoproto.jsontag) = "model", + (gogoproto.moretags) = "yaml:\"model\"" + ]; +} diff --git a/proto/provider/akash/inventory/v1/gpu.proto b/proto/provider/akash/inventory/v1/gpu.proto new file mode 100644 index 00000000..86c25636 --- /dev/null +++ b/proto/provider/akash/inventory/v1/gpu.proto @@ -0,0 +1,32 @@ +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 GPU { + ResourcePair quantity = 1 [ + (gogoproto.customname) = "Quantity", + (gogoproto.jsontag) = "quantity", + (gogoproto.moretags) = "yaml:\"quantity\"" + ]; + string id = 2 [ + (gogoproto.customname) = "ID", + (gogoproto.jsontag) = "id", + (gogoproto.moretags) = "yaml:\"id\"" + ]; + string vendor = 3 [ + (gogoproto.customname) = "Vendor", + (gogoproto.jsontag) = "vendor", + (gogoproto.moretags) = "yaml:\"vendor\"" + ]; + string model = 4 [ + (gogoproto.customname) = "Model", + (gogoproto.jsontag) = "model", + (gogoproto.moretags) = "yaml:\"model\"" + ]; +} diff --git a/proto/provider/akash/inventory/v1/node.proto b/proto/provider/akash/inventory/v1/node.proto new file mode 100644 index 00000000..125af5d7 --- /dev/null +++ b/proto/provider/akash/inventory/v1/node.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package akash.inventory.v1; + +import "gogoproto/gogo.proto"; +import "akash/inventory/v1/cpu.proto"; +import "akash/inventory/v1/gpu.proto"; + +option go_package = "github.com/akash-network/akash-api/go/inventory/v1"; + +message Node { + repeated CPU cpu = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "CPUs", + (gogoproto.customname) = "CPU", + (gogoproto.jsontag) = "cpu", + (gogoproto.moretags) = "yaml:\"cpu\"" + ]; + repeated GPU gpu = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "GPUs", + (gogoproto.customname) = "GPU", + (gogoproto.jsontag) = "gpu", + (gogoproto.moretags) = "yaml:\"gpu\"" + ]; +} 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/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