コード例 #1
0
    def __init__(self, run_dir, params_dict, globals):

        # get directory pathname for module
        self.dirpath = os.path.dirname(os.path.abspath(__file__))

        # get a unique id and tag
        self.id = server_fio.instance_counter
        self.tag = 'server-fio' + str(self.id)
        server_fio.instance_counter += 1

        # load defaults from file
        yaml_file = self.dirpath + '/defaults.yaml'
        self.params = util_functions.dict_from_file(yaml_file)

        # update params
        labels_path = ['servers', 'server_fio']
        new_params = util_functions.get_modparams(params_dict, labels_path)
        util_functions.deep_update(self.params, new_params)
        util_functions.update_modparams(self.params, globals)
        self.params['dir'] = run_dir + '/' + self.tag
        self.params['name'] = self.tag
        self.params['podlabel'] = "name=" + self.tag

        # parameters clients need in order to use this object
        self.returnparams = {}
        self.returnparams['datadir'] = self.params['datadir']
        self.returnparams['serverlist'] = []  # populated at start
コード例 #2
0
    def __init__(self, run_dir, params_dict, globals):

        # get directory pathname for module
        self.dirpath = os.path.dirname(os.path.abspath(__file__))

        # get a unique id and tag
        self.id = fio_iops.instance_counter
        self.tag = 'calm-fioiops-' + str(self.id)
        fio_iops.instance_counter += 1

        # load defaults from file
        yaml_file = self.dirpath + '/defaults.yaml'
        self.params = util_functions.dict_from_file(yaml_file)

        # update params; this will override some of the defaults
        labels_path = ['calm', 'fio_iops']
        new_params = util_functions.get_modparams(params_dict, labels_path)
        util_functions.deep_update(self.params, new_params)
        util_functions.update_modparams(self.params, globals)
        self.params['dir'] = run_dir + '/' + self.tag
        self.params['name'] = self.tag
        self.params['podlabel'] = "name=" + self.tag

        logger.debug(f'parameters: {self.params}')

        # create directory for self
        util_functions.create_dir(self.params['dir'])

        # create a handle for the fio server object
        #
        self.serverhandle = server_fio.server_fio \
            (self.params['dir'], params_dict, globals)

        #
        # derive parameters for fio server for later use
        #

        # pass on basic parameters
        self.serverparams = {
            'nservers': self.params['ninstances'],
            'fio_image': self.params['fio_image']
        }

        # derive space requirements
        if 'pvcsize_gb' in self.params:
            self.serverparams['pvcsize_gb'] = self.params['pvcsize_gb']
        else:
            pvcsize_gb = self.params['numjobs'] * self.params['filesize_gb']
            self.serverparams['pvcsize_gb'] = int (pvcsize_gb * \
                self.params['scalefactor'] + self.params['extraspace_gb'])

        # pass on storageclass, if specified
        if 'storageclass' in self.params:
            self.serverparams['storageclass'] = self.params['storageclass']

        # pass on nodeselector, if specified
        if 'server_nodeselector' in self.params:
            self.serverparams['nodeselector'] = \
                self.params['server_nodeselector']
コード例 #3
0
ファイル: sysstat.py プロジェクト: shekharberry/kubuculum
    def __init__(self, run_dir, params_dict, globals):

        # get directory pathname for module
        self.dirpath = os.path.dirname(os.path.abspath(__file__))

        # get a unique id and tag
        self.id = sysstat.instance_counter
        self.tag = 'sysstat-' + str(self.id)
        sysstat.instance_counter += 1

        # load defaults from file
        yaml_file = self.dirpath + '/defaults.yaml'
        self.params = util_functions.dict_from_file(yaml_file)

        # update params
        labels_path = ['statistics', 'sysstat']
        new_params = util_functions.get_modparams(params_dict, labels_path)
        util_functions.deep_update(self.params, new_params)
        util_functions.update_modparams(self.params, globals)
        self.params['dir'] = run_dir + '/' + self.tag
        self.params['name'] = self.tag
        self.params['podlabel'] = "name=" + self.tag