Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Task execution interface (AIP-72) in Airflow 3 in EdgeExecutor #44982

Merged

Conversation

jscheffl
Copy link
Contributor

The introduction of AIP-72 and removal of AIP-44 in main broke the EdgeExecutor/EdgeWorker on main.

This PR makes it working again as the second executor supporting AIP-72 for the first "edge cases" and check.

Note: Two commits, first one is an extension in the Executor API which is needed to ship a session context to EdgeExecutor not to break DB lock during scheduling as EdgeExecutor need to write to DB. Let me know if I should separate into two PRs... (as of dev rules core and provider changes bundled here)

@ashb Would very much favor a review from you here if the design anticipated for AIP-72 is correctly understood how integrated.

If you want to test with Airflow 3, use:
breeze start-airflow --python 3.12 --load-example-dags --backend postgres --executor EdgeExecutor --answer y

In Airflow 3 the "example_bash_operator" is working, not all other DAGs.

If somebody wants to test Airflow 2.10 as regression, this can be made via:
breeze down && rm dist/* && breeze release-management prepare-provider-packages --include-not-ready-providers edge && breeze start-airflow --python 3.12 --load-example-dags --backend postgres --executor EdgeExecutor --answer y --use-airflow-version 2.10.4 --use-packages-from-dist

FYI @AutomationDev85

@boring-cyborg boring-cyborg bot added area:Executors-core LocalExecutor & SequentialExecutor area:providers area:Scheduler including HA (high availability) scheduler kind:documentation provider:edge Edge Executor / Worker (AIP-69) labels Dec 17, 2024
@jscheffl jscheffl added the AIP-69 Edge Executor label Dec 17, 2024
@jscheffl jscheffl requested review from Copilot, kaxil and ashb and removed request for ashb, XD-DENG, pierrejeambrun, hussein-awala, o-nikolas and kaxil December 17, 2024 10:11
@jscheffl jscheffl changed the title Feature/add airflow 2 aip 72 support to edge Support Task execution interface (AIP-72) in Airflow 3 in EdgeExecutor Dec 17, 2024

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 16 changed files in this pull request and generated no comments.

Files not reviewed (11)
  • docs/apache-airflow-providers-edge/edge_executor.rst: Language not supported
  • providers/src/airflow/providers/edge/CHANGELOG.rst: Language not supported
  • airflow/jobs/scheduler_job_runner.py: Evaluated as low risk
  • providers/src/airflow/providers/edge/worker_api/routes/jobs.py: Evaluated as low risk
  • airflow/executors/base_executor.py: Evaluated as low risk
  • airflow/executors/local_executor.py: Evaluated as low risk
  • providers/tests/edge/plugins/test_edge_executor_plugin.py: Evaluated as low risk
  • providers/src/airflow/providers/edge/worker_api/datamodels.py: Evaluated as low risk
  • providers/src/airflow/providers/edge/init.py: Evaluated as low risk
  • providers/src/airflow/providers/edge/provider.yaml: Evaluated as low risk
  • providers/src/airflow/providers/edge/worker_api/routes/_v2_compat.py: Evaluated as low risk
Comments suppressed due to low confidence (2)

providers/src/airflow/providers/edge/executors/edge_executor.py:111

  • [nitpick] The comment should be updated to reflect that this method is used for executing tasks asynchronously in both Airflow 2.10 and Airflow 3.0.
"""Execute asynchronously. Airflow 2.10 entry point to execute a task."""

providers/src/airflow/providers/edge/executors/edge_executor.py:133

  • Ensure that the new queue_workload method is covered by tests to validate its behavior with the new workload type.
def queue_workload(
@jscheffl jscheffl added the area:task-execution-interface-aip72 AIP-72: Task Execution Interface (TEI) aka Task SDK label Dec 17, 2024
@jscheffl jscheffl force-pushed the feature/add-airflow-2-aip-72-support-to-edge branch 2 times, most recently from 5b6d05a to 2e5e993 Compare December 19, 2024 09:23
@jscheffl jscheffl requested a review from amoghrajesh December 23, 2024 13:45
@jscheffl jscheffl force-pushed the feature/add-airflow-2-aip-72-support-to-edge branch from 851b897 to 6316d14 Compare December 26, 2024 12:14
@jscheffl jscheffl force-pushed the feature/add-airflow-2-aip-72-support-to-edge branch 2 times, most recently from 2e771b9 to 0156a2f Compare December 29, 2024 22:22
@jscheffl jscheffl force-pushed the feature/add-airflow-2-aip-72-support-to-edge branch from 0156a2f to 3910484 Compare January 4, 2025 16:40
Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

Looks straight forward enough :)

@jscheffl jscheffl force-pushed the feature/add-airflow-2-aip-72-support-to-edge branch from 3910484 to f11e1b8 Compare January 7, 2025 21:30
@jscheffl jscheffl merged commit 0399381 into apache:main Jan 7, 2025
62 checks passed
agupta01 pushed a commit to agupta01/airflow that referenced this pull request Jan 13, 2025
apache#44982)

* Extend the queue_workload() call with an ORM session

* Support Task execution interface (AIP-72) in Airflow 3

* Fix CI errors, typos and static checks

* Fix pytest backcompat

* Apply Copilot feedback from other PR

* Review Feedback

* Add missing session to CLI call

* Review Feedback
HariGS-DB pushed a commit to HariGS-DB/airflow that referenced this pull request Jan 16, 2025
apache#44982)

* Extend the queue_workload() call with an ORM session

* Support Task execution interface (AIP-72) in Airflow 3

* Fix CI errors, typos and static checks

* Fix pytest backcompat

* Apply Copilot feedback from other PR

* Review Feedback

* Add missing session to CLI call

* Review Feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AIP-69 Edge Executor area:Executors-core LocalExecutor & SequentialExecutor area:providers area:Scheduler including HA (high availability) scheduler area:task-execution-interface-aip72 AIP-72: Task Execution Interface (TEI) aka Task SDK kind:documentation provider:edge Edge Executor / Worker (AIP-69)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants