Distribute Type of Tasks Only To Head Node

Hello Everybody,

In short, I need a way to distribute a particular type of task only to the head node, instead of going to the worker nodes. The reason I need this is because I employ a tree of tasks pattern, in which one task pops up up to 1000 other tasks. The idea is that the root task (which create additional tasks) must go to the head node, whereas the other tasks (which are getting popped by the root task) should go to the worker node. This is a requirement because the first task (i.e. root task in the tree) as certain demands which cannot be fulfilled by my worker nodes. Thereby if the root task is delegated to a worker node, it will fail after a certain period.

So in brief, is there a way to tell ray that it should ran a particular task exclusively on the head node?

Thank you!

Okay there is a hacky way to do it via custom resources. So I will be using this, it seems to be sufficient.