Hi team cannot see how the --namespace flag makes ...
# ask-metaflow
c
Hi team cannot see how the --namespace flag makes any difference to the namespace under which the step functions gets deployed
1
c
Hi @clever-pencil-68951, I'm new here and not an expert, but this morning I discovered that the namespace parameter seems to affect where an upstream result should be read from, but the
--tag
parameter is how you affect what namespace a flow is written to. Here's where I was reading about it: https://docs.metaflow.org/scaling/tagging#tags-as-namespaces Hopefully someone will correct me here if I am steering you wrong.
💯 1
c
At first this article did not make sense to me, but playing around (experimenting) and actually looking at what happens, then going back to the article - it is starting to make a bit more sense to me now 👍
c
@clever-pencil-68951 I was thinking about this again and then reading through the docs some more and it looks like
--tag
is more of a manual way of controlling namespace, providing a lot of power. Using the
@project
decorator in combination with usage of the
--production
and
--branch
parameters looks like the more "batteries included" team-centric way of driving this behavior. https://docs.metaflow.org/production/coordinating-larger-metaflow-projects#the-project-decorator
If
ProjectFlow
did not have a
@project decorator
, it would get deployed as a workflow called
ProjectFlow
on AWS Step Functions by
step-functions create
. Only one version of
ProjectFlow
could exist on a production orchestrator at a time. Everyone deploying the flow would need to know the production token assigned to the deployment.
The
@project
decorator adds a user-specific prefix in the workflow name: the workflow gets deployed with a name like
example_project.user.YOURNAME.ProjectFlow
where
YOURNAME
is your username. Metaflow gets the username by looking, in order, at the following environment variables:
METAFLOW_USER
,
SUDO_USER
,
USERNAME
and
USER
.
This allows multiple developers to deploy their workflows on a production orchestrator without fear that they might interfere with someone else's deployment.
c
Hi @cuddly-family-48123 I've used the project decorator in my flow project, below are my step functions. The naming does include a prefix coming from the config output produced by the Terraform "metaflow" module. I think I will just reset the METAFLOW_SFN_STATE_MACHINE_PREFIX = "". Then I will have my namespace @project.user.METAFLOW_USER.FlowClass. This is how the "user" class works that is available via the project decorator. I still have to play with the other 2 classes available via the project decorator: test, prod
I'm not exactly sure where the unique suffix comes from and if that is just an AWS thing to ensure uniqueness within the names of the state machines, this is the only difference between the Metaflow docs and what I actually see happen