-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Experimental: Support custom weight_rule implementation to calculate the TI priority_weight #38222
Experimental: Support custom weight_rule implementation to calculate the TI priority_weight #38222
Conversation
Some of the dags/plugin examples tests will fail, I will fix them tomorrow before merging. |
29a44e8
to
e65e6df
Compare
a9b00e2
to
6581f7b
Compare
6581f7b
to
56cbc49
Compare
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.
LGTM!
Very cool
docs/apache-airflow/administration-and-deployment/priority-weight.rst
Outdated
Show resolved
Hide resolved
56cbc49
to
6a4d1c9
Compare
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.
Tested and like it!
Besides the comment two things that I'd really like before merge but acknowledge this might not be blocking:
- The example is removed - because obviously w/o default plugin deployed will not work. But w/o reading the code it might be hard to make it working in a frst attempt for a user. So if example is missing, then might be good to add some example DAG code in RST docs or commented example in the plugin code.
- Small UI Glitch: As the priority weight is calculated dynamically, it might change display on UI after execution. In the decreasing example the displayed weight on UI changes after task was successfully executed. Because the try_number of the data at the task is a moving target. So we need to remember that the UI is a display of the current state and might have been different at time of execution depending on rule logic. I don't see it as problem and of course it is caused by the fast that we do not persist all values (not only priority weight but also other task execution evidence data).
Thanks again for the rework and besides small comment LGTM!
docs/apache-airflow/administration-and-deployment/priority-weight.rst
Outdated
Show resolved
Hide resolved
I agree that it is not obvious for users to use it, I will add an example to the documentation. |
I will check if there is a way to improve this, but since it displays the priority weight used to schedule the current attempt, IMHO it should be fine. However, it would be better to add something that tells the user what we will have in the next attempt or update it when the task passes from running to any other state. We can discuss and implement this before 2.10.0 |
…the TI priority_weight
6a4d1c9
to
5ab7a40
Compare
This PR adds an experimental feature that allows users to implement custom weight rules (weight strategies) to calculate the priority weight of the task instance in runtime.
This is a lighter alternative for #36029 but without serializing the class instance parameters, which removes the need to add a new column to the task table and handles many cases to keep the new functionality b/c .