metaflow icon indicating copy to clipboard operation
metaflow copied to clipboard

Feature Request: Surface the current runtime

Open ntaylor-ads opened this issue 4 months ago • 2 comments

I would like to implement logic specific to the current executing runtime (e.g. different logic if the flow is running locally vs. as an argo workflow). Does this functionality already exist? If not, it seems to me that the cleanest way to do this would be to surface it on the current object, e.g. current.runtime, which might return strings such as "argo", "local", "kubernetes" and "batch".

ntaylor-ads avatar Aug 01 '25 16:08 ntaylor-ads

this is available today through some contortions -

runtime_tag = next((t for t in Run(f"{current.flow_name}/{current.run_id}").tags if t.startswith("runtime:")), None)

but we will ship a patch to expose this a bit better in the next release

savingoyal avatar Aug 13 '25 14:08 savingoyal

btw for quicker synchronous responses, you can ping us at chat.metaflow.org

savingoyal avatar Aug 13 '25 14:08 savingoyal