Commit 324b120f authored by vicotor's avatar vicotor

update proto

parent 46ec7d60
......@@ -20,20 +20,200 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type NodeManagerInfo struct {
Publickey string `protobuf:"bytes,1,opt,name=publickey,proto3" json:"publickey,omitempty"`
Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *NodeManagerInfo) Reset() { *m = NodeManagerInfo{} }
func (m *NodeManagerInfo) String() string { return proto.CompactTextString(m) }
func (*NodeManagerInfo) ProtoMessage() {}
func (*NodeManagerInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_462e4441103de524, []int{0}
}
func (m *NodeManagerInfo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NodeManagerInfo.Unmarshal(m, b)
}
func (m *NodeManagerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NodeManagerInfo.Marshal(b, m, deterministic)
}
func (m *NodeManagerInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_NodeManagerInfo.Merge(m, src)
}
func (m *NodeManagerInfo) XXX_Size() int {
return xxx_messageInfo_NodeManagerInfo.Size(m)
}
func (m *NodeManagerInfo) XXX_DiscardUnknown() {
xxx_messageInfo_NodeManagerInfo.DiscardUnknown(m)
}
var xxx_messageInfo_NodeManagerInfo proto.InternalMessageInfo
func (m *NodeManagerInfo) GetPublickey() string {
if m != nil {
return m.Publickey
}
return ""
}
func (m *NodeManagerInfo) GetEndpoint() string {
if m != nil {
return m.Endpoint
}
return ""
}
type DeviceInfo struct {
DeviceType string `protobuf:"bytes,1,opt,name=device_type,json=deviceType,proto3" json:"device_type,omitempty"`
DeviceModel string `protobuf:"bytes,2,opt,name=device_model,json=deviceModel,proto3" json:"device_model,omitempty"`
DeviceParam string `protobuf:"bytes,3,opt,name=device_param,json=deviceParam,proto3" json:"device_param,omitempty"`
DevicePower uint64 `protobuf:"varint,4,opt,name=device_power,json=devicePower,proto3" json:"device_power,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DeviceInfo) Reset() { *m = DeviceInfo{} }
func (m *DeviceInfo) String() string { return proto.CompactTextString(m) }
func (*DeviceInfo) ProtoMessage() {}
func (*DeviceInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_462e4441103de524, []int{1}
}
func (m *DeviceInfo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeviceInfo.Unmarshal(m, b)
}
func (m *DeviceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DeviceInfo.Marshal(b, m, deterministic)
}
func (m *DeviceInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeviceInfo.Merge(m, src)
}
func (m *DeviceInfo) XXX_Size() int {
return xxx_messageInfo_DeviceInfo.Size(m)
}
func (m *DeviceInfo) XXX_DiscardUnknown() {
xxx_messageInfo_DeviceInfo.DiscardUnknown(m)
}
var xxx_messageInfo_DeviceInfo proto.InternalMessageInfo
func (m *DeviceInfo) GetDeviceType() string {
if m != nil {
return m.DeviceType
}
return ""
}
func (m *DeviceInfo) GetDeviceModel() string {
if m != nil {
return m.DeviceModel
}
return ""
}
func (m *DeviceInfo) GetDeviceParam() string {
if m != nil {
return m.DeviceParam
}
return ""
}
func (m *DeviceInfo) GetDevicePower() uint64 {
if m != nil {
return m.DevicePower
}
return 0
}
type WorkerContent struct {
WorkerPubkey string `protobuf:"bytes,1,opt,name=worker_pubkey,json=workerPubkey,proto3" json:"worker_pubkey,omitempty"`
Devices []*DeviceInfo `protobuf:"bytes,2,rep,name=devices,proto3" json:"devices,omitempty"`
DeviceProof []byte `protobuf:"bytes,3,opt,name=device_proof,json=deviceProof,proto3" json:"device_proof,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *WorkerContent) Reset() { *m = WorkerContent{} }
func (m *WorkerContent) String() string { return proto.CompactTextString(m) }
func (*WorkerContent) ProtoMessage() {}
func (*WorkerContent) Descriptor() ([]byte, []int) {
return fileDescriptor_462e4441103de524, []int{2}
}
func (m *WorkerContent) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_WorkerContent.Unmarshal(m, b)
}
func (m *WorkerContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_WorkerContent.Marshal(b, m, deterministic)
}
func (m *WorkerContent) XXX_Merge(src proto.Message) {
xxx_messageInfo_WorkerContent.Merge(m, src)
}
func (m *WorkerContent) XXX_Size() int {
return xxx_messageInfo_WorkerContent.Size(m)
}
func (m *WorkerContent) XXX_DiscardUnknown() {
xxx_messageInfo_WorkerContent.DiscardUnknown(m)
}
var xxx_messageInfo_WorkerContent proto.InternalMessageInfo
func (m *WorkerContent) GetWorkerPubkey() string {
if m != nil {
return m.WorkerPubkey
}
return ""
}
func (m *WorkerContent) GetDevices() []*DeviceInfo {
if m != nil {
return m.Devices
}
return nil
}
func (m *WorkerContent) GetDeviceProof() []byte {
if m != nil {
return m.DeviceProof
}
return nil
}
func init() {
proto.RegisterType((*NodeManagerInfo)(nil), "nodemanager.v1.NodeManagerInfo")
proto.RegisterType((*DeviceInfo)(nil), "nodemanager.v1.DeviceInfo")
proto.RegisterType((*WorkerContent)(nil), "nodemanager.v1.WorkerContent")
}
func init() { proto.RegisterFile("nodemanager/v1/resource.proto", fileDescriptor_462e4441103de524) }
var fileDescriptor_462e4441103de524 = []byte{
// 181 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcd, 0xcb, 0x4f, 0x49,
0xcd, 0x4d, 0xcc, 0x4b, 0x4c, 0x4f, 0x2d, 0xd2, 0x2f, 0x33, 0xd4, 0x2f, 0x4a, 0x2d, 0xce, 0x2f,
0x2d, 0x4a, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x43, 0x92, 0xd6, 0x2b, 0x33,
0x74, 0x3a, 0xcb, 0xc8, 0x25, 0x94, 0x9c, 0x9f, 0xab, 0x87, 0x26, 0xcc, 0x1b, 0x04, 0xd5, 0x16,
0x00, 0xd2, 0x15, 0xc0, 0x18, 0xe5, 0x9f, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f,
0xab, 0x9f, 0x9f, 0x52, 0x59, 0x5c, 0x9c, 0x5a, 0x5a, 0x0c, 0x67, 0xe8, 0x82, 0xcd, 0x4e, 0xce,
0xcf, 0xd1, 0x4f, 0x4f, 0xcd, 0xd3, 0x07, 0x73, 0xf4, 0xd3, 0xf3, 0xf5, 0x51, 0x5d, 0x62, 0x8d,
0xc4, 0x2d, 0x33, 0x5c, 0xc4, 0xc4, 0xec, 0x17, 0x11, 0xb1, 0x8a, 0x89, 0xcf, 0x0f, 0xc9, 0xe2,
0x30, 0xc3, 0x53, 0x28, 0x02, 0x31, 0x61, 0x86, 0x8f, 0x98, 0xa4, 0x50, 0x05, 0x62, 0xdc, 0x03,
0x9c, 0x7c, 0x53, 0x4b, 0x12, 0x53, 0x12, 0x4b, 0x12, 0x5f, 0x31, 0xf1, 0x23, 0x49, 0x5a, 0x59,
0x85, 0x19, 0x26, 0xb1, 0x81, 0x6d, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xa4, 0x5d, 0x07,
0x12, 0x07, 0x01, 0x00, 0x00,
// 383 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x91, 0xcd, 0x6a, 0xdb, 0x40,
0x14, 0x85, 0x91, 0x6c, 0xda, 0x7a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0x65,
0xda, 0xae, 0x2d, 0x05, 0x9a, 0x5c, 0x2b, 0xa4, 0x7f, 0x81, 0xec, 0x00, 0xec, 0x27, 0x52, 0x0e,
0x94, 0x6b, 0x9f, 0x49, 0xff, 0x24, 0xc0, 0x2e, 0x4e, 0xdd, 0xf3, 0x45, 0x7b, 0x25, 0xb4, 0x05,
0xd3, 0xbe, 0x93, 0xb7, 0x65, 0x4a, 0xa2, 0xab, 0xe3, 0xd6, 0xb4, 0xfb, 0x75, 0x64, 0x34, 0x9f,
0xcf, 0x38, 0xdf, 0x76, 0xf5, 0x62, 0x95, 0xf7, 0x61, 0x88, 0x7b, 0xb1, 0x72, 0xaf, 0xde, 0xa7,
0x40, 0xf3, 0x07, 0x85, 0x68, 0x1e, 0x46, 0xaf, 0xd2, 0xe6, 0xfd, 0x55, 0x55, 0x96, 0x5d, 0x74,
0x65, 0x2b, 0x97, 0xff, 0x82, 0x90, 0x5f, 0xa5, 0xae, 0xe1, 0x61, 0x64, 0xa2, 0x9f, 0x27, 0x09,
0xa4, 0x49, 0xfd, 0xf1, 0x45, 0x34, 0xea, 0xe1, 0xd1, 0x0c, 0x80, 0x9a, 0x42, 0x98, 0x01, 0x9a,
0xcd, 0xfe, 0x7f, 0x48, 0x32, 0xb3, 0x6e, 0xd5, 0xd6, 0x72, 0xb3, 0xb9, 0x53, 0x07, 0x4b, 0xe9,
0xe0, 0xb5, 0x75, 0xdf, 0x00, 0xdb, 0xb5, 0xf5, 0xa8, 0x8e, 0x9a, 0x60, 0xfb, 0xdb, 0x9e, 0x2f,
0x80, 0x3b, 0xbe, 0xc3, 0x9d, 0x27, 0x75, 0x28, 0x0d, 0x67, 0xb3, 0xb5, 0xe5, 0xbe, 0x11, 0xa7,
0x7f, 0x7b, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x9b, 0xeb, 0x03, 0x7d, 0x02, 0x00, 0x00,
}
......@@ -23,24 +23,25 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
func init() { proto.RegisterFile("nodemanager/v1/service.proto", fileDescriptor_085790cc5673c432) }
var fileDescriptor_085790cc5673c432 = []byte{
// 296 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xb1, 0x4a, 0xc4, 0x40,
0x10, 0x86, 0x2f, 0x11, 0x2c, 0xc2, 0x11, 0x61, 0xcb, 0xa0, 0x16, 0xa7, 0x82, 0x8d, 0x59, 0x57,
0xbb, 0xb3, 0x0b, 0x82, 0x55, 0x62, 0x38, 0x35, 0x1e, 0x7a, 0x20, 0x7b, 0xc9, 0xb0, 0x17, 0xce,
0x64, 0xe3, 0xce, 0x26, 0xe0, 0xeb, 0x58, 0xfa, 0x24, 0x22, 0x3e, 0x85, 0xa5, 0x4f, 0x21, 0x26,
0x41, 0x92, 0x14, 0xd7, 0xed, 0xcc, 0xf7, 0xcf, 0xfc, 0xfb, 0x8f, 0xb5, 0x9b, 0xcb, 0x04, 0x32,
0x9e, 0x73, 0x01, 0x8a, 0x56, 0x8c, 0x22, 0xa8, 0x2a, 0x8d, 0xc1, 0x2d, 0x94, 0xd4, 0x92, 0xd8,
0x1d, 0xea, 0x56, 0xcc, 0x39, 0x1a, 0xa8, 0x15, 0xbc, 0x94, 0x80, 0xfa, 0x49, 0x01, 0x16, 0x32,
0xc7, 0x76, 0xec, 0xec, 0xc3, 0xb0, 0x48, 0x20, 0x13, 0xf0, 0x1b, 0xe5, 0x4d, 0xb3, 0x93, 0xdc,
0x59, 0xf6, 0x0c, 0x44, 0x8a, 0x1a, 0xd4, 0xbd, 0x54, 0x6b, 0x50, 0x64, 0xcf, 0xed, 0x1b, 0xb8,
0x4d, 0xdf, 0x07, 0x44, 0x2e, 0xc0, 0xd9, 0x1f, 0xe2, 0x76, 0x61, 0xcb, 0x27, 0xa3, 0x63, 0xe3,
0xd4, 0x20, 0x8f, 0xd6, 0xf8, 0x32, 0xc5, 0x82, 0xeb, 0x78, 0x75, 0xcb, 0x71, 0x4d, 0x0e, 0x86,
0x53, 0x5d, 0x3a, 0x6b, 0x7e, 0xec, 0x1c, 0x6e, 0x16, 0x35, 0x71, 0x26, 0x23, 0xef, 0xcb, 0xb0,
0x48, 0x2c, 0xb3, 0x81, 0xda, 0x1b, 0xb7, 0x99, 0xc2, 0xbf, 0xbc, 0xa1, 0xf1, 0x70, 0x2d, 0x52,
0xbd, 0x2a, 0x97, 0x6e, 0x2c, 0x33, 0x2a, 0x93, 0x57, 0x44, 0x28, 0xf1, 0xff, 0x71, 0x52, 0x5f,
0x25, 0x96, 0xcf, 0x54, 0x40, 0x4e, 0xeb, 0x82, 0x0a, 0x49, 0xfb, 0xb7, 0xbc, 0xe8, 0x94, 0x15,
0x7b, 0x33, 0xb7, 0x82, 0xf9, 0xfc, 0xdd, 0xb4, 0x83, 0x8e, 0x6f, 0xc4, 0x3e, 0x7b, 0x8d, 0x45,
0xc4, 0xbe, 0x4d, 0xa7, 0xdf, 0x58, 0x5c, 0x85, 0x9e, 0x0f, 0x9a, 0x27, 0x5c, 0xf3, 0x1f, 0x73,
0xa7, 0x03, 0xa7, 0xd3, 0x88, 0x2d, 0xb7, 0x6b, 0xf7, 0xf3, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff,
0xb9, 0x2f, 0xc2, 0xe0, 0xf7, 0x01, 0x00, 0x00,
// 318 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xc1, 0x4a, 0xfb, 0x40,
0x10, 0xc6, 0x9b, 0xfc, 0xe1, 0x7f, 0x58, 0x4b, 0x85, 0x3d, 0x06, 0xf5, 0x50, 0x15, 0xbc, 0x98,
0x75, 0xf5, 0x56, 0x6f, 0x45, 0xf0, 0x62, 0x6b, 0xa9, 0x5a, 0x83, 0x16, 0x64, 0x9b, 0x0c, 0xdb,
0x50, 0x93, 0x8d, 0x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0x22, 0x42,
0x8a, 0x3f, 0x87, 0xe3, 0x7c, 0xdf, 0xbe, 0x7a, 0x66, 0x12, 0x62, 0x96, 0x17, 0x4c, 0x2a, 0x56,
0xff, 0xa5, 0xf3, 0x4a, 0x99, 0xf1, 0xa5, 0xfd, 0x6f, 0xe8, 0x79, 0x6f, 0x76, 0x67, 0x58, 0x99,
0x3b, 0xe1, 0xef, 0x35, 0x61, 0x3a, 0xe1, 0x9f, 0xb6, 0x53, 0x17, 0xa6, 0x97, 0xa3, 0xfe, 0x00,
0x8c, 0x08, 0x84, 0x11, 0x5f, 0xf6, 0x76, 0x05, 0xf6, 0x7a, 0x13, 0x3e, 0xfb, 0x9f, 0x4f, 0x3f,
0xfb, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xcb, 0xc9, 0xad, 0xb7, 0x51, 0x02, 0x00, 0x00,
}
......@@ -23,6 +23,7 @@ const _ = grpc.SupportPackageIsVersion7
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type NodeManagerServiceClient interface {
RegisterWorker(ctx context.Context, opts ...grpc.CallOption) (NodeManagerService_RegisterWorkerClient, error)
ManagerList(ctx context.Context, in *ManagerListRequest, opts ...grpc.CallOption) (*ManagerListResponse, error)
DispatchTask(ctx context.Context, in *DispatchTaskRequest, opts ...grpc.CallOption) (*DispatchTaskResponse, error)
}
......@@ -65,6 +66,15 @@ func (x *nodeManagerServiceRegisterWorkerClient) Recv() (*ManagerMessage, error)
return m, nil
}
func (c *nodeManagerServiceClient) ManagerList(ctx context.Context, in *ManagerListRequest, opts ...grpc.CallOption) (*ManagerListResponse, error) {
out := new(ManagerListResponse)
err := c.cc.Invoke(ctx, "/nodemanager.v1.NodeManagerService/ManagerList", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *nodeManagerServiceClient) DispatchTask(ctx context.Context, in *DispatchTaskRequest, opts ...grpc.CallOption) (*DispatchTaskResponse, error) {
out := new(DispatchTaskResponse)
err := c.cc.Invoke(ctx, "/nodemanager.v1.NodeManagerService/DispatchTask", in, out, opts...)
......@@ -79,6 +89,7 @@ func (c *nodeManagerServiceClient) DispatchTask(ctx context.Context, in *Dispatc
// for forward compatibility
type NodeManagerServiceServer interface {
RegisterWorker(NodeManagerService_RegisterWorkerServer) error
ManagerList(context.Context, *ManagerListRequest) (*ManagerListResponse, error)
DispatchTask(context.Context, *DispatchTaskRequest) (*DispatchTaskResponse, error)
mustEmbedUnimplementedNodeManagerServiceServer()
}
......@@ -90,6 +101,9 @@ type UnimplementedNodeManagerServiceServer struct {
func (UnimplementedNodeManagerServiceServer) RegisterWorker(NodeManagerService_RegisterWorkerServer) error {
return status.Errorf(codes.Unimplemented, "method RegisterWorker not implemented")
}
func (UnimplementedNodeManagerServiceServer) ManagerList(context.Context, *ManagerListRequest) (*ManagerListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ManagerList not implemented")
}
func (UnimplementedNodeManagerServiceServer) DispatchTask(context.Context, *DispatchTaskRequest) (*DispatchTaskResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DispatchTask not implemented")
}
......@@ -132,6 +146,24 @@ func (x *nodeManagerServiceRegisterWorkerServer) Recv() (*WorkerMessage, error)
return m, nil
}
func _NodeManagerService_ManagerList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ManagerListRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NodeManagerServiceServer).ManagerList(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/nodemanager.v1.NodeManagerService/ManagerList",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NodeManagerServiceServer).ManagerList(ctx, req.(*ManagerListRequest))
}
return interceptor(ctx, in, info, handler)
}
func _NodeManagerService_DispatchTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DispatchTaskRequest)
if err := dec(in); err != nil {
......@@ -157,6 +189,10 @@ var NodeManagerService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "nodemanager.v1.NodeManagerService",
HandlerType: (*NodeManagerServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ManagerList",
Handler: _NodeManagerService_ManagerList_Handler,
},
{
MethodName: "DispatchTask",
Handler: _NodeManagerService_DispatchTask_Handler,
......
......@@ -3,13 +3,16 @@ syntax = "proto3";
package nodemanager.v1;
import "base/v1/odysseus.proto";
import "nodemanager/v1/resource.proto";
message WorkerMessage {
oneof message {
HeartbeatResponse heartbeat_response = 1;
SubmitTaskResult submit_task_result = 2;
StatusResp status_resp = 3;
StatusResponse status = 3;
DeviceInfoResponse device_info = 4;
DeviceUsageResponse device_usage = 5;
GoodbyeMessage goodbye_message = 6;
}
}
......@@ -18,58 +21,99 @@ message ManagerMessage {
HeartbeatRequest heartbeat_request = 1;
PushTaskMessage push_task_message = 2;
ProofTaskResult proof_task_result = 3;
StatusRequest status_request = 4;
DeviceInfoRequest device_request = 5;
DeviceUsageRequest device_usage = 6;
GoodbyeMessage goodbye_message = 7;
}
}
enum TaskType {
SystemTask = 0;
UserTask = 1;
CustomTask = 2;
}
message GoodbyeMessage {
string reason = 1;
}
message HeartbeatRequest {
uint64 timestamp = 1;
}
message HeartbeatResponse {
uint64 timestamp = 1;
}
message StatusRequest {
}
message DeviceUsageRequest {
}
message DeviceUsageResponse {
repeated DeviceUsage usage = 1;
}
message DeviceInfoRequest {
message StatusResp {
uint64 remain_power = 1;
uint64 remain_device = 2; // 剩余
}
message DeviceInfoResponse {
repeated DeviceInfo devices = 1;
}
message DeviceUsage {
string device_type = 1; // cpu/gpu/mem with index, ex: cpu-0, ... cpu-5
uint64 device_usage = 2;
}
message StatusResponse {
bytes device_status = 1; // bitmap
}
message PushTaskMessage {
string task_id = 1;
base.v1.TaskContent task = 1;
TaskType task_type = 2;
uint64 work_load = 3;
string task_cmd = 4; //
bytes task_param = 5;
}
// 容器签名 (task_id+hash(task_param)+hash(task_result))
// 矿工签名 (task_id+hash(task_param)+hash(task_result))
// nodemanager签名 (task_id+hash(task_param)+hash(task_result)+docker_signature+miner_signature+workload)
message SubmitTaskResult {
string task_id = 1;
string task_proof = 2;
bytes worker_signature = 3;
bytes task_result = 4;
bytes task_proof = 2; // 容器签名
bytes worker_signature = 3; // worker 签名
bytes task_result = 4; // 任务结果
}
message ProofTaskResult {
string task_id = 1;
bytes manager_signature = 2;
string task_id = 1;
bytes manager_signature = 2; // nodemanager 签名
}
message DispatchTaskRequest {
string task_type = 1;
base.v1.TaskContent task_data = 2;
string worker = 3;
string task_id = 1;
TaskType task_type = 2;
base.v1.TaskContent task_data = 3;
string worker = 4;
}
message DispatchTaskResponse {
string task_id = 1;
string worker = 2;
string worker_id = 2;
}
message DeviceInfo {
// device info for gpu
string device_name = 1;
string device_type = 2;
uint64 device_power = 3;
message ManagerListRequest {
}
message WorkerContent {
string worker_id = 1;
string worker_pubkey = 2;
repeated DeviceInfo devices = 3;
message ManagerListResponse {
repeated NodeManagerInfo managers = 1;
}
\ No newline at end of file
......@@ -2,3 +2,21 @@ syntax = "proto3";
package nodemanager.v1;
message NodeManagerInfo {
string publickey = 1;
string endpoint = 2;
}
message DeviceInfo {
string device_type = 1; // cpu/gpu/mem
string device_model = 2; // 具体型号 rtx-4090
string device_param = 3; // 内存容量/CPU主频/GPU显存 等等
uint64 device_power = 4; // CPU: hashrate, MEM: size, GPU: 算力, GPUMEM:size
}
message WorkerContent {
string worker_pubkey = 1;
repeated DeviceInfo devices = 2;
bytes device_proof = 3; // 由测试程序对设备信息进行签名
}
\ No newline at end of file
......@@ -6,5 +6,7 @@ import "nodemanager/v1/request_response.proto";
service NodeManagerService {
rpc RegisterWorker(stream WorkerMessage) returns (stream ManagerMessage) {}
rpc ManagerList(ManagerListRequest) returns (ManagerListResponse) {}
rpc DispatchTask(DispatchTaskRequest) returns (DispatchTaskResponse) {}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment