rich-elephant-44987
03/16/2023, 5:18 PMProject, Branch , and User. Is it possible to use the User filter without having specified the @project decorator?fresh-laptop-72652
03/16/2023, 5:46 PMUser without specifying any of the other filters, e.g. "show me all flow runs by this user". The project/branch data is optional and only available for flows using an @project decorator
I'd recommend giving this a read if you're curious as well
https://docs.metaflow.org/scaling/taggingrich-elephant-44987
03/16/2023, 5:54 PMUser . What value would this be populated with? In the definition of my SFN statemachine, I see the following added as environment variables to each step:
METAFLOW_USER=SFN
METAFLOW_OWNER=my-user
USER=my-user
Are any of these representative of what we should be able to filter on?brave-lion-15961
03/16/2023, 6:09 PMUser column of your list of runs. In this case I had a user called sandbox. Then I typed an s in the User field and it autocompleted.rich-elephant-44987
03/16/2023, 6:10 PMbrave-lion-15961
03/16/2023, 6:11 PMwhoami?rich-elephant-44987
03/16/2023, 6:15 PMMETAFLOW_USER . Is that not sufficient?user
03/16/2023, 6:50 PM"user:xxxxx" exists, will xxxxx be displayed on the Metaflow UI.fresh-laptop-72652
03/17/2023, 3:59 AMMETAFLOW_USER=SFN bit is due to how deployed SFNs can be triggered by other users/services.
some extra context -
https://outerbounds-community.slack.com/archives/C02116BBNTU/p1630535475071000rich-elephant-44987
04/18/2023, 2:27 AM"user:xxxxx" be set so that the UI actually presents something useful?user
04/18/2023, 5:12 PMfrom metaflow import FlowSpec, step, Parameter, current, Run
import os
class HelloFlow(FlowSpec):
local_user = Parameter('local_user', default=os.environ.get('USER'))
@step
def start(self):
if self.local_user:
run = Run(f'{current.flow_name}/{current.run_id}')
if os.environ.get('METAFLOW_RUNTIME_NAME') in ('argo-workflows', 'step-functions'):
run.add_tag(f"triggered_by:{self.local_user}")
...
The outcome is that Metaflow UI will show the triggering USER as "trigger_by:USER" on the Metaflow UI, under user tags on the RHS. I know this is not ideal but hope this unblocks your team somewhat.
Note while we don't expect the moving parts here to change soon (e.g. the METAFLOW_RUNTIME_NAME env var, local resolution of "USER" in Parameter), this workflow goes beyond our official public facing API / backward compatibility promises.