需要为docker容器内的气流管道设置PyCharm调试器

问题描述 投票:0回答:1

请你帮我解决这个问题:我有当前代码的makefile:

.PHONY: run

run:
    docker build --rm -t local-airflow .
    docker-compose up --remove-orphans postgres webserver

在网络服务器容器中,我有我的 DAG 的代码。 我如何为 web 服务器容器内的运行/调试代码设置 python 调试器。 目前我以这个链接为例:

https://medium.com/@andrewhharmon/apache-airflow-using-pycharm-and-docker-for-remote-debugging-b2d1edf83d9d

但是我有这个错误:

/usr/local/bin/docker-compose -f /Users/{user}/Documents/{project_name}/docker-compose.yml -f /Users/{user}/Library/Caches/JetBrains/PyCharm2020.2/tmp/docker-compose.override.165.yml up --exit-code-from webserver --abort-on-container-exit webserver
Starting {project_name}_airflow_postgres_1 ... 
Recreating {project_name}_airflow_webserver_1 ... 
Attaching to {project_name}_airflow_webserver_1
webserver_1  | /usr/local/lib/python3.6/site-packages/airflow/configuration.py:226: FutureWarning: The task_runner setting in [core] has the old default value of 'BashTaskRunner'. This value has been changed to 'StandardTaskRunner' in the running config, but please update your config before Apache Airflow 2.0.
webserver_1  |   FutureWarning
webserver_1  | /usr/local/lib/python3.6/site-packages/airflow/configuration.py:606: DeprecationWarning: Specifying both AIRFLOW_HOME environment variable and airflow_home in the config file is deprecated. Please use only the AIRFLOW_HOME environment variable and remove the config file entry.
webserver_1  |   warnings.warn(msg, category=DeprecationWarning)
webserver_1  | /usr/local/lib/python3.6/site-packages/airflow/config_templates/airflow_local_settings.py:65: DeprecationWarning: The elasticsearch_host option in [elasticsearch] has been renamed to host - the old setting has been used, but please update your config.
webserver_1  |   ELASTICSEARCH_HOST = conf.get('elasticsearch', 'HOST')
webserver_1  | /usr/local/lib/python3.6/site-packages/airflow/config_templates/airflow_local_settings.py:67: DeprecationWarning: The elasticsearch_log_id_template option in [elasticsearch] has been renamed to log_id_template - the old setting has been used, but please update your config.
webserver_1  |   ELASTICSEARCH_LOG_ID_TEMPLATE = conf.get('elasticsearch', 'LOG_ID_TEMPLATE')
webserver_1  | /usr/local/lib/python3.6/site-packages/airflow/config_templates/airflow_local_settings.py:69: DeprecationWarning: The elasticsearch_end_of_log_mark option in [elasticsearch] has been renamed to end_of_log_mark - the old setting has been used, but please update your config.
webserver_1  |   ELASTICSEARCH_END_OF_LOG_MARK = conf.get('elasticsearch', 'END_OF_LOG_MARK')
webserver_1  | [2020-10-27 10:38:57,849] {settings.py:252} INFO - settings.configure_orm(): Using pool settings. pool_size=5, max_overflow=10, pool_recycle=1800, pid=1
webserver_1  | /usr/local/lib/python3.6/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
webserver_1  |   """)
webserver_1  | usage: airflow [-h]
webserver_1  |                {backfill,list_dag_runs,list_tasks,clear,pause,unpause,trigger_dag,delete_dag,show_dag,pool,variables,kerberos,render,run,initdb,list_dags,dag_state,task_failed_deps,task_state,serve_logs,test,webserver,resetdb,upgradedb,scheduler,worker,flower,version,connections,create_user,delete_user,list_users,sync_perm,next_execution,rotate_fernet_key}
webserver_1  |                ...
webserver_1  | airflow: error: the following arguments are required: subcommand
webserver_1  | Aborting on container exit...
Stopping {project_name}_airflow_webserver_1   ... 
Stopping {project_name}_airflow_webserver_1   ... done
Process finished with exit code 2

我使用此配置进行 python 调试:

谢谢。

python docker debugging pycharm airflow
1个回答
0
投票

解决了吗?有类似的问题

© www.soinside.com 2019 - 2024. All rights reserved.