Tarmily Wen
12/02/2022, 6:15 PMDan Rammer (hamersaw)
12/02/2022, 6:23 PMwith_overrides
that allows you to set task resources. To do this dynamically you'll have to run the task within a dyanmic task, which can then analyze the inputs and assign correct resources. For example:
@task
def foo(a: int) -> int:
return a
@dynamic
def bar(a: int) -> int:
if a == 1:
return foo(a=a).with_overrides(
requests=Resources(cpu="6", mem="500Mi")
)
return foo(a=a)
@workflow
def bar(a: int) -> int:
return bar(a=a)
Very toy example, probably syntactically incorrect, but I'm sure you get the idea.