[ARVADOS] created: d43df73d4429ddd4c00c7ff47e10f9f2595d30b0

Git user git at public.curoverse.com
Mon Mar 14 20:20:05 EDT 2016


        at  d43df73d4429ddd4c00c7ff47e10f9f2595d30b0 (commit)


commit d43df73d4429ddd4c00c7ff47e10f9f2595d30b0
Author: radhika <radhika at curoverse.com>
Date:   Mon Mar 14 20:19:28 2016 -0400

    8561: rather than getting node's ipadd, use it's ec2_instance_id

diff --git a/services/nodemanager/arvnodeman/computenode/dispatch/__init__.py b/services/nodemanager/arvnodeman/computenode/dispatch/__init__.py
index a239f1f..4d1acf5 100644
--- a/services/nodemanager/arvnodeman/computenode/dispatch/__init__.py
+++ b/services/nodemanager/arvnodeman/computenode/dispatch/__init__.py
@@ -406,7 +406,7 @@ class ComputeNodeMonitorActor(config.actor_class):
         first_ping_s = arvados_node.get('first_ping_at')
         if (self.arvados_node is not None) or (not first_ping_s):
             return None
-        elif ((arvados_node['ip_address'] in self.cloud_node.private_ips) and
+        elif ((arvados_node['info'].get('ec2_instance_id') == self._cloud.node_id(self.cloud_node)) and
               (arvados_timestamp(first_ping_s) >= self.cloud_node_start_time)):
             self._later.update_arvados_node(arvados_node)
             return self.cloud_node.id
diff --git a/services/nodemanager/arvnodeman/computenode/driver/__init__.py b/services/nodemanager/arvnodeman/computenode/driver/__init__.py
index 9bdcc5f..d72c86d 100644
--- a/services/nodemanager/arvnodeman/computenode/driver/__init__.py
+++ b/services/nodemanager/arvnodeman/computenode/driver/__init__.py
@@ -196,6 +196,11 @@ class BaseComputeNodeDriver(RetryMixin):
             lambda self, value: setattr(self.real, attr_name, value),
             doc=getattr(getattr(NodeDriver, attr_name), '__doc__', None))
 
+    # node id
+    @classmethod
+    def node_id(cls):
+        raise NotImplementedError("BaseComputeNodeDriver.node_id")
+
     _locals = locals()
     for _attr_name in dir(NodeDriver):
         if (not _attr_name.startswith('_')) and (_attr_name not in _locals):
diff --git a/services/nodemanager/arvnodeman/computenode/driver/azure.py b/services/nodemanager/arvnodeman/computenode/driver/azure.py
index fbae522..167d8b3 100644
--- a/services/nodemanager/arvnodeman/computenode/driver/azure.py
+++ b/services/nodemanager/arvnodeman/computenode/driver/azure.py
@@ -77,7 +77,7 @@ echo %s > /var/tmp/arv-node-data/meta-data/instance-type
         # Azure only supports filtering node lists by resource group.
         # Do our own filtering based on tag.
         nodes = [node for node in
-                super(ComputeNodeDriver, self).list_nodes()
+                super(ComputeNodeDriver, self).list_nodes(ex_fetch_nic=False)
                 if node.extra["tags"].get("arvados-class") == self.tags["arvados-class"]]
         for n in nodes:
             # Need to populate Node.size
@@ -98,3 +98,7 @@ echo %s > /var/tmp/arv-node-data/meta-data/instance-type
     @classmethod
     def node_start_time(cls, node):
         return arvados_timestamp(node.extra["tags"].get("booted_at"))
+
+    @classmethod
+    def node_id(cls, node):
+        return node.name
diff --git a/services/nodemanager/arvnodeman/computenode/driver/ec2.py b/services/nodemanager/arvnodeman/computenode/driver/ec2.py
index 991a298..d314d38 100644
--- a/services/nodemanager/arvnodeman/computenode/driver/ec2.py
+++ b/services/nodemanager/arvnodeman/computenode/driver/ec2.py
@@ -92,3 +92,7 @@ class ComputeNodeDriver(BaseComputeNodeDriver):
         time_str = node.extra['launch_time'].split('.', 2)[0] + 'UTC'
         return time.mktime(time.strptime(
                 time_str,'%Y-%m-%dT%H:%M:%S%Z')) - time.timezone
+
+    @classmethod
+    def node_id(cls, node):
+        return node.id
diff --git a/services/nodemanager/arvnodeman/computenode/driver/gce.py b/services/nodemanager/arvnodeman/computenode/driver/gce.py
index bbabdd4..be99883 100644
--- a/services/nodemanager/arvnodeman/computenode/driver/gce.py
+++ b/services/nodemanager/arvnodeman/computenode/driver/gce.py
@@ -163,3 +163,7 @@ class ComputeNodeDriver(BaseComputeNodeDriver):
                     node.extra['metadata']['items'], 'booted_at'))
         except KeyError:
             return 0
+
+    @classmethod
+    def node_id(cls, node):
+        return node.id

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list