diff --git a/Gopkg.lock b/Gopkg.lock index 37baa63..96c2d99 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -17,7 +17,7 @@ "ice/transport/http", "ice/util/logutil" ] - revision = "ea737b43402c84f6d0f6737619ccf5f5d64f7774" + revision = "d01148ebfd3de82c51917eead6d1da123d6b7cd6" [[projects]] name = "github.com/davecgh/go-spew" @@ -257,6 +257,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "f17c2632e39bec6f29d44980c691951bf36c0183b2a1369a09a39b386221e319" + inputs-digest = "1463035729fdbe6cd942b7369788c0ea5651a90ebee8035d73dc6ffeeaccb084" solver-name = "gps-cdcl" solver-version = 1 diff --git a/bhubcentral.yml b/bhubcentral.yml index 019a7a1..8655032 100644 --- a/bhubcentral.yml +++ b/bhubcentral.yml @@ -11,4 +11,10 @@ http: key: icehub.key enableTracing: false meta: - provider: mem \ No newline at end of file + provider: mem +node: + role: "central" # workload_*, database_* + provider: + name: "at15-local-cloud" + region: "us-west" + instance: "GameBoyAdvance" \ No newline at end of file diff --git a/pkg/agent/server/heartbeat.go b/pkg/agent/server/heartbeat.go index a13e72b..8771b4b 100644 --- a/pkg/agent/server/heartbeat.go +++ b/pkg/agent/server/heartbeat.go @@ -2,14 +2,17 @@ package server import ( "context" - "time" - "github.com/dyweb/gommon/errors" dlog "github.com/dyweb/gommon/log" + "time" + "github.com/benchhub/benchhub/pkg/agent/config" cpb "github.com/benchhub/benchhub/pkg/central/centralpb" "github.com/benchhub/benchhub/pkg/central/transport/grpc" + pbc "github.com/benchhub/benchhub/pkg/common/commonpb" "github.com/benchhub/benchhub/pkg/common/nodeutil" + "net" + "strconv" ) const ( @@ -20,16 +23,18 @@ const ( // Beater keep posting the server about agent state and retrieve job status type Beater struct { - client grpc.BenchHubCentralClient - interval time.Duration - registered bool - log *dlog.Logger + client grpc.BenchHubCentralClient + interval time.Duration + globalConfig config.ServerConfig + registered bool + log *dlog.Logger } -func NewBeater(client grpc.BenchHubCentralClient, interval time.Duration) *Beater { +func NewBeater(client grpc.BenchHubCentralClient, interval time.Duration, cfg config.ServerConfig) *Beater { b := &Beater{ - client: client, - interval: interval, + client: client, + interval: interval, + globalConfig: cfg, } dlog.NewStructLogger(log, b) return b @@ -51,6 +56,7 @@ func (b *Beater) RunWithContext(ctx context.Context) error { } else { b.log.Infof("register success") b.registered = true + // TODO: publish event inside process? need a place to know node's state } } else { // TODO: real heart beat logic @@ -67,8 +73,13 @@ func (b *Beater) Register() error { ctx, cancel := context.WithTimeout(context.Background(), registerTimeout) defer cancel() node, err := nodeutil.GetNode() - // TODO: update bindAddr, ip, port, etc. - // TODO: update provider etc. + node.BindAdrr = b.globalConfig.Grpc.Addr + node.BindIp, node.BindPort = splitHostPort(node.BindAdrr) + node.Provider = pbc.NodeProvider{ + Name: b.globalConfig.Node.Provider.Name, + Region: b.globalConfig.Node.Provider.Region, + Instance: b.globalConfig.Node.Provider.Instance, + } if err != nil { return err } @@ -82,3 +93,18 @@ func (b *Beater) Register() error { b.log.Infof("register res id is %s", res.Id) return nil } + +// FIXME: exact duplicated code in central and agent, this should go to go.ice +func splitHostPort(addr string) (string, int64) { + _, ps, err := net.SplitHostPort(addr) + if err != nil { + log.Warnf("failed to split host port %s %v", addr, err) + return "", 0 + } + p, err := strconv.Atoi(ps) + if err != nil { + log.Warnf("failed to convert port number %s to int %v", ps, err) + return ps, int64(p) + } + return ps, int64(p) +} diff --git a/pkg/agent/server/manager.go b/pkg/agent/server/manager.go index fb2672c..04adfa0 100644 --- a/pkg/agent/server/manager.go +++ b/pkg/agent/server/manager.go @@ -62,7 +62,7 @@ func NewManager(cfg config.ServerConfig) (*Manager, error) { } //log.Fatalf("interval is %s %d", beatInterval, beatInterval) client := crpc.NewClient(conn) - beater := NewBeater(client, beatInterval) + beater := NewBeater(client, beatInterval, cfg) mgr := &Manager{ cfg: cfg, grpcSrv: grpcSrv, diff --git a/pkg/central/config/server.go b/pkg/central/config/server.go index 7880952..9377730 100644 --- a/pkg/central/config/server.go +++ b/pkg/central/config/server.go @@ -2,6 +2,7 @@ package config import ( iconfig "github.com/at15/go.ice/ice/config" + cconfig "github.com/benchhub/benchhub/pkg/common/config" ) type MetaConfig struct { @@ -12,4 +13,5 @@ type ServerConfig struct { Http iconfig.HttpServerConfig `yaml:"http"` Grpc iconfig.GrpcServerConfig `yaml:"grpc"` Meta MetaConfig `yaml:"meta"` + Node cconfig.NodeConfig `yaml:"node"` } diff --git a/pkg/central/server/grpc.go b/pkg/central/server/grpc.go index abefc3c..e3c0d19 100644 --- a/pkg/central/server/grpc.go +++ b/pkg/central/server/grpc.go @@ -3,13 +3,17 @@ package server import ( "context" "fmt" + "net" "os" + "strconv" + igrpc "github.com/at15/go.ice/ice/transport/grpc" dlog "github.com/dyweb/gommon/log" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" pb "github.com/benchhub/benchhub/pkg/central/centralpb" + "github.com/benchhub/benchhub/pkg/central/config" "github.com/benchhub/benchhub/pkg/central/store/meta" rpc "github.com/benchhub/benchhub/pkg/central/transport/grpc" pbc "github.com/benchhub/benchhub/pkg/common/commonpb" @@ -19,24 +23,20 @@ import ( var _ rpc.BenchHubCentralServer = (*GrpcServer)(nil) type GrpcServer struct { - meta meta.Provider - log *dlog.Logger + meta meta.Provider + globalConfig config.ServerConfig + log *dlog.Logger } -func NewGrpcServer(meta meta.Provider) (*GrpcServer, error) { +func NewGrpcServer(meta meta.Provider, cfg config.ServerConfig) (*GrpcServer, error) { srv := &GrpcServer{ - meta: meta, + meta: meta, + globalConfig: cfg, } dlog.NewStructLogger(log, srv) return srv, nil } -// TODO: get peer information -// TODO: https://groups.google.com/forum/#!topic/grpc-io/UodEY4N78Sk -// tell the agent what its address in central's perspective, -//peer, err := peer.FromContext(ctx) -//peer.Addr - func (srv *GrpcServer) Ping(ctx context.Context, ping *pbc.Ping) (*pbc.Pong, error) { srv.log.Infof("got ping, message is %s", ping.Message) res := fmt.Sprintf("pong from central %s your message is %s", hostname(), ping.Message) @@ -44,27 +44,33 @@ func (srv *GrpcServer) Ping(ctx context.Context, ping *pbc.Ping) (*pbc.Pong, err } func (srv *GrpcServer) RegisterAgent(ctx context.Context, req *pb.RegisterAgentReq) (*pb.RegisterAgentRes, error) { - // TODO: - // - check if the node is already registered - // - assign it id - // - return information about itself - srv.log.Infof("register agent req from %s", req.Node.Host) + remoteAddr := igrpc.RemoteAddr(ctx) + srv.log.Infof("register agent req from %s %s", remoteAddr, req.Node.Host) + req.Node.RemoteAddr = remoteAddr + err := srv.meta.AddNode(req.Node.Uid, req.Node) if err != nil { log.Warnf("failed to add node %v", err) // TODO: already exists may not be the only cause .... though for in memory, it should be ... return nil, status.Errorf(codes.AlreadyExists, "failed to add node %v", err) } - central, err := nodeutil.GetNode() - // TODO: update bindAddr, ip, port, etc. + + node, err := nodeutil.GetNode() if err != nil { log.Warnf("failed to get central node info %v", err) return nil, status.Errorf(codes.Internal, "failed to get central node info %v", err) } + node.BindAdrr = srv.globalConfig.Grpc.Addr + node.BindIp, node.BindPort = splitHostPort(node.BindAdrr) + node.Provider = pbc.NodeProvider{ + Name: srv.globalConfig.Node.Provider.Name, + Region: srv.globalConfig.Node.Provider.Region, + Instance: srv.globalConfig.Node.Provider.Instance, + } res := &pb.RegisterAgentRes{ Id: req.Node.Uid, Node: req.Node, - Central: *central, + Central: *node, } return res, nil } @@ -81,3 +87,18 @@ func hostname() string { return host } } + +// FIXME: exact duplicated code in central and agent, this should go to go.ice +func splitHostPort(addr string) (string, int64) { + _, ps, err := net.SplitHostPort(addr) + if err != nil { + log.Warnf("failed to split host port %s %v", addr, err) + return "", 0 + } + p, err := strconv.Atoi(ps) + if err != nil { + log.Warnf("failed to convert port number %s to int %v", ps, err) + return ps, int64(p) + } + return ps, int64(p) +} diff --git a/pkg/central/server/manager.go b/pkg/central/server/manager.go index 3dc8341..54bd545 100644 --- a/pkg/central/server/manager.go +++ b/pkg/central/server/manager.go @@ -33,7 +33,7 @@ func NewManager(cfg config.ServerConfig) (*Manager, error) { if err != nil { return nil, errors.Wrap(err, "manager can't create meta store") } - grpcSrv, err := NewGrpcServer(metaStore) + grpcSrv, err := NewGrpcServer(metaStore, cfg) if err != nil { return nil, errors.Wrap(err, "manager can't create grpc server") } diff --git a/pkg/common/commonpb/types.pb.go b/pkg/common/commonpb/types.pb.go index d7015d9..d5006c4 100644 --- a/pkg/common/commonpb/types.pb.go +++ b/pkg/common/commonpb/types.pb.go @@ -48,35 +48,32 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type NodeState int32 const ( - NodeState_UNKNOWN_STATE NodeState = 0 - NodeState_FINDING_CENTRAL NodeState = 1 - NodeState_WAITING_JOB NodeState = 2 - NodeState_PROVISIONING_JOB_ENV NodeState = 3 - NodeState_WAITING_PEERS NodeState = 4 - NodeState_RUNNING_JOB NodeState = 5 - NodeState_SENDING_METRICS NodeState = 6 - NodeState_CLEANUP_JOB_ENV NodeState = 7 + NodeState_UNKNOWN_STATE NodeState = 0 + NodeState_FINDING_CENTRAL NodeState = 1 + NodeState_IDLE NodeState = 2 + NodeState_JOB_WAITING_PEERS NodeState = 4 + NodeState_JOB_RUNNING NodeState = 5 + NodeState_JOB_REPORTING NodeState = 6 + NodeState_JOB_CLEANUP NodeState = 7 ) var NodeState_name = map[int32]string{ 0: "UNKNOWN_STATE", 1: "FINDING_CENTRAL", - 2: "WAITING_JOB", - 3: "PROVISIONING_JOB_ENV", - 4: "WAITING_PEERS", - 5: "RUNNING_JOB", - 6: "SENDING_METRICS", - 7: "CLEANUP_JOB_ENV", + 2: "IDLE", + 4: "JOB_WAITING_PEERS", + 5: "JOB_RUNNING", + 6: "JOB_REPORTING", + 7: "JOB_CLEANUP", } var NodeState_value = map[string]int32{ - "UNKNOWN_STATE": 0, - "FINDING_CENTRAL": 1, - "WAITING_JOB": 2, - "PROVISIONING_JOB_ENV": 3, - "WAITING_PEERS": 4, - "RUNNING_JOB": 5, - "SENDING_METRICS": 6, - "CLEANUP_JOB_ENV": 7, + "UNKNOWN_STATE": 0, + "FINDING_CENTRAL": 1, + "IDLE": 2, + "JOB_WAITING_PEERS": 4, + "JOB_RUNNING": 5, + "JOB_REPORTING": 6, + "JOB_CLEANUP": 7, } func (x NodeState) String() string { @@ -126,26 +123,26 @@ func (Provider) EnumDescriptor() ([]byte, []int) { return fileDescriptorTypes, [ type Role int32 const ( - Role_UNKNOWN_ROLE Role = 0 - Role_ANY_ROLE Role = 1 - Role_CENTRAL Role = 2 - Role_WORKLOAD_GENERATOR Role = 3 - Role_DATABASE_RUNNER Role = 4 + Role_UNKNOWN_ROLE Role = 0 + Role_ANY_ROLE Role = 1 + Role_CENTRAL Role = 2 + Role_LOADER Role = 3 + Role_DATABASE Role = 4 ) var Role_name = map[int32]string{ 0: "UNKNOWN_ROLE", 1: "ANY_ROLE", 2: "CENTRAL", - 3: "WORKLOAD_GENERATOR", - 4: "DATABASE_RUNNER", + 3: "LOADER", + 4: "DATABASE", } var Role_value = map[string]int32{ - "UNKNOWN_ROLE": 0, - "ANY_ROLE": 1, - "CENTRAL": 2, - "WORKLOAD_GENERATOR": 3, - "DATABASE_RUNNER": 4, + "UNKNOWN_ROLE": 0, + "ANY_ROLE": 1, + "CENTRAL": 2, + "LOADER": 3, + "DATABASE": 4, } func (x Role) String() string { @@ -183,21 +180,24 @@ func (*NodeStatus) Descriptor() ([]byte, []int) { return fileDescriptorTypes, [] // used for register type Node struct { - // addr that the node's grpc server listens on i.e. :6081 + // addr grpc server listens on i.e. :6081 BindAdrr string `protobuf:"bytes,1,opt,name=bindAdrr,proto3" json:"bindAdrr,omitempty"` - // TODO: how does one node know its ip? .... https://github.com/benchhub/benchhub/issues/18 - Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` - Port int64 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` + // ip grpc server listens on, sometime it's empty for 0.0.0.0 + BindIp string `protobuf:"bytes,2,opt,name=bindIp,proto3" json:"bindIp,omitempty"` + // port grpc server listens on, addr without the ip part + BindPort int64 `protobuf:"varint,3,opt,name=bindPort,proto3" json:"bindPort,omitempty"` + // remoteAddr that server sees when this node act as client, the ip is accurate, but the port is random, not the listen port + RemoteAddr string `protobuf:"bytes,4,opt,name=remoteAddr,proto3" json:"remoteAddr,omitempty"` // self generated uid, used through a node agent's lifetime, change after process restart https://github.com/benchhub/benchhub/issues/17 - Uid string `protobuf:"bytes,4,opt,name=uid,proto3" json:"uid,omitempty"` + Uid string `protobuf:"bytes,5,opt,name=uid,proto3" json:"uid,omitempty"` // hostname - Host string `protobuf:"bytes,5,opt,name=host,proto3" json:"host,omitempty"` + Host string `protobuf:"bytes,6,opt,name=host,proto3" json:"host,omitempty"` // unix timestamp when process start - StartTime int64 `protobuf:"varint,6,opt,name=startTime,proto3" json:"startTime,omitempty"` - BootTime int64 `protobuf:"varint,7,opt,name=bootTime,proto3" json:"bootTime,omitempty"` - Capacity NodeCapacity `protobuf:"bytes,8,opt,name=capacity" json:"capacity"` - Provider NodeProvider `protobuf:"bytes,9,opt,name=provider" json:"provider"` - Role NodeRole `protobuf:"bytes,10,opt,name=role" json:"role"` + StartTime int64 `protobuf:"varint,7,opt,name=startTime,proto3" json:"startTime,omitempty"` + BootTime int64 `protobuf:"varint,8,opt,name=bootTime,proto3" json:"bootTime,omitempty"` + Capacity NodeCapacity `protobuf:"bytes,9,opt,name=capacity" json:"capacity"` + Provider NodeProvider `protobuf:"bytes,10,opt,name=provider" json:"provider"` + Role NodeRole `protobuf:"bytes,11,opt,name=role" json:"role"` } func (m *Node) Reset() { *m = Node{} } @@ -212,9 +212,9 @@ type NodeCapacity struct { MemoryFree int32 `protobuf:"varint,2,opt,name=memoryFree,proto3" json:"memoryFree,omitempty"` // total memory in MB MemoryTotal int32 `protobuf:"varint,3,opt,name=memoryTotal,proto3" json:"memoryTotal,omitempty"` - // free disk space in GB + // free disk space in MB DiskFree int32 `protobuf:"varint,4,opt,name=diskFree,proto3" json:"diskFree,omitempty"` - // total disk space in GB + // total disk space in MB DiskTotal int32 `protobuf:"varint,5,opt,name=diskTotal,proto3" json:"diskTotal,omitempty"` } @@ -383,40 +383,46 @@ func (m *Node) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTypes(dAtA, i, uint64(len(m.BindAdrr))) i += copy(dAtA[i:], m.BindAdrr) } - if len(m.Ip) > 0 { + if len(m.BindIp) > 0 { dAtA[i] = 0x12 i++ - i = encodeVarintTypes(dAtA, i, uint64(len(m.Ip))) - i += copy(dAtA[i:], m.Ip) + i = encodeVarintTypes(dAtA, i, uint64(len(m.BindIp))) + i += copy(dAtA[i:], m.BindIp) } - if m.Port != 0 { + if m.BindPort != 0 { dAtA[i] = 0x18 i++ - i = encodeVarintTypes(dAtA, i, uint64(m.Port)) + i = encodeVarintTypes(dAtA, i, uint64(m.BindPort)) } - if len(m.Uid) > 0 { + if len(m.RemoteAddr) > 0 { dAtA[i] = 0x22 i++ + i = encodeVarintTypes(dAtA, i, uint64(len(m.RemoteAddr))) + i += copy(dAtA[i:], m.RemoteAddr) + } + if len(m.Uid) > 0 { + dAtA[i] = 0x2a + i++ i = encodeVarintTypes(dAtA, i, uint64(len(m.Uid))) i += copy(dAtA[i:], m.Uid) } if len(m.Host) > 0 { - dAtA[i] = 0x2a + dAtA[i] = 0x32 i++ i = encodeVarintTypes(dAtA, i, uint64(len(m.Host))) i += copy(dAtA[i:], m.Host) } if m.StartTime != 0 { - dAtA[i] = 0x30 + dAtA[i] = 0x38 i++ i = encodeVarintTypes(dAtA, i, uint64(m.StartTime)) } if m.BootTime != 0 { - dAtA[i] = 0x38 + dAtA[i] = 0x40 i++ i = encodeVarintTypes(dAtA, i, uint64(m.BootTime)) } - dAtA[i] = 0x42 + dAtA[i] = 0x4a i++ i = encodeVarintTypes(dAtA, i, uint64(m.Capacity.Size())) n2, err := m.Capacity.MarshalTo(dAtA[i:]) @@ -424,7 +430,7 @@ func (m *Node) MarshalTo(dAtA []byte) (int, error) { return 0, err } i += n2 - dAtA[i] = 0x4a + dAtA[i] = 0x52 i++ i = encodeVarintTypes(dAtA, i, uint64(m.Provider.Size())) n3, err := m.Provider.MarshalTo(dAtA[i:]) @@ -432,7 +438,7 @@ func (m *Node) MarshalTo(dAtA []byte) (int, error) { return 0, err } i += n3 - dAtA[i] = 0x52 + dAtA[i] = 0x5a i++ i = encodeVarintTypes(dAtA, i, uint64(m.Role.Size())) n4, err := m.Role.MarshalTo(dAtA[i:]) @@ -662,12 +668,16 @@ func (m *Node) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - l = len(m.Ip) + l = len(m.BindIp) if l > 0 { n += 1 + l + sovTypes(uint64(l)) } - if m.Port != 0 { - n += 1 + sovTypes(uint64(m.Port)) + if m.BindPort != 0 { + n += 1 + sovTypes(uint64(m.BindPort)) + } + l = len(m.RemoteAddr) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) } l = len(m.Uid) if l > 0 { @@ -1101,7 +1111,7 @@ func (m *Node) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BindIp", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1126,13 +1136,13 @@ func (m *Node) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Ip = string(dAtA[iNdEx:postIndex]) + m.BindIp = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BindPort", wireType) } - m.Port = 0 + m.BindPort = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -1142,12 +1152,41 @@ func (m *Node) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Port |= (int64(b) & 0x7F) << shift + m.BindPort |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RemoteAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RemoteAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) } @@ -1176,7 +1215,7 @@ func (m *Node) Unmarshal(dAtA []byte) error { } m.Uid = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Host", wireType) } @@ -1205,7 +1244,7 @@ func (m *Node) Unmarshal(dAtA []byte) error { } m.Host = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) } @@ -1224,7 +1263,7 @@ func (m *Node) Unmarshal(dAtA []byte) error { break } } - case 7: + case 8: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field BootTime", wireType) } @@ -1243,7 +1282,7 @@ func (m *Node) Unmarshal(dAtA []byte) error { break } } - case 8: + case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Capacity", wireType) } @@ -1273,7 +1312,7 @@ func (m *Node) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 9: + case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Provider", wireType) } @@ -1303,7 +1342,7 @@ func (m *Node) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 10: + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } @@ -2013,58 +2052,58 @@ var ( func init() { proto.RegisterFile("types.proto", fileDescriptorTypes) } var fileDescriptorTypes = []byte{ - // 848 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xd1, 0x6e, 0xe3, 0x44, - 0x14, 0xad, 0x13, 0xbb, 0x49, 0x6e, 0xb2, 0xa9, 0x99, 0x96, 0xca, 0xaa, 0x50, 0x88, 0x22, 0x84, - 0x4a, 0xb5, 0x74, 0xa5, 0xe5, 0x85, 0x57, 0x27, 0xf5, 0x86, 0x6c, 0x53, 0xdb, 0x1a, 0xbb, 0xad, - 0xd8, 0x97, 0xe0, 0xd8, 0xb3, 0xa9, 0x45, 0xe3, 0x31, 0xe3, 0xf1, 0x4a, 0x7d, 0xe0, 0x17, 0xf8, - 0x06, 0x5e, 0x91, 0xf8, 0x90, 0x3e, 0xf2, 0x05, 0x08, 0xfa, 0x25, 0x68, 0xc6, 0x76, 0x9c, 0x50, - 0x84, 0xb4, 0x6f, 0xf7, 0x9e, 0x7b, 0xce, 0xcc, 0x99, 0xe3, 0x1b, 0x05, 0xba, 0xfc, 0x21, 0x25, - 0xd9, 0x79, 0xca, 0x28, 0xa7, 0xa8, 0xbd, 0xbc, 0x0b, 0xe9, 0x7a, 0x4d, 0x93, 0x93, 0xaf, 0x57, - 0x31, 0xbf, 0xcb, 0x97, 0xe7, 0x21, 0x5d, 0xbf, 0x5a, 0xd1, 0x15, 0x7d, 0x25, 0x09, 0xcb, 0xfc, - 0xbd, 0xec, 0x64, 0x23, 0xab, 0x42, 0x38, 0x1a, 0x82, 0xea, 0xc6, 0xc9, 0x0a, 0x19, 0xd0, 0x5a, - 0x93, 0x2c, 0x0b, 0x56, 0xc4, 0x50, 0x86, 0xca, 0x69, 0x07, 0x57, 0xad, 0x64, 0xd0, 0xff, 0x65, - 0xfc, 0x04, 0x60, 0xd3, 0x88, 0x78, 0x3c, 0xe0, 0x79, 0x86, 0xbe, 0x02, 0x2d, 0xe3, 0x01, 0x2f, - 0x58, 0xfd, 0xd7, 0x87, 0xe7, 0x95, 0xb5, 0xf3, 0x8a, 0x44, 0x70, 0xc1, 0x40, 0xdf, 0x42, 0x3b, - 0x0c, 0xd2, 0x20, 0x8c, 0xf9, 0x83, 0xd1, 0x18, 0x2a, 0xa7, 0xdd, 0xd7, 0xc7, 0xbb, 0xec, 0x49, - 0x39, 0x1d, 0xab, 0x8f, 0x7f, 0x7e, 0xbe, 0x87, 0x37, 0xec, 0xd1, 0x63, 0x03, 0x54, 0x41, 0x40, - 0x27, 0xd0, 0x5e, 0xc6, 0x49, 0x64, 0x46, 0x8c, 0x95, 0xb6, 0x36, 0x3d, 0xea, 0x43, 0x23, 0x4e, - 0xe5, 0xc1, 0x1d, 0xdc, 0x88, 0x53, 0x84, 0x40, 0x4d, 0x29, 0xe3, 0x46, 0x73, 0xa8, 0x9c, 0x36, - 0xb1, 0xac, 0x91, 0x0e, 0xcd, 0x3c, 0x8e, 0x0c, 0x55, 0x92, 0x44, 0x29, 0x58, 0x77, 0x34, 0xe3, - 0x86, 0x26, 0x21, 0x59, 0xa3, 0xcf, 0xa0, 0x93, 0xf1, 0x80, 0x71, 0x3f, 0x5e, 0x13, 0x63, 0x5f, - 0xca, 0x6b, 0x40, 0x7a, 0xa0, 0xb4, 0x18, 0xb6, 0xe4, 0x70, 0xd3, 0xef, 0x3c, 0xb1, 0xfd, 0x31, - 0x4f, 0x14, 0xca, 0x94, 0xd1, 0x0f, 0x71, 0x44, 0x98, 0xd1, 0xf9, 0x2f, 0xa5, 0x5b, 0x4e, 0x2b, - 0x65, 0xc5, 0x46, 0x2f, 0x41, 0x65, 0xf4, 0x9e, 0x18, 0x20, 0x55, 0x68, 0x57, 0x85, 0xe9, 0x3d, - 0x29, 0x15, 0x92, 0x35, 0xfa, 0x55, 0x81, 0xde, 0xb6, 0x11, 0x74, 0x04, 0x5a, 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0x9e, 0x39, 0x9f, 0xd5, 0x48, 0x53, 0x22, - 0xb7, 0x5e, 0x8d, 0xa8, 0xe2, 0x34, 0xf3, 0xdd, 0x35, 0xb6, 0x6a, 0x4c, 0x13, 0xac, 0xe9, 0xc4, - 0xad, 0x11, 0xe9, 0xd5, 0x35, 0x27, 0x97, 0xd6, 0xd6, 0xf1, 0xad, 0xb3, 0x1f, 0x40, 0x95, 0xcb, - 0xa7, 0x43, 0xaf, 0xb2, 0x89, 0x9d, 0xb9, 0xc8, 0xb4, 0x07, 0x6d, 0xd3, 0xfe, 0xbe, 0xe8, 0x14, - 0xd4, 0x85, 0x56, 0x95, 0x6c, 0x03, 0x1d, 0x03, 0xba, 0x75, 0xf0, 0xe5, 0xdc, 0x31, 0x2f, 0x16, - 0x53, 0xcb, 0xb6, 0xb0, 0xe9, 0x3b, 0xc2, 0xd9, 0x21, 0x1c, 0x5c, 0x98, 0xbe, 0x39, 0x36, 0x3d, - 0x6b, 0x21, 0xc2, 0x13, 0xe6, 0xc6, 0x27, 0x8f, 0x7f, 0x0f, 0xf6, 0x1e, 0x9f, 0x06, 0xca, 0x1f, - 0x4f, 0x03, 0xe5, 0xaf, 0xa7, 0x81, 0xf2, 0xae, 0x5d, 0xec, 0x5e, 0xba, 0x5c, 0xee, 0xcb, 0xff, - 0x80, 0x6f, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x63, 0x48, 0x40, 0xbf, 0x4b, 0x06, 0x00, 0x00, + // 842 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcb, 0x6e, 0xdb, 0x46, + 0x14, 0xf5, 0x48, 0x94, 0x44, 0x5d, 0x29, 0x0a, 0x33, 0x79, 0x80, 0x30, 0x0a, 0x55, 0x10, 0x8a, + 0xc2, 0x35, 0x52, 0x07, 0x48, 0x37, 0xdd, 0x8e, 0x64, 0x46, 0x55, 0x22, 0x53, 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, + 0x4a, 0x80, 0x0f, 0xc1, 0x5c, 0x45, 0x49, 0x48, 0x42, 0x21, 0x0a, 0x5b, 0x5b, 0x8c, 0x5f, 0x40, + 0x53, 0xd5, 0xd3, 0x8d, 0x3e, 0xbc, 0x4d, 0x0b, 0x54, 0xce, 0x78, 0x5c, 0x48, 0xbb, 0x3e, 0x40, + 0x47, 0x75, 0xba, 0xc5, 0xb8, 0x0f, 0x20, 0x58, 0xcc, 0x25, 0x23, 0x61, 0x28, 0x6c, 0x43, 0xcf, + 0xed, 0x30, 0xd8, 0x82, 0x7a, 0x16, 0x85, 0x76, 0x43, 0x37, 0x54, 0x89, 0x31, 0x18, 0xd7, 0x3c, + 0x95, 0x76, 0x53, 0x53, 0xba, 0xc6, 0x9f, 0x41, 0x3b, 0x95, 0xbe, 0x90, 0xcb, 0x28, 0x66, 0x76, + 0x4b, 0x5f, 0x51, 0x11, 0xfa, 0x7e, 0xce, 0xf3, 0xa6, 0x59, 0xdc, 0x5f, 0xe0, 0xbd, 0x48, 0xda, + 0x9f, 0x12, 0x89, 0x9a, 0xdc, 0x08, 0xfe, 0x31, 0x0a, 0x99, 0xb0, 0xe1, 0xbf, 0x26, 0xbd, 0xa2, + 0x5b, 0x4e, 0x96, 0x6a, 0xfc, 0x12, 0x0c, 0xc1, 0x6f, 0x98, 0xdd, 0xd1, 0x53, 0x78, 0x7f, 0x8a, + 0xf2, 0x1b, 0x56, 0x4c, 0x68, 0xd5, 0xf0, 0x57, 0x04, 0xdd, 0x5d, 0x23, 0xf8, 0x19, 0x34, 0x02, + 0x2e, 0x58, 0xaa, 0xf3, 0x6f, 0xd0, 0x1c, 0xa8, 0x20, 0x63, 0x16, 0x73, 0x71, 0xfb, 0x46, 0x30, + 0xa6, 0x1f, 0xa0, 0x41, 0x77, 0x18, 0x3c, 0x80, 0x4e, 0x8e, 0x96, 0x5c, 0xfa, 0x37, 0xfa, 0x1d, + 0x1a, 0x74, 0x97, 0x52, 0x31, 0x85, 0x51, 0xf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x1c, 0x21, 0xdc, 0x81, 0x56, 0x19, 0x5b, 0x0d, 0x03, + 0x34, 0x67, 0x73, 0x92, 0xbb, 0xe9, 0x82, 0x79, 0x4a, 0x96, 0x64, 0x44, 0x16, 0x8e, 0x65, 0x8c, + 0x0e, 0xef, 0xfe, 0xea, 0x1f, 0xdc, 0xdd, 0xf7, 0xd1, 0xef, 0xf7, 0x7d, 0xf4, 0xe7, 0x7d, 0x1f, + 0xbd, 0x37, 0xf3, 0x2d, 0xda, 0xac, 0x56, 0x4d, 0xfd, 0xef, 0xff, 0xcd, 0x3f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x27, 0x50, 0xdf, 0x6f, 0x45, 0x06, 0x00, 0x00, } diff --git a/pkg/common/commonpb/types.proto b/pkg/common/commonpb/types.proto index 23cf12b..23c0fb5 100644 --- a/pkg/common/commonpb/types.proto +++ b/pkg/common/commonpb/types.proto @@ -29,12 +29,11 @@ message Pong { enum NodeState { UNKNOWN_STATE = 0; FINDING_CENTRAL = 1; - WAITING_JOB = 2; - PROVISIONING_JOB_ENV = 3; - WAITING_PEERS = 4; - RUNNING_JOB = 5; - SENDING_METRICS = 6; - CLEANUP_JOB_ENV = 7; + IDLE = 2; + JOB_WAITING_PEERS = 4; + JOB_RUNNING = 5; + JOB_REPORTING = 6; + JOB_CLEANUP = 7; } message NodeStatus { @@ -44,21 +43,27 @@ message NodeStatus { // used for register message Node { - // addr that the node's grpc server listens on i.e. :6081 + // addr grpc server listens on i.e. :6081 string bindAdrr = 1; - // TODO: how does one node know its ip? .... https://github.com/benchhub/benchhub/issues/18 - string ip = 2; - int64 port = 3; + // ip grpc server listens on, sometime it's empty for 0.0.0.0 + string bindIp = 2; + // port grpc server listens on, addr without the ip part + int64 bindPort = 3; + // remoteAddr that server sees when this node act as client, the ip is accurate, but the port is random, not the listen port + string remoteAddr = 4; + // TODO: how does one node know its ip without call external service .... https://github.com/benchhub/benchhub/issues/18 + // self generated uid, used through a node agent's lifetime, change after process restart https://github.com/benchhub/benchhub/issues/17 - string uid = 4; + string uid = 5; // hostname - string host = 5; + string host = 6; // unix timestamp when process start - int64 startTime = 6; - int64 bootTime = 7; - NodeCapacity capacity = 8 [(gogoproto.nullable) = false]; - NodeProvider provider = 9 [(gogoproto.nullable) = false]; - NodeRole role = 10 [(gogoproto.nullable) = false]; + int64 startTime = 7; + int64 bootTime = 8; + + NodeCapacity capacity = 9 [(gogoproto.nullable) = false]; + NodeProvider provider = 10 [(gogoproto.nullable) = false]; + NodeRole role = 11 [(gogoproto.nullable) = false]; } message NodeCapacity { @@ -108,8 +113,8 @@ enum Role { UNKNOWN_ROLE = 0; ANY_ROLE = 1; // 随便 都行 CENTRAL = 2; - WORKLOAD_GENERATOR = 3; - DATABASE_RUNNER = 4; + LOADER = 3; + DATABASE = 4; } message NodeRole { diff --git a/pkg/common/nodeutil/node.go b/pkg/common/nodeutil/node.go index 773a0a6..36219b3 100644 --- a/pkg/common/nodeutil/node.go +++ b/pkg/common/nodeutil/node.go @@ -12,7 +12,7 @@ import ( // return node info that is needed when register agent and heartbeat // GetNode returns node id, capacity, start & boot time -// TODO: addr +// TODO: addr https://github.com/benchhub/benchhub/issues/18 func GetNode() (*pb.Node, error) { m := host.NewMachine() if err := m.Update(); err != nil {