Exemplo n.º 1
0
    def save_results(self, comb, hosts):
        logger.info("--Starting dowloading the results")

        get_results(comb=comb,
                    hosts=hosts,
                    remote_result_files=['/tmp/results/*'],
                    local_result_dir=self.configs['exp_env']['results_dir'])
Exemplo n.º 2
0
    def save_results(self, comb, nodes):
        logger.info('----------------------------------')
        logger.info('5. Starting downloading the results')

        get_results(comb=comb,
                    hosts=nodes,
                    remote_result_files=['/tmp/results/*'],
                    local_result_dir=self.configs['exp_env']['results_dir'])
Exemplo n.º 3
0
    def save_results(self, comb):
        logger.info("----------------------------------")
        logger.info("6. Starting dowloading the results")

        configurator = k8s_resources_configurator()
        results_nodes = configurator.get_k8s_resources_name(resource='node',
                                                            label_selectors='service_g5k=fmke_client')

        get_results(comb=comb,
                    hosts=results_nodes,
                    remote_result_files=['/tmp/results/'],
                    local_result_dir=self.configs['exp_env']['results_dir'])

        logger.info("Finish dowloading the results")
    def run_workflow(self, comb, sweeper):
        """Run user-defined steps of an experiment scenario and save the result.
        The input of this run is one combination of parameters from the combination queue.
        """

        comb_ok = False
        try:
            logger.info('Performing combination: ' + slugify(comb))
            # write your code here to perform a run of your experiment
            # you can get the current combination of parameters
            # (specified in the config file exp_setting.yaml)
            # and use them in this run of your experiment
            # For example, you can get the parameters out of the combination
            # and then use them.
            message = "parameter_1: %s, parameter_2: %s, parameter_3: %s, parameter_4: %s, parameter_5: %s" % (
                comb['parameter_1'], comb['parameter_2'], comb['parameter_3'],
                comb['parameter_4'], comb['parameter_5'])
            cmd = "echo %s > /tmp/result_$(hostname).txt" % message
            execute_cmd(cmd, self.hosts)

            # then download the remote_result_files on the remote hosts and save it to local_result_dir
            get_results(
                comb=comb,
                hosts=self.hosts,
                remote_result_files=['/tmp/result_*.txt'],
                local_result_dir=self.configs['exp_env']['results_dir'])
            comb_ok = True
        except ExecuteCommandException as e:
            comb_ok = False
        finally:
            if comb_ok:
                sweeper.done(comb)
                logger.info('Finish combination: %s' % slugify(comb))
            else:
                sweeper.cancel(comb)
                logger.warning(slugify(comb) + ' is canceled')
            logger.info('%s combinations remaining\n' %
                        len(sweeper.get_remaining()))
        return sweeper
Exemplo n.º 5
0
    def save_results(self, comb, pop_time, pop_errors, nodes=list()):
        logger.info('----------------------------------')
        logger.info('6. Starting dowloading the results')
        if nodes:
            comb_dir = get_results(
                comb=comb,
                hosts=nodes,
                remote_result_files=['/tmp/results/*'],
                local_result_dir=self.configs['exp_env']['results_dir'])

        with open(os.path.join(comb_dir, 'pop_time.txt'), 'w') as f:
            f.write(pop_time)
        if pop_errors:
            with open(os.path.join(comb_dir, 'pop_error.txt'), 'w') as f:
                f.write(str(pop_errors))

        logger.info('Finish dowloading the results')