if new_pair is not None:
self.create_kwargs[new_pair[0]] = new_pair[1]
- def _init_image_id(self, image_id):
- return 'image', image_id
+ def _init_image(self, image_name):
+ return 'image', image_name
+
+ def _init_location(self, location):
+ return 'location', location
def _init_ping_host(self, ping_host):
self.ping_host = ping_host
def _init_service_accounts(self, service_accounts_str):
self.service_accounts = json.loads(service_accounts_str)
- def _init_network_id(self, subnet_id):
- return 'ex_network', subnet_id
-
def _init_ssh_key(self, filename):
with open(filename) as ssh_file:
self.ssh_key = ssh_file.read().strip()
ping_url = ('https://{}/arvados/v1/nodes/{}/ping?ping_secret={}'.
format(self.ping_host, arvados_node['uuid'],
ping_secret))
- result['ex_userdata'] = ping_url
+ result['ex_metadata']['pingUrl'] = ping_url
if self.service_accounts is not None:
result['ex_service_accounts'] = self.service_accounts
result['ex_metadata']['sshKeys'] = 'root:{}'.format(self.ssh_key)
return result
+ def create_node(self, size, arvados_node):
+ kwargs = self.create_kwargs.copy()
+ kwargs.update(self.arvados_create_kwargs(arvados_node))
+ kwargs.setdefault('name', 'arv-{}'.format(arvados_node['uuid']))
+ kwargs['size'] = size
+ return self.real.create_node(**kwargs)
+
# When an Arvados node is synced with a GCE node, the Arvados hostname
# is forwarded in a GCE tag 'hostname-foo'.
# TODO(twp): implement an ex_set_metadata method (at least until
# The GCE image name and network zone name to use when creating new nodes.
# * Valid image aliases: https://cloud.google.com/sdk/gcloud/reference/compute/instances/create
-# * Valid network zones: https://cloud.google.com/compute/docs/zones
-image_id = debian-7
-network_id = us-central1-a
+# * Valid location (zone) names: https://cloud.google.com/compute/docs/zones
+image = debian-7
+location = us-central1-a
# JSON string of service account authorizations for this cluster.
# See http://libcloud.readthedocs.org/en/latest/compute/drivers/gce.html#specifying-service-account-scopes