[ARVADOS] created: f5f91a293a757ebccb74212856524c3823af812a
Git user
git at public.curoverse.com
Tue Aug 15 23:53:51 EDT 2017
at f5f91a293a757ebccb74212856524c3823af812a (commit)
commit f5f91a293a757ebccb74212856524c3823af812a
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Wed Aug 16 00:52:56 2017 -0300
12055: Updated fake driver to make integration tests work again.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/build/libcloud-pin.sh b/build/libcloud-pin.sh
index 8d71097..1ddb776 100644
--- a/build/libcloud-pin.sh
+++ b/build/libcloud-pin.sh
@@ -2,4 +2,4 @@
#
# SPDX-License-Identifier: AGPL-3.0
-LIBCLOUD_PIN=0.20.2.dev3
\ No newline at end of file
+LIBCLOUD_PIN=0.20.2.dev4
\ No newline at end of file
diff --git a/services/nodemanager/arvnodeman/test/fake_driver.py b/services/nodemanager/arvnodeman/test/fake_driver.py
index a34e366..9cb582c 100644
--- a/services/nodemanager/arvnodeman/test/fake_driver.py
+++ b/services/nodemanager/arvnodeman/test/fake_driver.py
@@ -150,11 +150,13 @@ class FakeAwsDriver(FakeDriver):
image=None,
auth=None,
ex_userdata=None,
+ ex_metadata=None,
ex_blockdevicemappings=None):
n = super(FakeAwsDriver, self).create_node(name=name,
size=size,
image=image,
auth=auth,
+ ex_metadata=ex_metadata,
ex_userdata=ex_userdata)
n.extra = {"launch_time": time.strftime(ARVADOS_TIMEFMT, time.gmtime())[:-1]}
return n
commit c3896b7f9465bedff5a91de2eafa8a2c2db57509
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Tue Aug 15 22:58:59 2017 -0300
12055: On EC2 driver, pass the tag list to the node_create call
instead of assigning them after creation.
Updated tests.
Bumped libcloud fork dependency to 0.20.2.dev4, which has the
necessary updates to pass TagSpecification parameters to Amazon API
create call.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/services/nodemanager/arvnodeman/computenode/driver/ec2.py b/services/nodemanager/arvnodeman/computenode/driver/ec2.py
index 1c1b51b..846aa6c 100644
--- a/services/nodemanager/arvnodeman/computenode/driver/ec2.py
+++ b/services/nodemanager/arvnodeman/computenode/driver/ec2.py
@@ -52,6 +52,10 @@ class ComputeNodeDriver(BaseComputeNodeDriver):
self.tags = {key[4:]: value
for key, value in list_kwargs.iteritems()
if key.startswith('tag:')}
+ # Tags are assigned at instance creation time
+ if not 'ex_metadata' in create_kwargs:
+ create_kwargs['ex_metadata'] = {}
+ create_kwargs['ex_metadata'].update(self.tags)
super(ComputeNodeDriver, self).__init__(
auth_kwargs, {'ex_filters': list_kwargs}, create_kwargs,
driver_class)
@@ -90,9 +94,6 @@ class ComputeNodeDriver(BaseComputeNodeDriver):
}}]
return kw
- def post_create_node(self, cloud_node):
- self.real.ex_create_tags(cloud_node, self.tags)
-
def sync_node(self, cloud_node, arvados_node):
self.real.ex_create_tags(cloud_node,
{'Name': arvados_node_fqdn(arvados_node)})
diff --git a/services/nodemanager/setup.py b/services/nodemanager/setup.py
index d083bf1..0549e76 100644
--- a/services/nodemanager/setup.py
+++ b/services/nodemanager/setup.py
@@ -40,14 +40,14 @@ setup(name='arvados-node-manager',
'setuptools'
],
dependency_links=[
- "https://github.com/curoverse/libcloud/archive/apache-libcloud-0.20.2.dev3.zip"
+ "https://github.com/curoverse/libcloud/archive/apache-libcloud-0.20.2.dev4.zip"
],
test_suite='tests',
tests_require=[
'requests',
'pbr<1.7.0',
'mock>=1.0',
- 'apache-libcloud==0.20.2.dev3',
+ 'apache-libcloud==0.20.2.dev4',
],
zip_safe=False,
cmdclass={'egg_info': tagger},
diff --git a/services/nodemanager/tests/test_computenode_driver_ec2.py b/services/nodemanager/tests/test_computenode_driver_ec2.py
index e90e765..297eac0 100644
--- a/services/nodemanager/tests/test_computenode_driver_ec2.py
+++ b/services/nodemanager/tests/test_computenode_driver_ec2.py
@@ -50,6 +50,17 @@ class EC2ComputeNodeDriverTestCase(testutil.DriverTestMixin, unittest.TestCase):
create_method.call_args[1].get('ex_userdata',
'arg missing'))
+ def test_create_includes_metadata(self):
+ arv_node = testutil.arvados_node_mock()
+ driver = self.new_driver(list_kwargs={'tag_test': 'testvalue'})
+ driver.create_node(testutil.MockSize(1), arv_node)
+ create_method = self.driver_mock().create_node
+ self.assertTrue(create_method.called)
+ self.assertEqual(
+ {'test':'testvalue'},
+ create_method.call_args[1].get('ex_metadata', {'arg': 'missing'})
+ )
+
def test_hostname_from_arvados_node(self):
arv_node = testutil.arvados_node_mock(8)
driver = self.new_driver()
@@ -68,16 +79,6 @@ class EC2ComputeNodeDriverTestCase(testutil.DriverTestMixin, unittest.TestCase):
self.assertIs(cloud_node, tag_mock.call_args[0][0])
self.assertEqual(expected_tags, tag_mock.call_args[0][1])
- def test_post_create_node_tags_from_list_kwargs(self):
- expect_tags = {'key1': 'test value 1', 'key2': 'test value 2'}
- list_kwargs = {('tag_' + key): value
- for key, value in expect_tags.iteritems()}
- list_kwargs['instance-state-name'] = 'running'
- cloud_node = testutil.cloud_node_mock()
- driver = self.new_driver(list_kwargs=list_kwargs)
- driver.post_create_node(cloud_node)
- self.check_node_tagged(cloud_node, expect_tags)
-
def test_sync_node(self):
arv_node = testutil.arvados_node_mock(1)
cloud_node = testutil.cloud_node_mock(2)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list