Hi, is it possible to access `METAFLOW_PROFILE` as...
# ask-metaflow
f
Hi, is it possible to access
METAFLOW_PROFILE
as an env variable inside a flow when running on a k8s cluster?
I tried accessing it locally just as any env variable which worked. It's only when running on the k8s cluster that it can't find the env variable.
a
you can use the
@environment
decorator for this use case
curious - what is the need to access metaflow_profile env var? you wouldn't have access to the same configuration on the remote instance
f
We are sending some slack notification with much more metadata from inside the flow. We want to identify on which metaflow instance (prod/staging/dev) the flow is running. Our METAFLOW_PROFILE is usually set to
<prod|staging|dev>
. So I thought this would be an easy way to fetch this information.
a
you can use
--branch
to segment your flows into prod, staging, dev etc.