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

[AIP-34] TaskGroup: A UI task grouping concept as an alternative to SubDagOperator #11119

Closed

Conversation

yuqian90
Copy link
Contributor

@yuqian90 yuqian90 commented Sep 24, 2020

This PR is cherry-picked from #10153. It makes TaskGroup work with v1-10-test so that we can encourage more people to start using TaskGroup.
(TaskMixin was also cherry-picked from #10930).

Limitations:

  • Only www_rbac/views.py and graph.html works with TaskGroup. So users will only be use TaskGroup in Graph View if they have rbac = True under [webserver] in airflow.cfg. This is because www/views.py and graph.html has too many differences against the master branch, making it hard to merge. If TaskGroup is used in DAGs but the webserver is not rbac, the Graph View will not break, it'll just appear like TaskGroup was never used. All tasks will appear on the original DAG normally.

This was the original commit message in #10153:

This PR introduces TaskGroup, which is a simple UI task grouping concept.

What this PR does:

  • TaskGroups can be collapsed/expanded in Graph View when clicked
  • TaskGroups can be nested
  • TaskGroups can be put upstream/downstream of tasks or other TaskGroups with >> and << operators
  • Search box, hovering, focusing in Graph View treats TaskGroup properly. E.g. searching for tasks also highlights TaskGroup that contains matching task_id. When TaskGroup is expanded/collapsed, the affected TaskGroup is put in focus and moved to the centre of the graph.

What this PR does not do:

  • This PR does not change or remove SubDagOperator. Although TaskGroup is intended as an alternative for SubDagOperator, deprecating SubDagOperator will need to be discussed/implemented in the future.
  • This PR only implemented TaskGroup handling in the Graph View. In places such as Tree View, it will look like as-if TaskGroup does not exist and all tasks are in the same flat DAG.

GitHub Issue: #8078
AIP: https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-34+TaskGroup%3A+A+UI+task+grouping+concept+as+an+alternative+to+SubDagOperator

This is the example_task_group that this PR adds:
image

Both BaseOperator and XComArgs implement bit shift operators
used to chain tasks in DAGs. By extracting this logic to new
mixin we reduce code duplication and make it easier to implement
it in the future. This change introduces also root property that allows us
to reduce number of type checking.

(cherry picked from 0779688)
@yuqian90
Copy link
Contributor Author

We started using TaskGroup on top of v1-10-12 ourselves in production. So I'm contributing this PR against v1-10-test since I already have it handy. @kaxil @potiuk @turbaszek please see if you are interested in this.

@dimberman
Copy link
Contributor

Hi @yuqian90 apologies but I need to close this as we're already feature freezed on 1.10. 2.0 Alpha is coming out in the next 1-2 weeks and at this point the only things we want to add to 1.10 are critical bugfixes and migration steps/scripts. Anyone who wants to use this feature will have full access to it when the alpha comes out :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:serialization area:webserver Webserver related Issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants