def __dag_run(self): selector = InstallSelector(self.__config, self.__config_release) processor = MultiThreadProcessor() # processor = SequentialProcessor() executor = InstallExecutor(self.__config, self.__config_version, self.__config_release) dag_run(self.__dag, selector=selector, processor=processor, executor=executor)
def test_dag_run_multi_thread_processor_with_exception(i, dag_callable_with_exception): with pytest.raises(VertexExecutionError): dag_run(dag_callable_with_exception[0], selector=ShuffleSelector(), processor=MultiThreadProcessor(), executor=CallableExecutor()) check_callable_with_exception(dag_callable_with_exception)
def test_dag_run_sequential_processor_with_exception(i, dag_callable_with_exception): with pytest.raises(VertexExecutionError): dag_run(dag_callable_with_exception[0], selector=ShuffleSelector(), processor=SequentialProcessor(), executor=CallableExecutor()) check_callable_with_exception(dag_callable_with_exception)
def run(self): sorted_pkgs = dag_run(self.__dag) software_root = self.__config_version.config['software_root'] release_version = self.__config_version.config['version'] env = Env() env.clean() env.set_release(software_root, release_version) global_env = self.__config_release.get('setting', {}).get('global_env', {}) new_global_env = {} for k, v in global_env.items(): new_global_env[k] = v.format(**self.__config_version.config) env.set_global(new_global_env) path_usage = self.__config_release.get('setting', {}).get('path_usage', {}) for pkg in sorted_pkgs: pkg_info = self.__pkg_mgr.package_info(pkg) env.set_package(path_usage, pkg_info) env_change = env.env_change() _logger.info('From software root: {0}'.format(software_root)) _logger.info('Using version: {0}'.format(release_version)) _logger.info('Current platform: {0}'.format( self.__config_version.config['platform'])) return env_change
def run(self): sorted_pkgs = dag_run(self.__dag) env = Env() env.clean() env.set_release(self.__config_version.config['release_root'], self.__config_version.config['version']) for pkg in sorted_pkgs: if pkg not in self.__config_release.config['attribute']: continue path_mode = self.__config_release.config['main'].get('path_mode', {}) pkg_config = { 'name': pkg, 'package': self.__config_release.config['package'].get(pkg, {}), 'attribute': self.__config_release.config['attribute'].get(pkg, {}), 'format': self.__exe_config[pkg], } env.set_package(path_mode, pkg_config) return env.final_all_env()
def test_dag_run_multi_thread_processor(i, dag_callable): vertices_sorted = dag_run(dag_callable[0], selector=ShuffleSelector(), processor=MultiThreadProcessor(), executor=CallableExecutor()) check_callable(vertices_sorted, dag_callable)
def test_dag_run_sequential_processor(i, dag_callable): vertices_sorted = dag_run(dag_callable[0], selector=ShuffleSelector(), processor=SequentialProcessor(), executor=CallableExecutor()) check_callable(vertices_sorted, dag_callable)
def test_topo_sort_by_shuffle_selector(i, dag): vertices_sorted = dag_run(dag, selector=ShuffleSelector()) check_sorted_vertices(vertices_sorted, dag)
def test_topo_sort_by_random_selector(i, dag): vertices_sorted = dag_run(dag, selector=RandomSelector()) check_sorted_vertices(vertices_sorted, dag)
def test_topo_sort_by_full_selector(i, dag): vertices_sorted = dag_run(dag, selector=FullSelector()) check_sorted_vertices(vertices_sorted, dag)