コード例 #1
0
ファイル: info_command.py プロジェクト: xjqbest/airflow
 def info(self, console: AirflowConsole):
     table = SimpleTable(title="Providers info")
     table.add_column()
     table.add_column(width=150)
     for _, provider in ProvidersManager().providers.values():
         table.add_row(provider['package-name'], provider['versions'][0])
     console.print(table)
コード例 #2
0
    def display_recursive(
        prefix: List[str],
        commands: Iterable[Union[GroupCommand, ActionCommand]],
        help_msg: Optional[str] = None,
    ):
        actions: List[ActionCommand]
        groups: List[GroupCommand]
        actions: List[ActionCommand] = []
        groups: List[GroupCommand] = []
        for command in commands:
            if isinstance(command, GroupCommand):
                groups.append(command)
            else:
                actions.append(command)

        console = AirflowConsole()
        if actions:
            table = SimpleTable(title=help_msg or "Miscellaneous commands")
            table.add_column(width=40)
            table.add_column()
            for action_command in sorted(actions, key=lambda d: d.name):
                table.add_row(" ".join([*prefix, action_command.name]),
                              action_command.help)
            console.print(table)

        if groups:
            for group_command in sorted(groups, key=lambda d: d.name):
                group_prefix = [*prefix, group_command.name]
                display_recursive(group_prefix, group_command.subcommands,
                                  group_command.help)
コード例 #3
0
    def display_recursive(
        prefix: List[str],
        commands: Iterable[Union[GroupCommand, ActionCommand]],
        help_msg: Optional[str] = None,
    ):
        actions: List[ActionCommand]
        groups: List[GroupCommand]
        actions_iter, groups_iter = partition(
            lambda x: isinstance(x, GroupCommand), commands)
        actions, groups = list(actions_iter), list(groups_iter)

        console = Console()
        if actions:
            table = SimpleTable(title=help_msg or "Miscellaneous commands")
            table.add_column(width=40)
            table.add_column()
            for action_command in sorted(actions, key=lambda d: d.name):
                table.add_row(" ".join([*prefix, action_command.name]),
                              action_command.help)
            console.print(table)

        if groups:
            for group_command in sorted(groups, key=lambda d: d.name):
                group_prefix = [*prefix, group_command.name]
                display_recursive(group_prefix, group_command.subcommands,
                                  group_command.help)
コード例 #4
0
def dump_plugins(args):
    """Dump plugins information"""
    plugins_manager.ensure_plugins_loaded()
    plugins_manager.integrate_macros_plugins()
    plugins_manager.integrate_executor_plugins()
    plugins_manager.initialize_extra_operators_links_plugins()
    plugins_manager.initialize_web_ui_plugins()
    if not plugins_manager.plugins:
        print("No plugins loaded")
        return

    console = Console()
    console.print("[bold yellow]SUMMARY:[/bold yellow]")
    console.print(
        f"[bold green]Plugins directory[/bold green]: {conf.get('core', 'plugins_folder')}\n",
        highlight=False)
    console.print(
        f"[bold green]Loaded plugins[/bold green]: {len(plugins_manager.plugins)}\n",
        highlight=False)

    for attr_name in PLUGINS_MANAGER_ATTRIBUTES_TO_DUMP:
        attr_value: Optional[List[Any]] = getattr(plugins_manager, attr_name)
        if not attr_value:
            continue
        table = SimpleTable(title=attr_name.capitalize().replace("_", " "))
        table.add_column(width=100)
        for item in attr_value:  # pylint: disable=not-an-iterable
            table.add_row(f"- {_get_name(item)}", )
        console.print(table)

    console.print("[bold yellow]DETAILED INFO:[/bold yellow]")
    for plugin in plugins_manager.plugins:
        table = SimpleTable(title=plugin.name)
        for attr_name in PLUGINS_ATTRIBUTES_TO_DUMP:
            value = getattr(plugin, attr_name)
            if not value:
                continue
            table.add_row(attr_name.capitalize().replace("_", " "),
                          _join_plugins_names(value))
        console.print(table)
コード例 #5
0
ファイル: info_command.py プロジェクト: xjqbest/airflow
 def info(self, console: AirflowConsole):
     table = SimpleTable(title="Paths info")
     table.add_column()
     table.add_column(width=150)
     table.add_row("airflow_home", self.airflow_home)
     table.add_row("system_path", os.pathsep.join(self.system_path))
     table.add_row("python_path", os.pathsep.join(self.python_path))
     table.add_row("airflow_on_path", str(self.airflow_on_path))
     console.print(table)
コード例 #6
0
ファイル: info_command.py プロジェクト: xjqbest/airflow
 def info(self, console: AirflowConsole):
     table = SimpleTable(title="Tools info")
     table.add_column()
     table.add_column(width=150)
     table.add_row("git", self.git_version)
     table.add_row("ssh", self.ssh_version)
     table.add_row("kubectl", self.kubectl_version)
     table.add_row("gcloud", self.gcloud_version)
     table.add_row("cloud_sql_proxy", self.cloud_sql_proxy_version)
     table.add_row("mysql", self.mysql_version)
     table.add_row("sqlite3", self.sqlite3_version)
     table.add_row("psql", self.psql_version)
     console.print(table)
コード例 #7
0
ファイル: info_command.py プロジェクト: xjqbest/airflow
 def info(self, console: AirflowConsole):
     table = SimpleTable(title="Config info")
     table.add_column()
     table.add_column(width=150)
     table.add_row("executor", self.executor)
     table.add_row("task_logging_handler", self.task_logging_handler)
     table.add_row("sql_alchemy_conn", self.sql_alchemy_conn)
     table.add_row("dags_folder", self.dags_folder)
     table.add_row("plugins_folder", self.plugins_folder)
     table.add_row("base_log_folder", self.base_log_folder)
     console.print(table)
コード例 #8
0
ファイル: info_command.py プロジェクト: xjqbest/airflow
 def info(self, console: AirflowConsole):
     table = SimpleTable(title="System info")
     table.add_column()
     table.add_column(width=100)
     table.add_row("OS", self.operating_system or "NOT AVAILABLE")
     table.add_row("architecture", self.arch or "NOT AVAILABLE")
     table.add_row("uname", str(self.uname))
     table.add_row("locale", str(self.locale))
     table.add_row("python_version", self.python_version)
     table.add_row("python_location", self.python_location)
     console.print(table)