def _do_startup(self, cloud): """Start up the service. The first node will be an agent running a HTCondor Hub and a HTCondor Node.""" startCloud = self._init_cloud(cloud) vals = { 'action': '_do_startup', 'count': 1 } self.logger.debug(self.ACTION_REQUESTING_NODES % vals) try: nodes = self.controller.create_nodes(1, client.check_agent_process, self.AGENT_PORT, startCloud) hub_node = nodes[0] # The first agent is a HTCondor Hub and a HTCondor Node client.create_hub(hub_node.ip, self.AGENT_PORT) client.create_node(hub_node.ip, self.AGENT_PORT, hub_node.ip) self.logger.info("Added node %s: %s " % (hub_node.id, hub_node.ip)) node_info.add_node_info('/etc/hosts', hub_node.ip, hub_node.id) self.hub_ip = hub_node.ip # Extend the nodes list with the newly created one self.nodes += nodes self.state = self.S_RUNNING except Exception, err: self.logger.exception('_do_startup: Failed to create hub: %s' % err) self.state = self.S_ERROR
def _do_startup(self, cloud): """Start up the service. The first node will be an agent running a HTCondor Hub and a HTCondor Node.""" startCloud = self._init_cloud(cloud) vals = {'action': '_do_startup', 'count': 1} self.logger.debug(self.ACTION_REQUESTING_NODES % vals) try: nodes = self.controller.create_nodes(1, client.check_agent_process, self.AGENT_PORT, startCloud) hub_node = nodes[0] # The first agent is a HTCondor Hub and a HTCondor Node client.create_hub(hub_node.ip, self.AGENT_PORT) client.create_node(hub_node.ip, self.AGENT_PORT, hub_node.ip) self.logger.info("Added node %s: %s " % (hub_node.id, hub_node.ip)) node_info.add_node_info('/etc/hosts', hub_node.ip, hub_node.id) self.hub_ip = hub_node.ip # Extend the nodes list with the newly created one self.nodes += nodes self.state = self.S_RUNNING except Exception, err: self.logger.exception('_do_startup: Failed to create hub: %s' % err) self.state = self.S_ERROR
def _do_add_nodes(self, count, cloud): """Add 'count' HTCondor Nodes to this deployment""" startCloud = self._init_cloud(cloud) vals = { 'action': '_do_add_nodes', 'count': count } self.logger.debug(self.ACTION_REQUESTING_NODES % vals) node_instances = self.controller.create_nodes(count, client.check_agent_process, self.AGENT_PORT, startCloud) # Startup agents for node in node_instances: client.create_node(node.ip, self.AGENT_PORT, self.hub_ip) self.logger.info("Added node %s: %s " % (node.id, node.ip)) node_info.add_node_info('/etc/hosts', node.ip, node.id) self.nodes += node_instances self.state = self.S_RUNNING
def _do_add_nodes(self, count, cloud): """Add 'count' HTCondor Nodes to this deployment""" startCloud = self._init_cloud(cloud) vals = {'action': '_do_add_nodes', 'count': count} self.logger.debug(self.ACTION_REQUESTING_NODES % vals) node_instances = self.controller.create_nodes( count, client.check_agent_process, self.AGENT_PORT, startCloud) # Startup agents for node in node_instances: client.create_node(node.ip, self.AGENT_PORT, self.hub_ip) self.logger.info("Added node %s: %s " % (node.id, node.ip)) node_info.add_node_info('/etc/hosts', node.ip, node.id) self.nodes += node_instances self.state = self.S_RUNNING