metaflow
metaflow copied to clipboard
Feature Request: Surface the current runtime
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".
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
btw for quicker synchronous responses, you can ping us at chat.metaflow.org