-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Introduce generic Callbacks to support running callbacks on executors #54796
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
Conversation
Introduce a generic Callback model that can be used for Deadline callbacks for now and hopefully the on_*_callbacks for Dags and Tasks in the future.
|
I've been working on making Deadline callbacks work on the executor in addition to the Triggerer. That means introducing a new Workload type for the executor. I didn't want to tie it specifically to Deadlines and realized it would be a good idea to introduce generic Callbacks that the new workload can reference. This is an initial PR for adding a new Callback table and refactoring existing Deadline callbacks that run on the Triggerer to use these instead: Ideally, once AIP-92 is in progress, these callbacks can be used or all the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've highlighted the areas of this PR I want to focus on and get everyone working on AIP-92 to agree on. Everything else is just refactoring to make existing functionality work. I'll work on unit tests once we agree on how these should work
I am quite surprised by this and I guess my core question here is almost "why?" For now, keeping it focused on "sync deadline alert callbacks", this seems be a lot of code replication for unclear benefit. |
Hey @vikramkoka! Thanks for weighing in, here is more context: Basically the story goes:
|
555c754 to
0fb75a4
Compare
5359cc7 to
34b556c
Compare
|
I've removed the refactoring changes for deadline and just focused on the DB related changes for callbacks to keep this PR focused on the major change. There will be followup PRs to refactor deadlines to use TriggererCallback as well as implementing support for Executor callbacks |
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks. # Conflicts: # airflow-core/src/airflow/migrations/versions/0091_3_2_0_restructure_callback_table.py
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks. # Conflicts: # airflow-core/src/airflow/migrations/versions/0091_3_2_0_restructure_callback_table.py # Conflicts: # airflow-core/src/airflow/models/deadline.py
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks. # Conflicts: # airflow-core/src/airflow/migrations/versions/0091_3_2_0_restructure_callback_table.py # Conflicts: # airflow-core/src/airflow/models/deadline.py
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks. # Conflicts: # airflow-core/src/airflow/migrations/versions/0091_3_2_0_restructure_callback_table.py # Conflicts: # airflow-core/src/airflow/models/deadline.py
Followup to #54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
Followup to apache#54796. Since callbacks are going to be independent from deadlines, we might as well move them to their own module. I've essentially copied the code between files with the only actual change being imports and switching to structlog.
Followup to apache#54796. Since callbacks are going to be independent from deadlines, we might as well move them to their own module. I've essentially copied the code between files with the only actual change being imports and switching to structlog.
Followup to apache#54796. Since callbacks are going to be independent from deadlines, we might as well move them to their own module. I've essentially copied the code between files with the only actual change being imports and switching to structlog.
Followup to #54796. Since callbacks are going to be independent from deadlines, we might as well move them to their own module. I've essentially copied the code between files with the only actual change being imports and switching to structlog.
…8177) Followup to apache#54796. Since callbacks are going to be independent from deadlines, we might as well move them to their own module. I've essentially copied the code between files with the only actual change being imports and switching to structlog.
Followup to apache#54796. This PR essentially moves callback functionality from deadline callbacks to the generic callbacks and refactors Deadline to use these callbacks.
…8177) Followup to apache#54796. Since callbacks are going to be independent from deadlines, we might as well move them to their own module. I've essentially copied the code between files with the only actual change being imports and switching to structlog.
…8177) Followup to apache#54796. Since callbacks are going to be independent from deadlines, we might as well move them to their own module. I've essentially copied the code between files with the only actual change being imports and switching to structlog.


Introduce a generic Callback model that can be used for Deadline callbacks for now and hopefully the on_*_callbacks for Dags and Tasks in the future.Introduce a generic Callback model to run callbacks on executor workers. To be used for Deadline callbacks and the on_*_callbacks for Dags and Tasks that run on the Dag Processor. Implementation of some of the functions will be added in another PR so that this PR can be focused on the DB model and the Workload definition.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.