Open agile-anthony opened 2 years ago
Unfortunately the feature you're talking about is not yet available in Celery Director. What you want is dynamic tasks, but right now Celery Director only support static workflows in YAML definitions.
So when you do:
poc.ACCEPT-CATALOGS:
tasks:
- LIST-CATALOGS
- GROUP_CATALOGS:
type: group
tasks:
- CREATE-DATASOURCE
It's just 2 tasks that run one after the other (and in fact the group is not really useful in this case):
chain(LIST-CATALOGS, group(CREATE-DATASOURCE))
It's different from your code when you dynamically add task in the group using a list comprehension.
Thank you for the explanation. I like celery-director so I will keep an eye out for enhancements.
I have a use case where i produce a list of file names and I want a task to process each filename in parallel. So I have task that returns the list of filenames, and the next step is a group consisting of one task. However, Director passes the entire list to the task. I assumed that Director would pass each instance from the list to an instance of the task, but that is not how it is working.
Here is my workflow:
And here are my tasks:
I've done something similar using native Celery, which is why I assumed that Director may work the same way. I defined the Celery Group Canvas like this:
Is there a way to create similar functionality in Celery-Director? Thank you for reading and for any helpful feedback.