Repository navigation
DAG workflow canvas element - #11118
chrisbarber wants to merge 38 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #11118 +/- ##
==========================================
- Coverage 91.28% 90.83% -0.45%
==========================================
Files 153 154 +1
Lines 21824 21971 +147
Branches 2710 2747 +37
==========================================
+ Hits 19921 19957 +36
- Misses 1603 1707 +104
- Partials 300 307 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
|
can you also reference all relevant open or closed issue related to this which are also referenced in the issue you initially refrenced to fix? that will help us to consolidate all possible things to consider before finally moving forward with it |
|
can you also check the smoke tests? |
Something wrong with the import, since 0dd70dd |
|
I see, it looks like some tests deliberately mix dev and latest(pypi) workers celery/t/smoke/tests/test_revoked_sync.py Lines 89 to 90 in 715b8a6 Somehow I guess the t.smoke.workers.latest.CeleryLatestWorkerContainer one is picking up t/integration/tasks.py with my changes
|
|
Now some issue with tox-gh-actions Anyways I put a try/except around the import to handle the “latest” (pypi) worker importing the A previously failing smoke test now passes locally for me so it should be sufficient. There could be a more elegant way but it could also just be removed later. I guess it’s an overall question of how to handle breaking changes in those smoke tests which mix old and new workers. |
|
i guess we have to deal it separately, I had some plan for that before v5.7.0 release, will try to start that today in a separate PR |
|
I found this library from a redhat engineer https://github.com/selinon/selinon I think we can get some architectural inspiration from here to make the celery DAG for futuristic and more extendable by design. |
Sure, if someone has bandwidth. We looked at that lib and didn’t want yaml’s, for also realtime or dynamic purposes. I think rudimentary DAG support in Celery remedies the issue where people land on the canvas docs and assume it can handle normal workflows, only to discover that it supports only some unusual subset of topologies, and results in workflow code that is hard to read and maintain (deeply nested chain/chord/identity structures with fragile/inflexible positional argument passing). This PR leverages the fact that Celery already has mature barrier functionality and remedies that shortcoming promptly, without forcing another dependency or unnecessarily forcing polling (like celery-dyrygent for example). At least at our company we have used the approach like this PR in production for over a year. To be fair we added a few extra things -- in an on_failure handler we delete the failed result from the sorted set and republish the task to a “failed” queue which is normally not consumed from. Then we move those tasks onto default to let them “reprocess,” and the DAG workflows continue from where they left off. It’s maybe an extension that could also go into Celery but it might be better for a blog or something, and let people take their own approach (maybe with some hook or option though for deleting the failures from the sorted sets, as that is fairly low-level). |
|
I also do not want yaml, I would prefer simple python based API as well, may be we can take some design motivation from that and use our own pythonic DAG API |
Description
Discussed initially here: #893 (comment)
That comment may be the best quick and understandable orientation to what this PR implements.
Basically make minimal modifications to get a DAG workflow canvas element.
The feature is mostly proven through integration tests, which I have run against both redis and postgres backends.
I realize some docs and some basic checks to block invalid sequences of calls and give informative errors etc should be needed. But I believe the feature is overdue and that type of stuff can be added very easily during review so I really wanted to open the PR to at least to get through any technical blockers and also run the whole CI.
Also in my opinion this could be merged as some kind of beta or undocumented feature at least to avoid development stalling.
Addresses feature requests for DAG style workflow behavior, eg open issues #893, #6030, #4562 or some old closed one like #3666 or another historical one where a potential contribution unfortunately didn’t happen #5000 (comment) (~100 stars on that repo shows interest in Celery DAG capability; also note that the approach there is polling only and doesn’t integrate cleanly in contrast to this PR which does so by using the existing barrier functionality of
on_chord_part_return/chord_unlock)