[ARVADOS] updated: 1.1.4-328-g00cca6a
Git user
git at public.curoverse.com
Thu May 31 12:43:50 EDT 2018
Summary of changes:
services/nodemanager/arvnodeman/computenode/driver/azure.py | 3 ++-
services/nodemanager/arvnodeman/computenode/driver/ec2.py | 3 ++-
services/nodemanager/arvnodeman/computenode/driver/gce.py | 3 ++-
services/nodemanager/arvnodeman/nodelist.py | 4 ++--
services/nodemanager/tests/test_nodelist.py | 1 +
5 files changed, 9 insertions(+), 5 deletions(-)
via 00cca6a192eb1ab38559bf5ed9044711ed56fc4a (commit)
from 9fcb58db8d47a42e52eead600ddabf57ab7c29ed (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 00cca6a192eb1ab38559bf5ed9044711ed56fc4a
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Thu May 31 13:42:45 2018 -0300
7478: Unify arvados node size access across different drivers
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/services/nodemanager/arvnodeman/computenode/driver/azure.py b/services/nodemanager/arvnodeman/computenode/driver/azure.py
index 32f6b6c..5dfa7f5 100644
--- a/services/nodemanager/arvnodeman/computenode/driver/azure.py
+++ b/services/nodemanager/arvnodeman/computenode/driver/azure.py
@@ -81,7 +81,7 @@ echo %s > /var/tmp/arv-node-data/meta-data/instance-type
def create_node(self, size, arvados_node):
# Set up tag indicating the Arvados assigned Cloud Size id.
self.create_kwargs.setdefault('ex_tags', {})
- self.create_kwargs['ex_tags'].update({'arvados-node-size-id': size.id})
+ self.create_kwargs['ex_tags'].update({'arvados_node_size': size.id})
return super(ComputeNodeDriver, self).create_node(size, arvados_node)
def list_nodes(self):
@@ -94,6 +94,7 @@ echo %s > /var/tmp/arv-node-data/meta-data/instance-type
# Need to populate Node.size
if not n.size:
n.size = self.sizes[n.extra["properties"]["hardwareProfile"]["vmSize"]]
+ n.extra['arvados_node_size'] = n.extra.get('tags', {}).get('arvados_node_size')
return nodes
def broken(self, cloud_node):
diff --git a/services/nodemanager/arvnodeman/computenode/driver/ec2.py b/services/nodemanager/arvnodeman/computenode/driver/ec2.py
index ae2eb85..c6c119b 100644
--- a/services/nodemanager/arvnodeman/computenode/driver/ec2.py
+++ b/services/nodemanager/arvnodeman/computenode/driver/ec2.py
@@ -102,7 +102,7 @@ class ComputeNodeDriver(BaseComputeNodeDriver):
def create_node(self, size, arvados_node):
# Set up tag indicating the Arvados assigned Cloud Size id.
- self.create_kwargs['ex_metadata'].update({'arvados-node-size-id': size.id})
+ self.create_kwargs['ex_metadata'].update({'arvados_node_size': size.id})
return super(ComputeNodeDriver, self).create_node(size, arvados_node)
def list_nodes(self):
@@ -111,6 +111,7 @@ class ComputeNodeDriver(BaseComputeNodeDriver):
for n in nodes:
if not n.size:
n.size = self.sizes[n.extra["instance_type"]]
+ n.extra['arvados_node_size'] = n.extra.get('metadata', {}).get('arvados_node_size')
return nodes
@classmethod
diff --git a/services/nodemanager/arvnodeman/computenode/driver/gce.py b/services/nodemanager/arvnodeman/computenode/driver/gce.py
index 8ab991b..f8d81ca 100644
--- a/services/nodemanager/arvnodeman/computenode/driver/gce.py
+++ b/services/nodemanager/arvnodeman/computenode/driver/gce.py
@@ -111,7 +111,7 @@ class ComputeNodeDriver(BaseComputeNodeDriver):
def create_node(self, size, arvados_node):
# Set up tag indicating the Arvados assigned Cloud Size id.
- self.create_kwargs['ex_metadata'].update({'arvados-node-size-id': size.id})
+ self.create_kwargs['ex_metadata'].update({'arvados_node_size': size.id})
return super(ComputeNodeDriver, self).create_node(size, arvados_node)
def list_nodes(self):
@@ -126,6 +126,7 @@ class ComputeNodeDriver(BaseComputeNodeDriver):
if nodelist and not hasattr(nodelist[0].size, 'id'):
for node in nodelist:
node.size = self._sizes_by_id[node.size]
+ node.extra['arvados_node_size'] = node.extra.get('metadata', {}).get('arvados_node_size')
return nodelist
@classmethod
diff --git a/services/nodemanager/arvnodeman/nodelist.py b/services/nodemanager/arvnodeman/nodelist.py
index 4b9d5b6..66af7c3 100644
--- a/services/nodemanager/arvnodeman/nodelist.py
+++ b/services/nodemanager/arvnodeman/nodelist.py
@@ -80,8 +80,8 @@ class CloudNodeListMonitorActor(clientactor.RemotePollLoopActor):
def _send_request(self):
nodes = self._client.list_nodes()
for n in nodes:
- # Replace with libcloud NodeSize object with compatible
+ # Replace the libcloud NodeSize object with compatible
# CloudSizeWrapper object which merges the size info reported from
# the cloud with size information from the configuration file.
- n.size = self._calculator.find_size(n.size.id)
+ n.size = self._calculator.find_size(n.extra['arvados_node_size'])
return nodes
diff --git a/services/nodemanager/tests/test_nodelist.py b/services/nodemanager/tests/test_nodelist.py
index 5becd0c..b087325 100644
--- a/services/nodemanager/tests/test_nodelist.py
+++ b/services/nodemanager/tests/test_nodelist.py
@@ -84,6 +84,7 @@ class CloudNodeListMonitorActorTestCase(testutil.RemotePollLoopActorTestMixin,
self.public_ips = []
self.size = testutil.MockSize(1)
self.state = 0
+ self.extra = {'arvados_node_size': self.size.id}
def build_monitor(self, side_effect, *args, **kwargs):
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list