Skip to content

Conversation

@rawwar
Copy link
Contributor

@rawwar rawwar commented Jun 15, 2025

Using debugpy to run airflow components so that we can use IDE's as Vscode to attach to the component to debug.

Refer to contributing-docs/20_debugging_airflow_components.rst for debug guide

Ports for components are as follows:

Scheduler**: 50231
DAG Processor**: 50232
Triggerer**: 50233
API Server**: 50234
Celery Worker**: 50235
Edge Worker**: 50236
Web Server**: 50237

Also added setup_vscode.py which will generate debug configuration in .vscode/launch.json.

As of now, I added support only for debugpy with VS code. I haven't used PyCharm much and tried to make it work with pydevd-pycharm. But, unable to.

EDIT: Used cursor to generate the documentation. but, I reviewed it twice removing most of the unnecessary stuff.

@rawwar rawwar requested review from jason810496 and jscheffl June 15, 2025 16:17
Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty cool!

Can you add something about this into the Contribution docs as well?
...and would it make sense adding this to breeze CLI as command line instead of ENV?

@rawwar
Copy link
Contributor Author

rawwar commented Jun 15, 2025

Pretty cool!

Can you add something about this into the Contribution docs as well? ...and would it make sense adding this to breeze CLI as command line instead of ENV?

Yes. I'm adding CLI support as well. And, I'll update docs.

@potiuk
Copy link
Member

potiuk commented Jun 15, 2025

Pretty cool!

Can you add something about this into the Contribution docs as well? ...and would it make sense adding this to breeze CLI as command line instead of ENV?

Very much agree with Jens here .... and that's nice. I usually use intelliJ's debug server, there, it works a bit differently (you need to add debug code to connect to server running in IntelliJ) - but maybe we could do something similar.

@rawwar
Copy link
Contributor Author

rawwar commented Jun 15, 2025

Very much agree with Jens here .... and that's nice. I usually use intelliJ's debug server, there, it works a bit differently (you need to add debug code to connect to server running in IntelliJ) - but maybe we could do something similar.

I just looked into how to do this in PyCharm and yeah, its different. No option to directly connect to debugpy. But, I'll look into it and add something similar

@rawwar rawwar changed the title conditional use of debugpy to run airflow components via breeze use of debugpy to run airflow components via breeze Jun 16, 2025
@rawwar rawwar marked this pull request as draft July 20, 2025 05:32
@potiuk
Copy link
Member

potiuk commented Jul 20, 2025

Let's get it in, I can add Pycharm debugging as follow up :)

@potiuk
Copy link
Member

potiuk commented Jul 20, 2025

BTW. We will need a section in the contributing docs describing it (including your examples how to configure it in vscode :)

@rawwar
Copy link
Contributor Author

rawwar commented Jul 20, 2025

BTW. We will need a section in the contributing docs describing it (including your examples how to configure it in vscode :)

Yeah. I've been struggling on how to make this work with pycharm. With VSCode, I was done almost 2 weeks ago. Been trying to figure out how remote debbing works with pycharm. Thank you! I'll work on updating docs and get this merged first

@rawwar rawwar marked this pull request as ready for review July 22, 2025 11:17
@rawwar rawwar force-pushed the kalyan/breeze/debug_support branch from 90cdf5a to a0dea54 Compare July 22, 2025 11:31
@rawwar rawwar requested a review from jscheffl July 22, 2025 11:41
@potiuk potiuk merged commit 55d648e into apache:main Jul 24, 2025
102 checks passed
potiuk added a commit to potiuk/airflow that referenced this pull request Aug 2, 2025
When debugger option has been added to breeze in apache#51763 - the ports were added
to base-port.yml, but the environment variables were only set when debugging is
enabled. This hower caused warnings that the variables are not set and
defaulting them to empty string when no debug components were used.

Instead - we moved the debugger ports to separate compose file and
only use the compose file when debug components are used.
potiuk added a commit to potiuk/airflow that referenced this pull request Aug 2, 2025
When debugger option has been added to breeze in apache#51763 - the ports were added
to base-port.yml, but the environment variables were only set when debugging is
enabled. This hower caused warnings that the variables are not set and
defaulting them to empty string when no debug components were used.

Instead - we moved the debugger ports to separate compose file and
only use the compose file when debug components are used.
potiuk added a commit that referenced this pull request Aug 2, 2025
When debugger option has been added to breeze in #51763 - the ports were added
to base-port.yml, but the environment variables were only set when debugging is
enabled. This hower caused warnings that the variables are not set and
defaulting them to empty string when no debug components were used.

Instead - we moved the debugger ports to separate compose file and
only use the compose file when debug components are used.
github-actions bot pushed a commit that referenced this pull request Aug 2, 2025
#54051)

When debugger option has been added to breeze in #51763 - the ports were added
to base-port.yml, but the environment variables were only set when debugging is
enabled. This hower caused warnings that the variables are not set and
defaulting them to empty string when no debug components were used.

Instead - we moved the debugger ports to separate compose file and
only use the compose file when debug components are used.
(cherry picked from commit 939700f)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
potiuk added a commit that referenced this pull request Aug 2, 2025
#54051) (#54053)

When debugger option has been added to breeze in #51763 - the ports were added
to base-port.yml, but the environment variables were only set when debugging is
enabled. This hower caused warnings that the variables are not set and
defaulting them to empty string when no debug components were used.

Instead - we moved the debugger ports to separate compose file and
only use the compose file when debug components are used.
(cherry picked from commit 939700f)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
potiuk pushed a commit that referenced this pull request Aug 3, 2025
* debug support in breeze

* fix celery env var

* Add debug options for Airflow components and update related constants

* Add debug options for Airflow components and update related constants

* refactor

* update documentation and add setup_vscode

* Remove section on overriding default debug ports in VSCode setup documentation

* fix base-ports

* fix base-ports

* update docs

* add webserver details in docs

* update docs

* update docs

* update docs

(cherry picked from commit 55d648e)
@ashb ashb added this to the Airflow 3.0.4 milestone Aug 4, 2025
ferruzzi pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Aug 7, 2025
)

When debugger option has been added to breeze in apache#51763 - the ports were added
to base-port.yml, but the environment variables were only set when debugging is
enabled. This hower caused warnings that the variables are not set and
defaulting them to empty string when no debug components were used.

Instead - we moved the debugger ports to separate compose file and
only use the compose file when debug components are used.
fweilun pushed a commit to fweilun/airflow that referenced this pull request Aug 11, 2025
)

When debugger option has been added to breeze in apache#51763 - the ports were added
to base-port.yml, but the environment variables were only set when debugging is
enabled. This hower caused warnings that the variables are not set and
defaulting them to empty string when no debug components were used.

Instead - we moved the debugger ports to separate compose file and
only use the compose file when debug components are used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants