Exemple #1
0
    def __init__(self, config_parser, **kwargs):
        BaseManager.__init__(self, config_parser)

        # node lists
        self.nodes = []  # all nodes
        self.osdNodes = []  # only the OSD nodes
        self.mrcNodes = []  # onle the MRC nodes
        self.dirNodes = []  # only the DIR nodes

        # node counters
        self.dirCount = 0
        self.mrcCount = 0
        self.osdCount = 0

        # wether we want to keep storage volumes upon OSD nodes deletion
        self.persistent = False

        # default value for OSD volume size
        self.osd_volume_size = 1024

        # dictionaries mapping node IDs to uuids
        self.dir_node_uuid_map = {}
        self.mrc_node_uuid_map = {}
        self.osd_node_uuid_map = {}

        # dictionary mapping osd uuids to volume IDs
        self.osd_uuid_volume_map = {}

        # Setup the clouds' controller
        self.controller.generate_context('xtreemfs')
Exemple #2
0
    def __init__(self, config_parser, **kwargs):
        BaseManager.__init__(self, config_parser)

        # node lists
        self.nodes = []    # all nodes         
        self.osdNodes = [] # only the OSD nodes  
        self.mrcNodes = [] # onle the MRC nodes
        self.dirNodes = [] # only the DIR nodes   

        # node counters
        self.dirCount = 0
        self.mrcCount = 0
        self.osdCount = 0

        # wether we want to keep storage volumes upon OSD nodes deletion
        self.persistent = False

        # default value for OSD volume size
        self.osd_volume_size = 1024

        # dictionaries mapping node IDs to uuids
        self.dir_node_uuid_map = {}
        self.mrc_node_uuid_map = {}
        self.osd_node_uuid_map = {}
        
        # dictionary mapping osd uuids to volume IDs
        self.osd_uuid_volume_map = {}

        # Setup the clouds' controller
        self.controller.generate_context('xtreemfs')
Exemple #3
0
    def __init__(self, conf, **kwargs):
        BaseManager.__init__(self, conf)

        self.logger.debug("Entering GaleraServerManager initialization")
        self.controller.generate_context('galera')
        self.controller.config_clouds({"mem": "512", "cpu": "1"})
        self.state = self.S_INIT
        self.config = Configuration(conf)
        self.logger.debug("Leaving GaleraServer initialization")
Exemple #4
0
 def __init__(self,
              config_parser, # config file
              **kwargs):     # anything you can't send in config_parser
                             # (hopefully the new service won't need anything extra)
     BaseManager.__init__(self, config_parser)
     self.nodes = []
     self.context = {'FIRST': 'true', 'MGMT_SERVER': '', 'KNOWN_HOSTS': ''}
     # Setup the clouds' controller
     self.controller.generate_context('scalaris')
Exemple #5
0
 def __init__(self,
              config_parser, # config file
              **kwargs):     # anything you can't send in config_parser
                             # (hopefully the new service won't need anything extra)
     BaseManager.__init__(self, config_parser)
     self.nodes = []
     # Setup the clouds' controller
     self.controller.generate_context('helloworld')
     self.state = self.S_INIT
Exemple #6
0
 def __init__(self,
              config_parser, # config file
              **kwargs):     # anything you can't send in config_parser
                             # (hopefully the new service won't need anything extra)
     BaseManager.__init__(self, config_parser)
     self.context = {'FIRST': 'true', 'MGMT_SERVER': '', 'KNOWN_HOSTS': ''}
     # Setup the clouds' controller
     self.controller.generate_context('scalaris')
     self.cloud_groups = CloudGroups(self.controller.get_clouds(), self.controller.get_default_cloud().get_cloud_name())
     self.logger.info('Cloud-Groups: %s', self.cloud_groups.groups)
Exemple #7
0
    def __init__(self,
                 config_parser, # config file
                 **kwargs):     # anything you can't send in config_parser
                                # (hopefully the new service won't need anything extra)
        BaseManager.__init__(self, config_parser)

        self.nodes = []
        # Setup the clouds' controller
        self.controller.generate_context('mapreduce')
        self.controller.config_clouds({ "mem" : "1024", "cpu" : "1" })
Exemple #8
0
 def __init__(
         self,
         config_parser,  # config file
         **kwargs):  # anything you can't send in config_parser
     # (hopefully the new service won't need anything extra)
     BaseManager.__init__(self, config_parser)
     self.nodes = []
     # Setup the clouds' controller
     self.controller.generate_context('helloworld')
     self.state = self.S_INIT
Exemple #9
0
    def __init__(self, conf, **kwargs):
        BaseManager.__init__(self, conf)

        self.logger.debug("Entering MySQLServerManager initialization")
        self.controller.generate_context('mysql')
        self.controller.config_clouds({ "mem" : "512", "cpu" : "1" })
        self.config = Configuration(conf)
        self.logger.debug("Leaving MySQLServer initialization")

        # The unique id that is used to start the master/slave
        self.id = 0
Exemple #10
0
    def __init__(
            self,
            config_parser,  # config file
            **kwargs):  # anything you can't send in config_parser
        # (hopefully the new service won't need anything extra)
        BaseManager.__init__(self, config_parser)

        self.nodes = []
        # Setup the clouds' controller
        self.controller.generate_context('mapreduce')
        self.controller.config_clouds({"mem": "1024", "cpu": "1"})
Exemple #11
0
  def __init__(self, config_parser):
    BaseManager.__init__(self, config_parser)

    self.controller.generate_context('web')
    self.memcache = memcache.Client([config_parser.get('manager', 'MEMCACHE_ADDR')])

    from conpaas.services.webservers.manager import config
    config.memcache = self.memcache

    self.code_repo = config_parser.get('manager', 'CODE_REPO') 
    self.state_log = []
Exemple #12
0
    def __init__(self, config_parser):
        BaseManager.__init__(self, config_parser)

        self.controller.generate_context('web')
        self.memcache = memcache.Client(
            [config_parser.get('manager', 'MEMCACHE_ADDR')])

        from conpaas.services.webservers.manager import config
        config.memcache = self.memcache

        self.code_repo = config_parser.get('manager', 'CODE_REPO')
        self.state_log = []
Exemple #13
0
    def __init__(self, conf, **kwargs):
        BaseManager.__init__(self, conf)

        self.logger.debug("Entering MySQLServerManager initialization")

        # default value for mysql volume size
        self.mysql_volume_size = 1024

        #(genc): this is ignored at the moment
        # self.controller.config_clouds({"mem": "512", "cpu": "1"})
        self.root_pass = None
        self.config = Configuration(conf, self.logger)
        self.logger.debug("Leaving MySQLServer initialization")
Exemple #14
0
    def __init__(self, config_parser, **kwargs):
        """Initialize a BluePrint Manager. 

        'config_parser' represents the manager config file. 
        **kwargs holds anything that can't be sent in config_parser."""
        BaseManager.__init__(self, config_parser)

        self.nodes = []

        # Setup the clouds' controller
        self.controller.generate_context('blueprint')

        self.state = self.S_INIT
Exemple #15
0
    def __init__(self, config_parser, **kwargs):
        """Initialize a Selenium Manager. 

        'config_parser' represents the manager config file. 
        **kwargs holds anything that can't be sent in config_parser."""
        BaseManager.__init__(self, config_parser)

        self.nodes = []

        # Setup the clouds' controller
        self.controller.generate_context('selenium')

        self.hub_ip = None
Exemple #16
0
    def __init__(self, config_parser, **kwargs):
        """Initialize a HTCondor Manager. 

        'config_parser' represents the manager config file. 
        **kwargs holds anything that can't be sent in config_parser."""
        BaseManager.__init__(self, config_parser)

        self.nodes = []

        # Setup the clouds' controller
        self.controller.generate_context('htcondor')

        self.hub_ip = None
Exemple #17
0
    def __init__(self, config_parser, **kwargs):
        """Initialize a TaskFarm Manager. 

        'config_parser' represents the manager config file. 
        **kwargs holds anything that can't be sent in config_parser."""
        BaseManager.__init__(self, config_parser)

        self.nodes = []

        # Setup the clouds' controller
        self.controller.generate_context('taskfarm')

        self.state = self.S_INIT
        self.hub_ip = None
Exemple #18
0
    def __init__(self, config_parser, **kwargs):
        """Initialize a Generic Manager.

        'config_parser' represents the manager config file.
        **kwargs holds anything that can't be sent in config_parser."""
        BaseManager.__init__(self, config_parser)

        self.code_repo = config_parser.get('manager', 'CODE_REPO')

        if kwargs['reset_config']:
            self._create_initial_configuration()

        self.agents_info = []
        self.master_ip = None
Exemple #19
0
 def get_role_sninfo(self, role, cloud):
     if role == self.ROLE_MYSQL:
         return self.get_standard_sninfo_with_volume(
                     role, cloud, 'mysql-%(vm_id)s',
                     self.mysql_volume_size)
     else:
         return BaseManager.get_role_sninfo(self, role, cloud)
Exemple #20
0
    def __init__(self, config_parser, **kwargs):
        BaseManager.__init__(self, config_parser)

        # node lists
        self.nodes = []  # all nodes
        self.osdNodes = []  # only the OSD nodes
        self.mrcNodes = []  # onle the MRC nodes
        self.dirNodes = []  # only the DIR nodes

        # node counters
        self.dirCount = 0
        self.mrcCount = 0
        self.osdCount = 0

        # Setup the clouds' controller
        self.controller.generate_context('xtreemfs')
Exemple #21
0
    def __init__(self, config_parser, **kwargs):
        BaseManager.__init__(self, config_parser)

        # node lists
        self.nodes = []    # all nodes         
        self.osdNodes = [] # only the OSD nodes  
        self.mrcNodes = [] # onle the MRC nodes
        self.dirNodes = [] # only the DIR nodes   

        # node counters
        self.dirCount = 0
        self.mrcCount = 0
        self.osdCount = 0

        # Setup the clouds' controller
        self.controller.generate_context('xtreemfs')
Exemple #22
0
    def __init__(self, config_parser, **kwargs):
        """Initialize a HTC Manager. 

        'config_parser' represents the manager config file. 
        **kwargs holds anything that can't be sent in config_parser."""
        BaseManager.__init__(self, config_parser)

        self.nodes = []

        # Setup the clouds' controller
        self.controller.generate_context('htc')

        self.con = True
        self.hub_ip = None
        types = []
        costs = []
        limits = []
	
        types.append(self.config_parser.get('iaas', 'INST_TYPE'))
        cpt = self.config_parser.get('iaas', 'COST_PER_TIME')
        i = cpt.index('/')
        s = cpt.index('$')
        c = cpt[s+2:i]
        costs.append(float(c))
        limits.append(int(self.config_parser.get('iaas', 'MAX_VMS')))
	      

        for cloud in self.controller.get_clouds():
            types.append(self.config_parser.get(cloud.cloud_name, 'INST_TYPE'))
            cpt = self.config_parser.get(cloud.cloud_name, 'COST_PER_TIME')
            i = cpt.index('/')
            s = cpt.index('$')
            c = cpt[s+2:i]
            costs.append(float(c))
            limits.append(int(self.config_parser.get(cloud.cloud_name, 'MAX_VMS')))
        self.configuration = Configuration(types,costs,limits)
        self.logger.info(self.configuration.costs)
        self.logger.info(self.configuration.keys)
        self.logger.info(self.configuration.limits)
#        random.seed()
#        for t in types:
#            self.configuration.set_average(t, 2 * random.uniform(0,1))        
#        self.configuration.relevant_time_unit(20)
#        self.configuration.compute_throughput()
#        self.configuration.dynamic_configuration()
	self.pool={}
        self.files=[]
Exemple #23
0
    def get_role_logs(self, role):
        logs = BaseManager.get_role_logs(self, role)

        if role == self.ROLE_MYSQL:
            logs.extend([{'filename': 'mysql.log',
                          'description': 'MySQL log',
                          'path': '/var/cache/cpsagent/mysql.log'}]);

        return logs
Exemple #24
0
    def __init__(self, config_parser, **kwargs):
        """Initialize a Generic Manager.

        'config_parser' represents the manager config file.
        **kwargs holds anything that can't be sent in config_parser."""
        BaseManager.__init__(self, config_parser)
        self.controller.generate_context('generic')

        memcache_addr = config_parser.get('manager', 'MEMCACHE_ADDR')
        self.memcache = memcache.Client([memcache_addr])
        self.code_repo = config_parser.get('manager', 'CODE_REPO')

        self.state_log = []
        if kwargs['reset_config']:
            self._create_initial_configuration()

        self.nodes = []
        self.agents_info = []
        self.master_ip = None
        self._state_set(self.S_INIT)
Exemple #25
0
    def get_role_logs(self, role):
        logs = BaseManager.get_role_logs(self, role)

        logs.extend([{'filename': 'agent.out',
                      'description': 'agent output',
                      'path': '/root/agent.out'},
                     {'filename': 'agent.err',
                      'description': 'agent error',
                      'path': '/root/agent.err'}]);

        return logs
Exemple #26
0
    def get_role_logs(self, role, add_default=True):
        if add_default:
            logs = BaseManager.get_role_logs(self, role)
        else:
            logs = []

        if role == self.ROLE_BACKEND:
            logs.extend([{'filename': 'fpm-access.log',
                          'description': 'PHP access',
                          'path': '/var/cache/cpsagent/fpm-access.log'},
                         {'filename': 'fpm-error.log',
                          'description': 'PHP error',
                          'path': '/var/cache/cpsagent/fpm-error.log'}]);
        else:
            logs.extend(BasicWebserversManager.get_role_logs(self, role, False))

        return logs
Exemple #27
0
    def get_role_logs(self, role, add_default=True):
        if add_default:
            logs = BaseManager.get_role_logs(self, role)
        else:
            logs = []

        if role == self.ROLE_BACKEND:
            now = datetime.datetime.now()
            access_log = ('localhost_access_log.%d-%02d-%02d.txt' %
                              (now.year, now.month, now.day))

            logs.extend([{'filename': 'access_log.txt',
                          'description': 'Tomcat access',
                          'path': '/var/cache/cpsagent/tomcat_instance/logs/'
                                  '%s' % access_log},
                         {'filename': 'catalina.out',
                          'description': 'Tomcat output',
                          'path': '/var/cache/cpsagent/tomcat_instance/logs/'
                                  'catalina.out'}]);
        else:
            logs.extend(BasicWebserversManager.get_role_logs(self, role, False))

        return logs
Exemple #28
0
 def __init__(self, config_parser, **kwargs):
     BaseManager.__init__(self, config_parser)
     self.nodes = []
     # Setup the clouds' controller
     self.controller.generate_context('helloworld')
     self.state = self.S_INIT
Exemple #29
0
    def check_remove_nodes(self, node_roles):
        BaseManager.check_remove_nodes(self, node_roles)

        if node_roles.get(self.ROLE_MASTER, 0) > 0:
            raise Exception("Cannot remove the master node.")
Exemple #30
0
 def __init__(self, config_parser, **kwargs):
     BaseManager.__init__(self, config_parser)
     self.nodes = []
     # Setup the clouds' controller
     self.controller.generate_context('helloworld')
     self.state = self.S_INIT
Exemple #31
0
 def __init__(self, config_parser, **kwargs):
     BaseManager.__init__(self, config_parser)
     self.state = self.S_INIT