Exemple #1
0
    def kill_jormungandr(cls):
        logging.getLogger(__name__).debug("killing jormungandr")
        utils.launch_exec('sudo service apache2 status')
        ret, _ = utils.launch_exec('sudo service apache2 stop')
        utils.launch_exec('sudo service apache2 status')

        assert ret == 0, "cannot stop apache"
Exemple #2
0
    def read_data_by_dataset(cls, data_set):
        logging.getLogger(__name__).debug("reading data for {}".format(data_set.name))
        # we'll read all subdir
        data_path = utils.instance_data_path(data_set.name)

        data_dirs = [os.path.join(data_path, sub_dir_name)
                     for sub_dir_name in os.listdir(data_path)
                     if os.path.isdir(os.path.join(data_path, sub_dir_name))]

        logging.getLogger(__name__).debug("loading {}".format(data_dirs))
        utils.launch_exec("{tyr} load_data {data_set} {data_set_dir}"
                          .format(tyr=_tyr,
                                  data_set=data_set.name,
                                  data_set_dir=','.join(data_dirs)),
                          additional_env={'TYR_CONFIG_FILE': _tyr_config_file})
Exemple #3
0
    def read_data_by_dataset(cls, data_set):
        logging.getLogger(__name__).debug("reading data for {}".format(data_set.name))
        # we'll read all subdir
        data_path = utils.instance_data_path(data_set.name)

        data_dirs = [os.path.join(data_path, sub_dir_name)
                     for sub_dir_name in os.listdir(data_path)
                     if os.path.isdir(os.path.join(data_path, sub_dir_name))]

        logging.getLogger(__name__).debug("loading {}".format(data_dirs))
        utils.launch_exec("{tyr} load_data {data_set} {data_set_dir}"
                          .format(tyr=_tyr,
                                  data_set=data_set.name,
                                  data_set_dir=','.join(data_dirs)),
                          additional_env={'TYR_CONFIG_FILE': _tyr_config_file})
Exemple #4
0
    def pop_krakens(cls):
        """
        launch all the kraken services
        """
        for data_set in cls.data_sets:
            logging.getLogger(__name__).debug("launching the kraken {}".format(data_set.name))
            return_code, _ = utils.launch_exec('sudo {service} {kraken} start'.format(service=_kraken_wrapper, kraken=data_set.name))

            assert return_code == 0, "command failed"
Exemple #5
0
    def pop_krakens(cls):
        """
        launch all the kraken services
        """
        for data_set in cls.data_sets:
            logging.getLogger(__name__).debug("launching the kraken {}".format(data_set.name))
            return_code, _ = utils.launch_exec('sudo {service} {kraken} start'.format(service=_kraken_wrapper, kraken=data_set.name))

            assert return_code == 0, "command failed"
Exemple #6
0
    def kill_the_krakens(cls):
        for data_set in cls.data_sets:
            logging.getLogger(__name__).debug("killing the kraken {}".format(
                data_set.name))
            return_code, _ = utils.launch_exec(
                'sudo {service} {kraken} stop'.format(service=_kraken_wrapper,
                                                      kraken=data_set.name))

            assert return_code == 0, "command failed"
Exemple #7
0
    def pop_jormungandr(cls):
        """
        launch the front end
        """
        logging.getLogger(__name__).debug("running jormungandr")
        # jormungandr is launched with apache
        utils.launch_exec('sudo service apache2 status')
        ret, _ = utils.launch_exec('sudo service apache2 start')
        utils.launch_exec('sudo service apache2 status')

        assert ret == 0, "cannot start apache"

        # to have better errors, we check at the beginning that all is right
        for data_set in cls.data_sets:

            # we wait a bit for the kraken to be started
            try:
                Retrying(stop_max_delay=2 * 60 * 1000,  # we wait max 2 minutes for the kraken to be loaded
                         wait_fixed=100,
                         retry_on_result=lambda x: x != 'running') \
                    .call(kraken_status, data_set)
            except RetryError as e:
                assert False, "region {r} KO, status={s}".format(
                    r=data_set.name, s=e.last_attempt.value)
Exemple #8
0
    def pop_jormungandr(cls):
        """
        launch the front end
        """
        logging.getLogger(__name__).debug("running jormungandr")
        # jormungandr is launched with apache
        ret, _ = utils.launch_exec('sudo service apache2 start')

        assert ret == 0, "cannot start apache"

        # to have better errors, we check at the beginning that all is right
        for data_set in cls.data_sets:

            # we wait a bit for the kraken to be started
            try:
                Retrying(stop_max_delay=2 * 60 * 1000,  # we wait max 2 minutes for the kraken to be loaded
                         wait_fixed=100,
                         retry_on_result=lambda x: x != 'running') \
                    .call(kraken_status, data_set)
            except RetryError as e:
                assert False, "region {r} KO, status={s}".format(r=data_set.name, s=e.last_attempt.value)
Exemple #9
0
    def kill_jormungandr(cls):
        logging.getLogger(__name__).debug("killing jormungandr")
        ret, _ = utils.launch_exec('sudo service apache2 stop')

        assert ret == 0, "cannot stop apache"
Exemple #10
0
    def kill_the_krakens(cls):
        for data_set in cls.data_sets:
            logging.getLogger(__name__).debug("killing the kraken {}".format(data_set.name))
            return_code, _ = utils.launch_exec('sudo {service} {kraken} stop'.format(service=_kraken_wrapper, kraken=data_set.name))

            assert return_code == 0, "command failed"