From 0b040b433442ab7175f407d80b05be884d872926 Mon Sep 17 00:00:00 2001 From: turtlebasket Date: Thu, 22 Sep 2022 22:40:51 +0000 Subject: [PATCH] cpu cores field --- docs/static/openapi.yml | 15 +++++ go.mod | 1 + go.sum | 2 + proto/colinearcore/auction.proto | 7 +- x/colinearcore/types/auction.pb.go | 104 ++++++++++++++++++++--------- 5 files changed, 93 insertions(+), 36 deletions(-) diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index e0dc2e9..ea5f801 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -176,6 +176,9 @@ paths: items: type: string title: hardware specs + cpuCores: + type: string + format: uint64 cpuArch: type: string enum: @@ -341,6 +344,9 @@ paths: items: type: string title: hardware specs + cpuCores: + type: string + format: uint64 cpuArch: type: string enum: @@ -30960,6 +30966,9 @@ definitions: items: type: string title: hardware specs + cpuCores: + type: string + format: uint64 cpuArch: type: string enum: @@ -31119,6 +31128,9 @@ definitions: items: type: string title: hardware specs + cpuCores: + type: string + format: uint64 cpuArch: type: string enum: @@ -31226,6 +31238,9 @@ definitions: items: type: string title: hardware specs + cpuCores: + type: string + format: uint64 cpuArch: type: string enum: diff --git a/go.mod b/go.mod index 4774928..30cc3b9 100644 --- a/go.mod +++ b/go.mod @@ -88,6 +88,7 @@ require ( github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect diff --git a/go.sum b/go.sum index 07b1083..ad897ba 100644 --- a/go.sum +++ b/go.sum @@ -734,6 +734,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= diff --git a/proto/colinearcore/auction.proto b/proto/colinearcore/auction.proto index aeefa42..5b7232d 100644 --- a/proto/colinearcore/auction.proto +++ b/proto/colinearcore/auction.proto @@ -20,7 +20,8 @@ message Auction { string remaining = 11; // hardware specs repeated string gpus = 12; - CpuArchitecture cpuArch = 13; - uint64 memMb = 14; - uint64 storageGb = 15; + uint64 cpuCores = 13; + CpuArchitecture cpuArch = 14; + uint64 memMb = 15; + uint64 storageGb = 16; } diff --git a/x/colinearcore/types/auction.pb.go b/x/colinearcore/types/auction.pb.go index 790f512..00ed837 100644 --- a/x/colinearcore/types/auction.pb.go +++ b/x/colinearcore/types/auction.pb.go @@ -36,9 +36,10 @@ type Auction struct { Remaining string `protobuf:"bytes,11,opt,name=remaining,proto3" json:"remaining,omitempty"` // hardware specs Gpus []string `protobuf:"bytes,12,rep,name=gpus,proto3" json:"gpus,omitempty"` - CpuArch CpuArchitecture `protobuf:"varint,13,opt,name=cpuArch,proto3,enum=colinear.colinearcore.CpuArchitecture" json:"cpuArch,omitempty"` - MemMb uint64 `protobuf:"varint,14,opt,name=memMb,proto3" json:"memMb,omitempty"` - StorageGb uint64 `protobuf:"varint,15,opt,name=storageGb,proto3" json:"storageGb,omitempty"` + CpuCores uint64 `protobuf:"varint,13,opt,name=cpuCores,proto3" json:"cpuCores,omitempty"` + CpuArch CpuArchitecture `protobuf:"varint,14,opt,name=cpuArch,proto3,enum=colinear.colinearcore.CpuArchitecture" json:"cpuArch,omitempty"` + MemMb uint64 `protobuf:"varint,15,opt,name=memMb,proto3" json:"memMb,omitempty"` + StorageGb uint64 `protobuf:"varint,16,opt,name=storageGb,proto3" json:"storageGb,omitempty"` } func (m *Auction) Reset() { *m = Auction{} } @@ -158,6 +159,13 @@ func (m *Auction) GetGpus() []string { return nil } +func (m *Auction) GetCpuCores() uint64 { + if m != nil { + return m.CpuCores + } + return 0 +} + func (m *Auction) GetCpuArch() CpuArchitecture { if m != nil { return m.CpuArch @@ -186,31 +194,32 @@ func init() { func init() { proto.RegisterFile("colinearcore/auction.proto", fileDescriptor_c2581508d43e9c55) } var fileDescriptor_c2581508d43e9c55 = []byte{ - // 380 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xb1, 0xae, 0xd3, 0x30, - 0x14, 0x86, 0x6b, 0x9a, 0x36, 0xad, 0x0b, 0x45, 0xb2, 0x00, 0x59, 0x01, 0xa2, 0x88, 0x01, 0x65, - 0x4a, 0xa5, 0x32, 0xb0, 0xd2, 0x22, 0xc4, 0xc4, 0x12, 0x36, 0x36, 0xc7, 0x3e, 0x6a, 0x2d, 0x35, - 0x76, 0xe4, 0x38, 0x6a, 0x79, 0x0b, 0x1e, 0x0b, 0x89, 0xa5, 0x23, 0xe3, 0x55, 0xfb, 0x22, 0x57, - 0xb6, 0x95, 0xdb, 0x56, 0xba, 0x77, 0xf3, 0xff, 0xff, 0xe7, 0xf8, 0x7c, 0x3e, 0x32, 0x4e, 0xb8, - 0xde, 0x49, 0x05, 0xcc, 0x70, 0x6d, 0x60, 0xc1, 0x3a, 0x6e, 0xa5, 0x56, 0x45, 0x63, 0xb4, 0xd5, - 0xe4, 0x75, 0x9f, 0x15, 0xd7, 0x45, 0xc9, 0x9b, 0x9b, 0x96, 0x4a, 0x8a, 0x50, 0x9e, 0xbc, 0xbd, - 0xf1, 0xb7, 0xcc, 0x88, 0x3d, 0x33, 0x10, 0xc2, 0x0f, 0xff, 0x86, 0x38, 0x5e, 0x85, 0xdb, 0xc9, - 0x2b, 0x3c, 0x92, 0x4a, 0xc0, 0x81, 0xa2, 0x0c, 0xe5, 0xd3, 0x32, 0x08, 0x42, 0x70, 0xa4, 0x58, - 0x0d, 0xf4, 0x99, 0x37, 0xfd, 0x99, 0x64, 0x78, 0x26, 0xa0, 0xe5, 0x46, 0x36, 0xae, 0x91, 0x0e, - 0x7d, 0x74, 0x6d, 0x91, 0x02, 0x47, 0x15, 0xb4, 0x96, 0x46, 0x19, 0xca, 0x67, 0xcb, 0xa4, 0x78, - 0x14, 0xb9, 0x58, 0x4b, 0x51, 0xfa, 0x3a, 0x92, 0xe0, 0x89, 0x00, 0x26, 0x5c, 0x46, 0x47, 0x19, - 0xca, 0xa3, 0xf2, 0x41, 0x13, 0x8a, 0x63, 0x0e, 0x72, 0x27, 0xd5, 0x86, 0x8e, 0xfd, 0xa4, 0x5e, - 0x3a, 0x62, 0x01, 0x4a, 0xd7, 0x34, 0x0e, 0xc4, 0x5e, 0x38, 0x57, 0xef, 0x15, 0x18, 0x3a, 0x09, - 0xae, 0x17, 0x24, 0xc5, 0x78, 0x07, 0xac, 0x85, 0x9f, 0x96, 0x19, 0x4b, 0xa7, 0x7e, 0xc6, 0x95, - 0xe3, 0x08, 0xbc, 0xfa, 0xa6, 0x04, 0xc5, 0x81, 0xa0, 0xd7, 0xe4, 0x1d, 0x9e, 0x1a, 0xa8, 0x99, - 0x54, 0x8e, 0x61, 0xe6, 0x6f, 0xbd, 0x18, 0x6e, 0x43, 0x9b, 0xa6, 0x6b, 0xe9, 0xf3, 0x6c, 0xe8, - 0x36, 0xe4, 0xce, 0xe4, 0x0b, 0x8e, 0x79, 0xd3, 0xad, 0x0c, 0xdf, 0xd2, 0x17, 0x19, 0xca, 0xe7, - 0xcb, 0x8f, 0x4f, 0xac, 0xe0, 0x6b, 0xa8, 0x92, 0x16, 0xb8, 0xed, 0x0c, 0x94, 0x7d, 0x9b, 0x7b, - 0x45, 0x0d, 0xf5, 0x8f, 0x8a, 0xce, 0x3d, 0x4c, 0x10, 0x8e, 0xa4, 0xb5, 0xda, 0xb0, 0x0d, 0x7c, - 0xaf, 0xe8, 0x4b, 0x9f, 0x5c, 0x8c, 0xf5, 0xe7, 0xbf, 0xa7, 0x14, 0x1d, 0x4f, 0x29, 0xba, 0x3b, - 0xa5, 0xe8, 0xcf, 0x39, 0x1d, 0x1c, 0xcf, 0xe9, 0xe0, 0xff, 0x39, 0x1d, 0xfc, 0x7a, 0xdf, 0x0f, - 0x5d, 0x1c, 0x16, 0x37, 0xff, 0xc1, 0xfe, 0x6e, 0xa0, 0xad, 0xc6, 0xfe, 0x37, 0x7c, 0xba, 0x0f, - 0x00, 0x00, 0xff, 0xff, 0x29, 0x90, 0xf6, 0xec, 0x77, 0x02, 0x00, 0x00, + // 392 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xc1, 0x8e, 0xd3, 0x30, + 0x10, 0xad, 0x69, 0x76, 0xb3, 0x75, 0x61, 0x41, 0x16, 0xa0, 0x51, 0x80, 0x28, 0xe2, 0x80, 0x72, + 0x4a, 0xa5, 0xe5, 0xc0, 0x95, 0xdd, 0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a, 0x2d, 0x5c, 0x45, + 0x36, 0x00, 0x96, 0x53, 0xba, 0x46, 0xde, 0xe3, 0x57, 0xc7, 0xad, 0x83, 0x59, 0x98, 0x71, 0xc2, + 0xf8, 0x04, 0x01, 0x7d, 0xd2, 0x12, 0x68, 0x4c, 0x30, 0x62, 0xf6, 0x9a, 0xce, 0x2c, 0xb6, 0x5c, + 0x69, 0x9f, 0x61, 0x1e, 0x5c, 0x8f, 0x84, 0xdf, 0xd0, 0xb2, 0x1b, 0x7a, 0x78, 0x5c, 0x4c, 0xfd, + 0x86, 0xfc, 0xdb, 0xbb, 0x89, 0x6e, 0xb8, 0x37, 0x16, 0x7b, 0x78, 0x12, 0xdd, 0x46, 0xcc, 0x3e, + 0xd2, 0x54, 0x74, 0xc3, 0xad, 0x15, 0x2b, 0xb8, 0x2e, 0x48, 0x79, 0x7d, 0xf3, 0xee, 0x81, 0xf5, + 0xdc, 0xc7, 0x2a, 0xe5, 0x50, 0xb8, 0xc1, 0x62, 0x3d, 0xb6, 0xf9, 0x1f, 0xb6, 0xd8, 0x7e, 0x69, + 0xe0, 0x69, 0xb0, 0x8e, 0xc0, 0xa7, 0xec, 0x9d, 0xb1, 0x7c, 0x89, 0x9f, 0x1b, 0x78, 0x16, 0x94, + 0x23, 0x71, 0xf7, 0xe1, 0xe7, 0x3e, 0x27, 0xbb, 0x7d, 0x4e, 0x7e, 0xef, 0x73, 0xf2, 0xe3, 0x90, + 0x4f, 0x76, 0x87, 0x7c, 0xf2, 0xeb, 0x90, 0x4f, 0xbe, 0xbd, 0x19, 0x87, 0x2e, 0xb6, 0x8b, 0xb3, + 0x5b, 0x71, 0xdf, 0x3b, 0xec, 0x9b, 0xcb, 0x70, 0x29, 0xef, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, + 0x68, 0xb2, 0x60, 0x4d, 0x93, 0x02, 0x00, 0x00, } func (m *Auction) Marshal() (dAtA []byte, err error) { @@ -236,16 +245,23 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.StorageGb != 0 { i = encodeVarintAuction(dAtA, i, uint64(m.StorageGb)) i-- - dAtA[i] = 0x78 + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 } if m.MemMb != 0 { i = encodeVarintAuction(dAtA, i, uint64(m.MemMb)) i-- - dAtA[i] = 0x70 + dAtA[i] = 0x78 } if m.CpuArch != 0 { i = encodeVarintAuction(dAtA, i, uint64(m.CpuArch)) i-- + dAtA[i] = 0x70 + } + if m.CpuCores != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.CpuCores)) + i-- dAtA[i] = 0x68 } if len(m.Gpus) > 0 { @@ -400,6 +416,9 @@ func (m *Auction) Size() (n int) { n += 1 + l + sovAuction(uint64(l)) } } + if m.CpuCores != 0 { + n += 1 + sovAuction(uint64(m.CpuCores)) + } if m.CpuArch != 0 { n += 1 + sovAuction(uint64(m.CpuArch)) } @@ -407,7 +426,7 @@ func (m *Auction) Size() (n int) { n += 1 + sovAuction(uint64(m.MemMb)) } if m.StorageGb != 0 { - n += 1 + sovAuction(uint64(m.StorageGb)) + n += 2 + sovAuction(uint64(m.StorageGb)) } return n } @@ -797,6 +816,25 @@ func (m *Auction) Unmarshal(dAtA []byte) error { m.Gpus = append(m.Gpus, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CpuCores", wireType) + } + m.CpuCores = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CpuCores |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CpuArch", wireType) } @@ -815,7 +853,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { break } } - case 14: + case 15: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MemMb", wireType) } @@ -834,7 +872,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { break } } - case 15: + case 16: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field StorageGb", wireType) }