I am kind of a newbee with Flyte. But I am trying to understand how one can make certain properties such as resource constraints for tasks configurable from command line. I have a pipeline that is configured from command line and uses Flyte remote to launch a workflow.
Say I want to change the resource configuration of one of my tasks, say number of CPUs or memory size. Do I need to use a @dynamic task for that and rely on with_overrides?
f
freezing-airport-6809
05/17/2024, 6:37 PM
you mean you want to change the cpu/memory at execution time?
freezing-airport-6809
05/17/2024, 6:37 PM
does the cli mean - you also want to change it from the ui?
freezing-airport-6809
05/17/2024, 6:37 PM
if not, then you can write a wrapper to execute, which can set some constant values that are read prior to module load and then configure
freezing-airport-6809
05/17/2024, 6:39 PM
for example a simple way could be an env var to use high mem
Copy code
MEM = "10Gi"
if os.getenv("HIGH_MEM", False):
MEM = "100Gi"
@task(resources=Resources(mem=MEM))
def foo():
...
freezing-airport-6809
05/17/2024, 6:39 PM
You can do this to set per domain too
freezing-airport-6809
05/17/2024, 6:39 PM
if you are using
pyflyte run
this will auto-register a new version
f
fierce-oil-47448
05/17/2024, 6:42 PM
Ok, I'll try this out (using environment variables).
Is there some plan to introduce a notion of global configs in Flyte? Might be useful (a proprietary orchestration system I'm familiar with added such a feature recently and it was widely adopted).