:wave: hi folks….Is there a way to override the r...
# ask-metaflow
s
👋 hi folks….Is there a way to override the resources for a particular step? For example if I have step that I need lots of CPU for, but it’s dependent on my input. And I don’t want to set the CPUs for all the steps. Could I do…..
Copy code
@resources(cpu=os.getenv("CPU", 1))
@step
def expensive_step(self):
    pass
Thank you!
1
v
yeah, that should work - maybe
Copy code
@resources(cpu=int(os.getenv('CPU', 1))
or you can do
Copy code
@resources(cpu=MY_CPU)
and set
MY_CPU
through a constant that you read from a config file at the top of the module
or if resources are uniform across steps, you can do
Copy code
run --with resources:cpu=$CPU
on the command line
s
Sweet! Thanks @straight-shampoo-11124
👍 1