[DAG][Workflows] How can I chain tasks without returns

Normally to construct dependant tasks I do:

@ray.remote
def t1():
    print('t1')
    return 't1'

@ray.remote
def t2_depends_on_t1(t1_result):
  res = 't2 ' + str(t1_result)
  print(res)
  return res

dag = t2_depends_on_t1.bind(t1.bind())
ray.get(dag.execute())

this works fine, i get t1 and then t2 t1

But what do I do if both t1 and t2_depends_on_t1 don’t return anything and don’t take in params, but I still want to enforce execution order in DAG?

I try

@ray.remote
def t1():
    print('t1')
    return 't1'

@ray.remote
def t2_depends_on_t1():
    print('t2')
    return 't2'

dag = t2_depends_on_t1.bind(t1.bind()) 
ray.get(dag.execute())

but I get TypeError: too many positional arguments

How do I do this?

Bumping up, any help? Thanks!

Taking input params is forced to build a DAG. It’s like you specify what’s the upstream of this specific node.

For return, you can just return None. Some code like follow:

@ray.remote
def t1():
    print('t1')

@ray.remote
def t2_depends_on_t1(upstream):
    print('t2')

dag = t2_depends_on_t1.bind(t1.bind()) 
ray.get(dag.execute())

maybe pass in *args?