Example #1
0
    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
Example #2
0
    def _do_add_nodes(self, count, cloud):
        """Add 'count' HTC Nodes to this deployment"""
        # if m_type in ['small', 'medium'] and cloud=='default':
        #    cloud = "cloud.amsterdam."+m_type
        startCloud = self._init_cloud(cloud)

        self.logger.info(str(self.controller.get_clouds()))
        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:
            self.logger.info("Adding node %s: " % (node.id))

            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)

            m_type = self.config_parser.get(cloud, "INST_TYPE")
            worker = Worker(node.id, node.ip, node.private_ip, node.cloud_name, m_type)
            self.service.add_worker(worker, int(node.id))

            self.logger.info(str(self.service))
        self.nodes += node_instances
        self.state = self.S_RUNNING
        if m_type in self.pool:
            self.pool[m_type] += count
        else:
            self.pool[m_type] = count
Example #3
0
    def _do_add_nodes(self, count, cloud):
        """Add 'count' HTC Nodes to this deployment"""
        #if m_type in ['small', 'medium'] and cloud=='default':
        #    cloud = "cloud.amsterdam."+m_type
        startCloud = self._init_cloud(cloud)

        self.logger.info(str(self.controller.get_clouds()))
        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:
            self.logger.info("Adding node %s: " % (node.id))

            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)

            m_type = self.config_parser.get(cloud, 'INST_TYPE')
            worker = Worker(node.id, node.ip, node.private_ip, node.cloud_name, m_type)
            self.service.add_worker(worker, int(node.id))

            self.logger.info(str(self.service))
        self.nodes += node_instances
        self.state = self.S_RUNNING
        if m_type in self.pool:
            self.pool[m_type]+=count
        else:
            self.pool[m_type]=count
Example #4
0
    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
Example #5
0
    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
Example #6
0
    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
Example #7
0
    def _do_startup(self, cloud):
        """Start up the service. The first node will be an agent running a
        HTC Hub and a HTC Node."""

        # self.logger.info("_do_startup(%s)" % cloud)
        startCloud = self._init_cloud(cloud)
        m_type = self.config_parser.get(
            startCloud.cloud_name, "INST_TYPE"
        )  # 'default' may have been replaced by 'iaas'
        # self.logger.info("_do_startup(%s)" % cloud)
        self.logger.info(str(self.controller.get_clouds()))
        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 HTC Hub and a HTC 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)

            node = hub_node
            worker = Worker(node.id, node.ip, node.private_ip, node.cloud_name, m_type)
            self.service.add_worker(worker, int(node.id))

            self.hub_ip = hub_node.ip

            # Extend the nodes list with the newly created one
            self.nodes += nodes
            if m_type in self.pool:
                self.pool[m_type] += 1
            else:
                self.pool[m_type] = 1
            self.state = self.S_RUNNING
        except Exception, err:
            self.logger.exception("_do_startup: Failed to create hub: %s" % err)
            self.state = self.S_ERROR
Example #8
0
    def _do_startup(self, cloud):
        """Start up the service. The first node will be an agent running a
        HTC Hub and a HTC Node."""

        #self.logger.info("_do_startup(%s)" % cloud)
        startCloud = self._init_cloud(cloud)
        m_type = self.config_parser.get(startCloud.cloud_name, 'INST_TYPE')  # 'default' may have been replaced by 'iaas'
        #self.logger.info("_do_startup(%s)" % cloud)
        self.logger.info(str(self.controller.get_clouds()))
        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 HTC Hub and a HTC 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)

            node = hub_node
            worker = Worker(node.id, node.ip, node.private_ip, node.cloud_name, m_type)
            self.service.add_worker(worker, int(node.id))

            self.hub_ip = hub_node.ip

            # Extend the nodes list with the newly created one
            self.nodes += nodes
	    if m_type in self.pool:
		    self.pool[m_type]+=1
            else:
		    self.pool[m_type]=1
            self.state = self.S_RUNNING
        except Exception, err:
            self.logger.exception('_do_startup: Failed to create hub: %s' % err)
            self.state = self.S_ERROR