From 732d8ba756c93098ea1482cd63d35f98e23e1e63 Mon Sep 17 00:00:00 2001 From: tonic Date: Wed, 18 Jan 2017 16:56:50 +0800 Subject: [PATCH 1/2] add zone in rpc node --- cluster/calcium/meta.go | 4 + cluster/cluster.go | 3 + devtools/core_pb2.py | 111 +++++++++++++------------ rpc/gen/core.pb.go | 178 +++++++++++++++++++++------------------- rpc/gen/core.proto | 1 + rpc/rpc.go | 8 +- rpc/transform.go | 3 +- types/config.go | 1 + 8 files changed, 167 insertions(+), 142 deletions(-) diff --git a/cluster/calcium/meta.go b/cluster/calcium/meta.go index 9b3ac7e86..1615f3323 100644 --- a/cluster/calcium/meta.go +++ b/cluster/calcium/meta.go @@ -67,3 +67,7 @@ func (c *calcium) GetContainer(id string) (*types.Container, error) { func (c *calcium) GetContainers(ids []string) ([]*types.Container, error) { return c.store.GetContainers(ids) } + +func (c *calcium) GetZone() string { + return c.config.Zone +} diff --git a/cluster/cluster.go b/cluster/cluster.go index 3c55bc320..0c425fc45 100644 --- a/cluster/cluster.go +++ b/cluster/cluster.go @@ -24,4 +24,7 @@ type Cluster interface { UpgradeContainer(ids []string, image string) (chan *types.UpgradeContainerMessage, error) RemoveContainer(ids []string) (chan *types.RemoveContainerMessage, error) RemoveImage(podname, nodename string, images []string) (chan *types.RemoveImageMessage, error) + + // cluster attribute methods + GetZone() string } diff --git a/devtools/core_pb2.py b/devtools/core_pb2.py index 679ca75b6..09261bddf 100644 --- a/devtools/core_pb2.py +++ b/devtools/core_pb2.py @@ -19,7 +19,7 @@ name='core.proto', package='pb', syntax='proto3', - serialized_pb=_b('\n\ncore.proto\x12\x02pb\"\x07\n\x05\x45mpty\"!\n\x03Pod\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x65sc\x18\x02 \x01(\t\"\x1d\n\x04Pods\x12\x15\n\x04pods\x18\x01 \x03(\x0b\x32\x07.pb.Pod\"(\n\x07Network\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07subnets\x18\x02 \x03(\t\")\n\x08Networks\x12\x1d\n\x08networks\x18\x01 \x03(\x0b\x32\x0b.pb.Network\"\xb4\x01\n\x04Node\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08\x65ndpoint\x18\x02 \x01(\t\x12\x0f\n\x07podname\x18\x03 \x01(\t\x12\x0e\n\x06public\x18\x04 \x01(\x08\x12\x1e\n\x03\x63pu\x18\x05 \x03(\x0b\x32\x11.pb.Node.CpuEntry\x12\x0c\n\x04info\x18\x06 \x01(\t\x12\x11\n\tavailable\x18\x07 \x01(\x08\x1a*\n\x08\x43puEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\" \n\x05Nodes\x12\x17\n\x05nodes\x18\x01 \x03(\x0b\x32\x08.pb.Node\"E\n\rNodeAvailable\x12\x10\n\x08nodename\x18\x01 \x01(\t\x12\x0f\n\x07podname\x18\x02 \x01(\t\x12\x11\n\tavailable\x18\x03 \x01(\x08\"V\n\tContainer\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0f\n\x07podname\x18\x02 \x01(\t\x12\x10\n\x08nodename\x18\x03 \x01(\t\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x0c\n\x04info\x18\x05 \x01(\t\"/\n\nContainers\x12!\n\ncontainers\x18\x01 \x03(\x0b\x32\r.pb.Container\"\x19\n\x0b\x43ontainerID\x12\n\n\x02id\x18\x01 \x01(\t\",\n\x0c\x43ontainerIDs\x12\x1c\n\x03ids\x18\x01 \x03(\x0b\x32\x0f.pb.ContainerID\"+\n\rAddPodOptions\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x65sc\x18\x02 \x01(\t\"\x1d\n\rGetPodOptions\x12\x0c\n\x04name\x18\x01 \x01(\t\"\x88\x01\n\x0e\x41\x64\x64NodeOptions\x12\x10\n\x08nodename\x18\x01 \x01(\t\x12\x10\n\x08\x65ndpoint\x18\x02 \x01(\t\x12\x0f\n\x07podname\x18\x03 \x01(\t\x12\x0e\n\x06\x63\x61\x66ile\x18\x04 \x01(\t\x12\x10\n\x08\x63\x65rtfile\x18\x05 \x01(\t\x12\x0f\n\x07keyfile\x18\x06 \x01(\t\x12\x0e\n\x06public\x18\x07 \x01(\x08\"6\n\x11RemoveNodeOptions\x12\x10\n\x08nodename\x18\x01 \x01(\t\x12\x0f\n\x07podname\x18\x02 \x01(\t\"3\n\x0eGetNodeOptions\x12\x0f\n\x07podname\x18\x01 \x01(\t\x12\x10\n\x08nodename\x18\x02 \x01(\t\"0\n\x10ListNodesOptions\x12\x0f\n\x07podname\x18\x01 \x01(\t\x12\x0b\n\x03\x61ll\x18\x02 \x01(\x08\"Q\n\x11\x42uildImageOptions\x12\x0c\n\x04repo\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x0b\n\x03uid\x18\x03 \x01(\t\x12\x10\n\x08\x61rtifact\x18\x04 \x01(\t\"\xc8\x02\n\rDeployOptions\x12\r\n\x05specs\x18\x01 \x01(\t\x12\x0f\n\x07\x61ppname\x18\x02 \x01(\t\x12\r\n\x05image\x18\x03 \x01(\t\x12\x0f\n\x07podname\x18\x04 \x01(\t\x12\x10\n\x08nodename\x18\x05 \x01(\t\x12\x12\n\nentrypoint\x18\x06 \x01(\t\x12\x12\n\nextra_args\x18\x07 \x01(\t\x12\x11\n\tcpu_quota\x18\x08 \x01(\x01\x12\r\n\x05\x63ount\x18\t \x01(\x05\x12\x0e\n\x06memory\x18\n \x01(\x03\x12\x0b\n\x03\x65nv\x18\x0b \x03(\t\x12\x31\n\x08networks\x18\x0c \x03(\x0b\x32\x1f.pb.DeployOptions.NetworksEntry\x12\x0b\n\x03raw\x18\r \x01(\x08\x12\r\n\x05\x64\x65\x62ug\x18\x0e \x01(\x08\x1a/\n\rNetworksEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"=\n\x0eUpgradeOptions\x12\x1c\n\x03ids\x18\x01 \x03(\x0b\x32\x0f.pb.ContainerID\x12\r\n\x05image\x18\x02 \x01(\t\"G\n\x12RemoveImageOptions\x12\x0f\n\x07podname\x18\x01 \x01(\t\x12\x10\n\x08nodename\x18\x02 \x01(\t\x12\x0e\n\x06images\x18\x03 \x03(\t\",\n\x0b\x45rrorDetail\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x03\x12\x0f\n\x07message\x18\x02 \x01(\t\"{\n\x11\x42uildImageMessage\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x10\n\x08progress\x18\x02 \x01(\t\x12\r\n\x05\x65rror\x18\x03 \x01(\t\x12\x0e\n\x06stream\x18\x04 \x01(\t\x12%\n\x0c\x65rror_detail\x18\x05 \x01(\x0b\x32\x0f.pb.ErrorDetail\"\xd3\x01\n\x16\x43reateContainerMessage\x12\x0f\n\x07podname\x18\x01 \x01(\t\x12\x10\n\x08nodename\x18\x02 \x01(\t\x12\n\n\x02id\x18\x03 \x01(\t\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\r\n\x05\x65rror\x18\x05 \x01(\t\x12\x0f\n\x07success\x18\x06 \x01(\x08\x12\x30\n\x03\x63pu\x18\x07 \x03(\x0b\x32#.pb.CreateContainerMessage.CpuEntry\x1a*\n\x08\x43puEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\"F\n\x12RemoveImageMessage\x12\r\n\x05image\x18\x01 \x01(\t\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x10\n\x08messages\x18\x03 \x03(\t\"F\n\x16RemoveContainerMessage\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x0f\n\x07message\x18\x03 \x01(\t\"g\n\x17UpgradeContainerMessage\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06new_id\x18\x02 \x01(\t\x12\x10\n\x08new_name\x18\x03 \x01(\t\x12\r\n\x05\x65rror\x18\x04 \x01(\t\x12\x0f\n\x07success\x18\x05 \x01(\x08\x32\xd1\x06\n\x07\x43oreRPC\x12!\n\x08ListPods\x12\t.pb.Empty\x1a\x08.pb.Pods\"\x00\x12&\n\x06\x41\x64\x64Pod\x12\x11.pb.AddPodOptions\x1a\x07.pb.Pod\"\x00\x12&\n\x06GetPod\x12\x11.pb.GetPodOptions\x1a\x07.pb.Pod\"\x00\x12)\n\x07\x41\x64\x64Node\x12\x12.pb.AddNodeOptions\x1a\x08.pb.Node\"\x00\x12.\n\nRemoveNode\x12\x15.pb.RemoveNodeOptions\x1a\x07.pb.Pod\"\x00\x12)\n\x07GetNode\x12\x12.pb.GetNodeOptions\x1a\x08.pb.Node\"\x00\x12\x31\n\x0cListPodNodes\x12\x14.pb.ListNodesOptions\x1a\t.pb.Nodes\"\x00\x12\x30\n\x0cGetContainer\x12\x0f.pb.ContainerID\x1a\r.pb.Container\"\x00\x12\x33\n\rGetContainers\x12\x10.pb.ContainerIDs\x1a\x0e.pb.Containers\"\x00\x12\x31\n\x0cListNetworks\x12\x11.pb.GetPodOptions\x1a\x0c.pb.Networks\"\x00\x12\x31\n\x10SetNodeAvailable\x12\x11.pb.NodeAvailable\x1a\x08.pb.Node\"\x00\x12>\n\nBuildImage\x12\x15.pb.BuildImageOptions\x1a\x15.pb.BuildImageMessage\"\x00\x30\x01\x12\x42\n\x0f\x43reateContainer\x12\x11.pb.DeployOptions\x1a\x1a.pb.CreateContainerMessage0\x01\x12\x45\n\x10UpgradeContainer\x12\x12.pb.UpgradeOptions\x1a\x1b.pb.UpgradeContainerMessage0\x01\x12\x41\n\x0fRemoveContainer\x12\x10.pb.ContainerIDs\x1a\x1a.pb.RemoveContainerMessage0\x01\x12?\n\x0bRemoveImage\x12\x16.pb.RemoveImageOptions\x1a\x16.pb.RemoveImageMessage0\x01\x62\x06proto3') + serialized_pb=_b('\n\ncore.proto\x12\x02pb\"\x07\n\x05\x45mpty\"!\n\x03Pod\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x65sc\x18\x02 \x01(\t\"\x1d\n\x04Pods\x12\x15\n\x04pods\x18\x01 \x03(\x0b\x32\x07.pb.Pod\"(\n\x07Network\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07subnets\x18\x02 \x03(\t\")\n\x08Networks\x12\x1d\n\x08networks\x18\x01 \x03(\x0b\x32\x0b.pb.Network\"\xc2\x01\n\x04Node\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08\x65ndpoint\x18\x02 \x01(\t\x12\x0f\n\x07podname\x18\x03 \x01(\t\x12\x0e\n\x06public\x18\x04 \x01(\x08\x12\x1e\n\x03\x63pu\x18\x05 \x03(\x0b\x32\x11.pb.Node.CpuEntry\x12\x0c\n\x04info\x18\x06 \x01(\t\x12\x11\n\tavailable\x18\x07 \x01(\x08\x12\x0c\n\x04zone\x18\x08 \x01(\t\x1a*\n\x08\x43puEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\" \n\x05Nodes\x12\x17\n\x05nodes\x18\x01 \x03(\x0b\x32\x08.pb.Node\"E\n\rNodeAvailable\x12\x10\n\x08nodename\x18\x01 \x01(\t\x12\x0f\n\x07podname\x18\x02 \x01(\t\x12\x11\n\tavailable\x18\x03 \x01(\x08\"V\n\tContainer\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0f\n\x07podname\x18\x02 \x01(\t\x12\x10\n\x08nodename\x18\x03 \x01(\t\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\x0c\n\x04info\x18\x05 \x01(\t\"/\n\nContainers\x12!\n\ncontainers\x18\x01 \x03(\x0b\x32\r.pb.Container\"\x19\n\x0b\x43ontainerID\x12\n\n\x02id\x18\x01 \x01(\t\",\n\x0c\x43ontainerIDs\x12\x1c\n\x03ids\x18\x01 \x03(\x0b\x32\x0f.pb.ContainerID\"+\n\rAddPodOptions\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x65sc\x18\x02 \x01(\t\"\x1d\n\rGetPodOptions\x12\x0c\n\x04name\x18\x01 \x01(\t\"\x88\x01\n\x0e\x41\x64\x64NodeOptions\x12\x10\n\x08nodename\x18\x01 \x01(\t\x12\x10\n\x08\x65ndpoint\x18\x02 \x01(\t\x12\x0f\n\x07podname\x18\x03 \x01(\t\x12\x0e\n\x06\x63\x61\x66ile\x18\x04 \x01(\t\x12\x10\n\x08\x63\x65rtfile\x18\x05 \x01(\t\x12\x0f\n\x07keyfile\x18\x06 \x01(\t\x12\x0e\n\x06public\x18\x07 \x01(\x08\"6\n\x11RemoveNodeOptions\x12\x10\n\x08nodename\x18\x01 \x01(\t\x12\x0f\n\x07podname\x18\x02 \x01(\t\"3\n\x0eGetNodeOptions\x12\x0f\n\x07podname\x18\x01 \x01(\t\x12\x10\n\x08nodename\x18\x02 \x01(\t\"0\n\x10ListNodesOptions\x12\x0f\n\x07podname\x18\x01 \x01(\t\x12\x0b\n\x03\x61ll\x18\x02 \x01(\x08\"Q\n\x11\x42uildImageOptions\x12\x0c\n\x04repo\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x0b\n\x03uid\x18\x03 \x01(\t\x12\x10\n\x08\x61rtifact\x18\x04 \x01(\t\"\xc8\x02\n\rDeployOptions\x12\r\n\x05specs\x18\x01 \x01(\t\x12\x0f\n\x07\x61ppname\x18\x02 \x01(\t\x12\r\n\x05image\x18\x03 \x01(\t\x12\x0f\n\x07podname\x18\x04 \x01(\t\x12\x10\n\x08nodename\x18\x05 \x01(\t\x12\x12\n\nentrypoint\x18\x06 \x01(\t\x12\x12\n\nextra_args\x18\x07 \x01(\t\x12\x11\n\tcpu_quota\x18\x08 \x01(\x01\x12\r\n\x05\x63ount\x18\t \x01(\x05\x12\x0e\n\x06memory\x18\n \x01(\x03\x12\x0b\n\x03\x65nv\x18\x0b \x03(\t\x12\x31\n\x08networks\x18\x0c \x03(\x0b\x32\x1f.pb.DeployOptions.NetworksEntry\x12\x0b\n\x03raw\x18\r \x01(\x08\x12\r\n\x05\x64\x65\x62ug\x18\x0e \x01(\x08\x1a/\n\rNetworksEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"=\n\x0eUpgradeOptions\x12\x1c\n\x03ids\x18\x01 \x03(\x0b\x32\x0f.pb.ContainerID\x12\r\n\x05image\x18\x02 \x01(\t\"G\n\x12RemoveImageOptions\x12\x0f\n\x07podname\x18\x01 \x01(\t\x12\x10\n\x08nodename\x18\x02 \x01(\t\x12\x0e\n\x06images\x18\x03 \x03(\t\",\n\x0b\x45rrorDetail\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x03\x12\x0f\n\x07message\x18\x02 \x01(\t\"{\n\x11\x42uildImageMessage\x12\x0e\n\x06status\x18\x01 \x01(\t\x12\x10\n\x08progress\x18\x02 \x01(\t\x12\r\n\x05\x65rror\x18\x03 \x01(\t\x12\x0e\n\x06stream\x18\x04 \x01(\t\x12%\n\x0c\x65rror_detail\x18\x05 \x01(\x0b\x32\x0f.pb.ErrorDetail\"\xd3\x01\n\x16\x43reateContainerMessage\x12\x0f\n\x07podname\x18\x01 \x01(\t\x12\x10\n\x08nodename\x18\x02 \x01(\t\x12\n\n\x02id\x18\x03 \x01(\t\x12\x0c\n\x04name\x18\x04 \x01(\t\x12\r\n\x05\x65rror\x18\x05 \x01(\t\x12\x0f\n\x07success\x18\x06 \x01(\x08\x12\x30\n\x03\x63pu\x18\x07 \x03(\x0b\x32#.pb.CreateContainerMessage.CpuEntry\x1a*\n\x08\x43puEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\"F\n\x12RemoveImageMessage\x12\r\n\x05image\x18\x01 \x01(\t\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x10\n\x08messages\x18\x03 \x03(\t\"F\n\x16RemoveContainerMessage\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x0f\n\x07message\x18\x03 \x01(\t\"g\n\x17UpgradeContainerMessage\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06new_id\x18\x02 \x01(\t\x12\x10\n\x08new_name\x18\x03 \x01(\t\x12\r\n\x05\x65rror\x18\x04 \x01(\t\x12\x0f\n\x07success\x18\x05 \x01(\x08\x32\xd1\x06\n\x07\x43oreRPC\x12!\n\x08ListPods\x12\t.pb.Empty\x1a\x08.pb.Pods\"\x00\x12&\n\x06\x41\x64\x64Pod\x12\x11.pb.AddPodOptions\x1a\x07.pb.Pod\"\x00\x12&\n\x06GetPod\x12\x11.pb.GetPodOptions\x1a\x07.pb.Pod\"\x00\x12)\n\x07\x41\x64\x64Node\x12\x12.pb.AddNodeOptions\x1a\x08.pb.Node\"\x00\x12.\n\nRemoveNode\x12\x15.pb.RemoveNodeOptions\x1a\x07.pb.Pod\"\x00\x12)\n\x07GetNode\x12\x12.pb.GetNodeOptions\x1a\x08.pb.Node\"\x00\x12\x31\n\x0cListPodNodes\x12\x14.pb.ListNodesOptions\x1a\t.pb.Nodes\"\x00\x12\x30\n\x0cGetContainer\x12\x0f.pb.ContainerID\x1a\r.pb.Container\"\x00\x12\x33\n\rGetContainers\x12\x10.pb.ContainerIDs\x1a\x0e.pb.Containers\"\x00\x12\x31\n\x0cListNetworks\x12\x11.pb.GetPodOptions\x1a\x0c.pb.Networks\"\x00\x12\x31\n\x10SetNodeAvailable\x12\x11.pb.NodeAvailable\x1a\x08.pb.Node\"\x00\x12>\n\nBuildImage\x12\x15.pb.BuildImageOptions\x1a\x15.pb.BuildImageMessage\"\x00\x30\x01\x12\x42\n\x0f\x43reateContainer\x12\x11.pb.DeployOptions\x1a\x1a.pb.CreateContainerMessage0\x01\x12\x45\n\x10UpgradeContainer\x12\x12.pb.UpgradeOptions\x1a\x1b.pb.UpgradeContainerMessage0\x01\x12\x41\n\x0fRemoveContainer\x12\x10.pb.ContainerIDs\x1a\x1a.pb.RemoveContainerMessage0\x01\x12?\n\x0bRemoveImage\x12\x16.pb.RemoveImageOptions\x1a\x16.pb.RemoveImageMessage0\x01\x62\x06proto3') ) _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -221,8 +221,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=317, - serialized_end=359, + serialized_start=331, + serialized_end=373, ) _NODE = _descriptor.Descriptor( @@ -281,6 +281,13 @@ message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), + _descriptor.FieldDescriptor( + name='zone', full_name='pb.Node.zone', index=7, + number=8, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), ], extensions=[ ], @@ -294,7 +301,7 @@ oneofs=[ ], serialized_start=179, - serialized_end=359, + serialized_end=373, ) @@ -324,8 +331,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=361, - serialized_end=393, + serialized_start=375, + serialized_end=407, ) @@ -369,8 +376,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=395, - serialized_end=464, + serialized_start=409, + serialized_end=478, ) @@ -428,8 +435,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=466, - serialized_end=552, + serialized_start=480, + serialized_end=566, ) @@ -459,8 +466,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=554, - serialized_end=601, + serialized_start=568, + serialized_end=615, ) @@ -490,8 +497,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=603, - serialized_end=628, + serialized_start=617, + serialized_end=642, ) @@ -521,8 +528,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=630, - serialized_end=674, + serialized_start=644, + serialized_end=688, ) @@ -559,8 +566,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=676, - serialized_end=719, + serialized_start=690, + serialized_end=733, ) @@ -590,8 +597,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=721, - serialized_end=750, + serialized_start=735, + serialized_end=764, ) @@ -663,8 +670,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=753, - serialized_end=889, + serialized_start=767, + serialized_end=903, ) @@ -701,8 +708,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=891, - serialized_end=945, + serialized_start=905, + serialized_end=959, ) @@ -739,8 +746,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=947, - serialized_end=998, + serialized_start=961, + serialized_end=1012, ) @@ -777,8 +784,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1000, - serialized_end=1048, + serialized_start=1014, + serialized_end=1062, ) @@ -829,8 +836,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1050, - serialized_end=1131, + serialized_start=1064, + serialized_end=1145, ) @@ -867,8 +874,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1415, - serialized_end=1462, + serialized_start=1429, + serialized_end=1476, ) _DEPLOYOPTIONS = _descriptor.Descriptor( @@ -988,8 +995,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1134, - serialized_end=1462, + serialized_start=1148, + serialized_end=1476, ) @@ -1026,8 +1033,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1464, - serialized_end=1525, + serialized_start=1478, + serialized_end=1539, ) @@ -1071,8 +1078,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1527, - serialized_end=1598, + serialized_start=1541, + serialized_end=1612, ) @@ -1109,8 +1116,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1600, - serialized_end=1644, + serialized_start=1614, + serialized_end=1658, ) @@ -1168,8 +1175,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1646, - serialized_end=1769, + serialized_start=1660, + serialized_end=1783, ) @@ -1206,8 +1213,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=317, - serialized_end=359, + serialized_start=331, + serialized_end=373, ) _CREATECONTAINERMESSAGE = _descriptor.Descriptor( @@ -1278,8 +1285,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1772, - serialized_end=1983, + serialized_start=1786, + serialized_end=1997, ) @@ -1323,8 +1330,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1985, - serialized_end=2055, + serialized_start=1999, + serialized_end=2069, ) @@ -1368,8 +1375,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2057, - serialized_end=2127, + serialized_start=2071, + serialized_end=2141, ) @@ -1427,8 +1434,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2129, - serialized_end=2232, + serialized_start=2143, + serialized_end=2246, ) _PODS.fields_by_name['pods'].message_type = _POD diff --git a/rpc/gen/core.pb.go b/rpc/gen/core.pb.go index 1310f46ea..7fea71079 100644 --- a/rpc/gen/core.pb.go +++ b/rpc/gen/core.pb.go @@ -157,6 +157,7 @@ type Node struct { Cpu map[string]int64 `protobuf:"bytes,5,rep,name=cpu" json:"cpu,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` Info string `protobuf:"bytes,6,opt,name=info" json:"info,omitempty"` Available bool `protobuf:"varint,7,opt,name=available" json:"available,omitempty"` + Zone string `protobuf:"bytes,8,opt,name=zone" json:"zone,omitempty"` } func (m *Node) Reset() { *m = Node{} } @@ -213,6 +214,13 @@ func (m *Node) GetAvailable() bool { return false } +func (m *Node) GetZone() string { + if m != nil { + return m.Zone + } + return "" +} + type Nodes struct { Nodes []*Node `protobuf:"bytes,1,rep,name=nodes" json:"nodes,omitempty"` } @@ -1736,89 +1744,89 @@ var _CoreRPC_serviceDesc = grpc.ServiceDesc{ func init() { proto.RegisterFile("core.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ - // 1329 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x57, 0xdd, 0x6e, 0xdc, 0x44, - 0x14, 0x8e, 0xd7, 0xfb, 0x7b, 0x36, 0x9b, 0xa6,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54, 0x8b, - 0xf4, 0x1f, 0x07, 0xba, 0xaf, 0x79, 0xcc, 0x56, 0xfa, 0xf2, 0x61, 0xc8, 0xd2, 0x38, 0xe3, 0x49, - 0x5a, 0xe8, 0x73, 0x54, 0x18, 0xe3, 0xc8, 0x78, 0x2c, 0x3f, 0x71, 0xe5, 0x92, 0x81, 0x64, 0x07, - 0xfa, 0x59, 0x39, 0x9d, 0x25, 0x91, 0xd7, 0xdd, 0x75, 0xf6, 0x86, 0x81, 0x46, 0xe4, 0x01, 0xb8, - 0x51, 0x56, 0x7a, 0x3d, 0x19, 0xce, 0x4d, 0x19, 0x0e, 0x8f, 0xd9, 0xfe, 0x51, 0x56, 0x9e, 0xa4, - 0x45, 0xbe, 0x0c, 0x70, 0x15, 0xc3, 0x48, 0xd2, 0x37, 0xdc, 0xeb, 0xab, 0x30, 0x70, 0x4c, 0x3e, - 0x82, 0x51, 0x78, 0x19, 0x26, 0xb3, 0x70, 0x3a, 0x63, 0xde, 0x40, 0xda, 0xac, 0x27, 0xfc, 0xcf, - 0x61, 0x68, 0x4c, 0x90, 0x6d, 0x70, 0xdf, 0xb2, 0xa5, 0x3e, 0x03, 0x0e, 0xc9, 0x2d, 0xe8, 0x5d, - 0x86, 0xb3, 0x92, 0xc9, 0xf8, 0xdd, 0x40, 0x81, 0x2f, 0x3b, 0x5f, 0x38, 0xf4, 0x21, 0xf4, 0xd0, - 0xbf, 0x20, 0xf7, 0xa0, 0x97, 0xe2, 0x40, 0x13, 0x35, 0x34, 0x91, 0x05, 0x6a, 0x9a, 0x46, 0x30, - 0x41, 0x78, 0x68, 0x3c, 0x22, 0x2d, 0xb8, 0x62, 0xd1, 0x55, 0x61, 0x9b, 0x96, 0x4e, 0x93, 0x96, - 0xc6, 0x29, 0xdc, 0xd6, 0x29, 0xe8, 0x12, 0x46, 0x47, 0x3c, 0x2d, 0xc2, 0x24, 0x65, 0x39, 0xd9, - 0x82, 0x4e, 0x12, 0x6b, 0xd3, 0x9d, 0x24,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, 0xcd, 0x0d, 0x3e, 0xda, 0xf3, 0x95, 0x81, 0x69, 0x5f, - 0xfe, 0xee, 0x3e, 0xfb, 0x37, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x44, 0xb8, 0x4a, 0xfc, 0x0e, 0x00, - 0x00, + // 1337 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x57, 0xdd, 0x6e, 0xdc, 0xc4, + 0x17, 0x8f, 0xd7, 0xbb, 0x59, 0xef, 0xd9, 0x6c, 0x9a, 0x8e, 0xda, 0xfc, 0xfd, 0x77, 0x69, 0x49, + 0xa7, 0x12, 0x0d, 0x17, 0x8d, 0xfa, 0x21, 0x28, 0x22, 0x52, 0x51, 0x9a, 0x84, 0x2a, 0x12, 0x94, + 0x60, 0xc4, 0x1d, 0x52, 0xf0, 0xda, 0xd3, 0xc8, 0xea, 0xae, 0xc7, 0x78, 0xec, 0x2c, 0xcb, 0x2b, + 0xf4, 0x8a, 0xc7, 0xe0, 0x4d, 0xe0, 0x92, 0x37, 0x42, 0x67, 0x3e, 0xec, 0xb1, 0xbb, 0x69, 0x20, + 0x77, 0xf3, 0x9b, 0x19, 0xff, 0xe6, 0x7c, 0x9f, 0x63, 0x80, 0x98, 0x17, 0x6c, 0x2f, 0x2f, 0x78, + 0xc9, 0x49, 0x2f, 0x9f, 0xd2, 0x21, 0x0c, 0x8e, 0xe7, 0x79, 0xb9, 0xa4, 0x8f, 0xc0, 0x3d, 0xe5, + 0x09, 0x21, 0xd0, 0xcf, 0xa2, 0x39, 0xf3, 0x9d, 0x1d, 0x67, 0x77, 0x14, 0xca, 0x35, 0xee, 0x25, + 0x4c, 0xc4, 0x7e, 0x4f, 0xed, 0xe1, 0x9a, 0x3e, 0x80, 0xfe, 0x29, 0x4f, 0x04, 0xb9, 0x03, 0xfd, + 0x9c, 0x27, 0xc2, 0x77, 0x76, 0xdc, 0xdd, 0xf1,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f, + 0x9b, 0x25, 0x82, 0xce, 0xb6, 0x0e, 0x59, 0xba, 0xf6, 0xd8, 0x21, 0x2f, 0xe1, 0x46, 0x27, 0xe5, + 0xd5, 0x8b, 0xad, 0x0e, 0x17, 0x04, 0x97, 0x97, 0x86, 0xc7, 0x0e, 0x39, 0x86, 0xad, 0x6e, 0x56, + 0x28, 0xbf, 0xb5, 0x1b, 0x53, 0x70, 0xc7, 0xda, 0x5b, 0x41, 0x73, 0x00, 0x37, 0x3a, 0xb9, 0xbb, + 0xc2, 0xce, 0x41, 0x13, 0x3c, 0x2b, 0x28, 0xbe, 0x82, 0xb1, 0x55, 0x60, 0xc8, 0x76, 0x73, 0xb9, + 0x65, 0x8f, 0xee, 0x7e, 0x4d, 0x30, 0x5d, 0x97, 0xbf, 0xc0, 0xcf, 0xfe, 0x09, 0x00, 0x00, 0xff, + 0xff, 0x34, 0x6e, 0xa0, 0xc5, 0x10, 0x0f, 0x00, 0x00, } diff --git a/rpc/gen/core.proto b/rpc/gen/core.proto index 4b906801a..ee2c9b8d3 100644 --- a/rpc/gen/core.proto +++ b/rpc/gen/core.proto @@ -52,6 +52,7 @@ message Node { map cpu = 5; string info = 6; bool available = 7; + string zone = 8; } message Nodes { diff --git a/rpc/rpc.go b/rpc/rpc.go index d3344096e..17bff2a63 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -63,7 +63,7 @@ func (v *virbranium) AddNode(ctx context.Context, opts *pb.AddNodeOptions) (*pb. return nil, err } - return toRPCNode(n), nil + return toRPCNode(n, v.cluster.GetZone()), nil } // AddNode saves a node and returns it to client @@ -84,7 +84,7 @@ func (v *virbranium) GetNode(ctx context.Context, opts *pb.GetNodeOptions) (*pb. return nil, err } - return toRPCNode(n), nil + return toRPCNode(n, v.cluster.GetZone()), nil } // ListPodNodes returns a list of node for pod @@ -96,7 +96,7 @@ func (v *virbranium) ListPodNodes(ctx context.Context, opts *pb.ListNodesOptions nodes := []*pb.Node{} for _, n := range ns { - nodes = append(nodes, toRPCNode(n)) + nodes = append(nodes, toRPCNode(n, v.cluster.GetZone())) } return &pb.Nodes{Nodes: nodes}, nil } @@ -172,7 +172,7 @@ func (v *virbranium) SetNodeAvailable(ctx context.Context, opts *pb.NodeAvailabl if err != nil { return nil, err } - return toRPCNode(n), nil + return toRPCNode(n, v.cluster.GetZone()), nil } // streamed returned functions diff --git a/rpc/transform.go b/rpc/transform.go index 18fbca271..3b133750b 100644 --- a/rpc/transform.go +++ b/rpc/transform.go @@ -23,7 +23,7 @@ func toRPCNetwork(n *types.Network) *pb.Network { return &pb.Network{Name: n.Name, Subnets: n.Subnets} } -func toRPCNode(n *types.Node) *pb.Node { +func toRPCNode(n *types.Node, zone string) *pb.Node { bytes := []byte("") if info, err := n.Info(); err == nil { bytes, _ = json.Marshal(info) @@ -37,6 +37,7 @@ func toRPCNode(n *types.Node) *pb.Node { Cpu: toRPCCPUMap(n.CPU), Info: string(bytes), Available: n.Available, + Zone: zone, } } diff --git a/types/config.go b/types/config.go index ef140b86c..44c4c659f 100644 --- a/types/config.go +++ b/types/config.go @@ -9,6 +9,7 @@ type Config struct { EtcdLockPrefix string `yaml:"etcd_lock_prefix"` // etcd lock prefix, all locks will be created under this dir ResourceAlloc string `yaml:"resource_alloc"` // scheduler or cpu-period TODO give it a good name Statsd string `yaml:"statsd"` // Statsd host and port + Zone string `yaml:"zone"` // zone for core, e.g. C1, C2 Git GitConfig `yaml:"git"` Docker DockerConfig `yaml:"docker"` From 4f80e8ad0fc273c407980adc84b2d2bd7fc3e254 Mon Sep 17 00:00:00 2001 From: tonic Date: Wed, 18 Jan 2017 16:57:52 +0800 Subject: [PATCH 2/2] update docs --- README.md | 1 + core.yaml.sample | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 622b2efe1..1f4d3d43d 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ permdir: "/mnt/mfs/permdirs" # 宿主机的 permdir 的路径 etcd: # etcd 集群的地址 - "http://127.0.0.1:2379" etcd_lock_prefix: "/eru-core/_lock" # etcd 分布式锁的前缀, 一般会用隐藏文件夹 +zone: "c1" # 机房区域 git: public_key: "[path_to_pub_key]" # git clone 使用的公钥 diff --git a/core.yaml.sample b/core.yaml.sample index 80b99fdbb..d64f69b26 100644 --- a/core.yaml.sample +++ b/core.yaml.sample @@ -8,6 +8,8 @@ etcd_lock_prefix: "/eru-core/_lock" resource_alloc: "cpu-period" statsd: "statsd2.ricebook.net:8125" +zone: "c1" + git: public_key: "***REMOVED***" private_key: "***REMOVED***"