celery-director icon indicating copy to clipboard operation
celery-director copied to clipboard

Not able to create chain tasks in parallel tasks

Open baloda opened this issue 4 years ago • 8 comments

I am trying to create a below-defined workflow and it is giving error

p.TEST:
  tasks:
    - TEST_1
    - TEST_2
    - WORKERS:
        type: group
        tasks:
          - TEST_3
          - TEST3_WORKERS:
            type: chain
            tasks:
              - TEST_6
              - TEST_7
          - TEST_4
          - TEST_5
    - TEST_8

Error:

signature = cel.tasks.get(task_name).subtask(
TypeError: unhashable type: dict

baloda avatar Apr 30 '20 07:04 baloda

Director does not yet support nested structure because at the origin we wanted to keep our workflows as simple as possible. But looking at your use-case is a proof that it can be useful sometimes :)

We'll work to implement that in a next release.

ncrocfer avatar May 07 '20 17:05 ncrocfer

Hi, thanks for this nice project !

I might be interested by this feature. Is it still planned to be developed ?

henri42 avatar Jan 24 '22 17:01 henri42

Hello,

No we don't plan to add it right now because we still want to keep the workflows as simple as possible. Can you explain us what's your use-case please?

ncrocfer avatar Jan 27 '22 15:01 ncrocfer

Thanks for your answer.

My use case would be the following:

  • detecting media files
  • analyze these files
  • processing files differently depending on the result of the analysis (this would typically be a chain of tasks)

A related question : In order to build more complex process, how do you suggest to chain the simple worfklows ? Maybe an external application using the rest API ?

henri42 avatar Feb 14 '22 09:02 henri42

Hi, thks for great project!

I'm wondering if we have put it into some milesonte?

kevinnguyen9185 avatar Nov 07 '22 10:11 kevinnguyen9185

Hi @ncrocfer I've made some changes from my local branch, which now makes celery-director fully support nested workflow. What do you think?

Recursive workflow

kevinnguyen9185 avatar Nov 18 '22 04:11 kevinnguyen9185

Hi @cin-kevin,

Indeed this seems interesting :blush:

The main goal of Celery Director is to keep the definitions as simple as possible. If your implementation of this feature doesn't complexify the YAML definition or the codebase you can make a pull-request we would be happy to review it 👍

ncrocfer avatar Dec 09 '22 14:12 ncrocfer

Thks @ncrocfer I'll submit a pull-request !

kevinnguyen9185 avatar Dec 12 '22 09:12 kevinnguyen9185