-# IOError is the base class for socket.error and friends.
+from .baseactor import BaseNodeManagerActor
+
+from libcloud.common.types import LibcloudError
+from libcloud.common.exceptions import BaseHTTPError
+
+# IOError is the base class for socket.error, ssl.SSLError, and friends.
# It seems like it hits the sweet spot for operations we want to retry:
# it's low-level, but unlikely to catch code bugs.
# It seems like it hits the sweet spot for operations we want to retry:
# it's low-level, but unlikely to catch code bugs.
ConfigParser.SafeConfigParser.__init__(self, *args, **kwargs)
for sec_name, settings in {
'Arvados': {'insecure': 'no',
ConfigParser.SafeConfigParser.__init__(self, *args, **kwargs)
for sec_name, settings in {
'Arvados': {'insecure': 'no',
'poll_stale_after': '600',
'max_total_price': '0',
'boot_fail_after': str(sys.maxint),
'poll_stale_after': '600',
'max_total_price': '0',
'boot_fail_after': str(sys.maxint),
- 'node_stale_after': str(60 * 60 * 2)},
+ 'node_stale_after': str(60 * 60 * 2),
+ 'watchdog': '600',
+ 'node_mem_scaling': '0.95'},
+ 'Manage': {'address': '127.0.0.1',
+ 'port': '-1',
+ 'ManagementToken': ''},
def new_cloud_client(self):
module = importlib.import_module('arvnodeman.computenode.driver.' +
self.get('Cloud', 'provider'))
def new_cloud_client(self):
module = importlib.import_module('arvnodeman.computenode.driver.' +
self.get('Cloud', 'provider'))
+ driver_class = module.ComputeNodeDriver.DEFAULT_DRIVER
+ if self.has_option('Cloud', 'driver_class'):
+ d = self.get('Cloud', 'driver_class').split('.')
+ mod = '.'.join(d[:-1])
+ cls = d[-1]
+ driver_class = importlib.import_module(mod).__dict__[cls]
auth_kwargs = self.get_section('Cloud Credentials')
if 'timeout' in auth_kwargs:
auth_kwargs['timeout'] = int(auth_kwargs['timeout'])
return module.ComputeNodeDriver(auth_kwargs,
self.get_section('Cloud List'),
auth_kwargs = self.get_section('Cloud Credentials')
if 'timeout' in auth_kwargs:
auth_kwargs['timeout'] = int(auth_kwargs['timeout'])
return module.ComputeNodeDriver(auth_kwargs,
self.get_section('Cloud List'),
def node_sizes(self, all_sizes):
"""Finds all acceptable NodeSizes for our installation.
def node_sizes(self, all_sizes):
"""Finds all acceptable NodeSizes for our installation.
sec_words = sec_name.split(None, 2)
if sec_words[0] != 'Size':
continue
sec_words = sec_name.split(None, 2)
if sec_words[0] != 'Size':
continue
- size_kwargs[sec_words[1]] = self.get_section(sec_name, int)
+ size_spec = self.get_section(sec_name, int)
+ if 'price' in size_spec:
+ size_spec['price'] = float(size_spec['price'])
+ size_kwargs[sec_words[1]] = size_spec