Beispiel #1
0
    def __init__(
            self,
            config,
            label_name,
            zk_server,
            respool_path,
            auth_type='NOOP',
            auth_file='',
    ):
        """
        param config:             vcluster configuration
        param label_name:         Label of the virtual cluster
        param zk_server:          DNS address of the physical zookeeper server
        param respool_path:       The path of the resource pool

        type config:                dict
        type label_name:            str
        type zk_server:             str
        type respool:               str
        """
        self.config = config
        self.label_name = label_name
        self.zk_server = zk_server
        self.respool_path = respool_path

        self.peloton_helper = PelotonClientHelper(
            zk_server, respool_path, auth_type=auth_type, auth_file=auth_file)

        self.zookeeper = Zookeeper(
            self.label_name, self.config, self.peloton_helper
        )
        self.mesos_master = MesosMaster(
            self.label_name, self.config, self.peloton_helper
        )
        self.mesos_slave = MesosSlave(
            self.label_name, self.config, self.peloton_helper
        )

        # Optionally includes Peloton apps
        self.cassandra = Cassandra(
            self.label_name, self.config, self.peloton_helper
        )
        self.peloton = Peloton(
            self.label_name, self.config, self.peloton_helper
        )

        self.virtual_zookeeper = ""

        # vcluster is the config can be loaded for launching benchmark test
        # it can be dump into a file
        # the config filename starts with 'CONF_' and the label name
        self.vcluster_config = {
            "label_name": self.label_name,
            "config": self.config,
            "base_zk_server": self.zk_server,
            "base_respool_path": self.respool_path,
            "job_info": {},
        }
        self.config_name = "CONF_" + label_name
Beispiel #2
0
    def __init__(self, config, label_name, zk_server, respool_path,
                 peloton_apps_config_path):
        """
        param config:             vcluster configuration
        param label_name:         Label of the virtual cluster
        param zk_server:          DNS address of the physical zookeeper server
        param respool_path:       The path of the resource pool
        param peloton_app_config: The path to the peloton apps configs

        type config:                dict
        type label_name:            str
        type zk_server:             str
        type respool:               str
        type peloton_app_config:    str
        """
        self.config = config
        self.label_name = label_name
        self.zk_server = zk_server
        self.respool_path = respool_path
        self.peloton_apps_config_path = peloton_apps_config_path

        self.peloton_helper = PelotonClientHelper(zk_server, respool_path)

        self.zookeeper = Zookeeper(self.label_name, self.config,
                                   self.peloton_helper)
        self.mesos_master = MesosMaster(self.label_name, self.config,
                                        self.peloton_helper)
        self.mesos_slave = MesosSlave(self.label_name, self.config,
                                      self.peloton_helper)

        # Optionally includes Peloton apps
        self.cassandra = Cassandra(self.label_name, self.config,
                                   self.peloton_helper)
        self.peloton = Peloton(self.label_name, self.config,
                               self.peloton_helper)

        self.virtual_zookeeper = ''

        # vcluster is the config can be loaded for launching benchmark test
        # it can be dump into a file
        # the config filename starts with 'CONF_' and the label name
        self.vcluster_config = {
            'label_name': self.label_name,
            'config': self.config,
            'base_zk_server': self.zk_server,
            'base_respool_path': self.respool_path,
            'job_info': {}
        }
        self.config_name = 'CONF_' + label_name