Someone else in my organization has deployed a flo...
# ask-metaflow
n
Someone else in my organization has deployed a flow to AWS Step Functions, and I would like to reproduce the run locally as closely as possible.
metaflow environment resolve --from-pathspec $FLOW_NAME/$ID/$STEP_NAME
gives me an error of
metaflow.exception.CommandException: No known environment
, for a flow/id/step that I can see just fine via the web UI. What am I doing wrong here? I don't think I'm trying to do anything fancy, just reproduce all of the dependencies and deployed code as closely as possible, for something that someone else ran in the cloud. I'm aware that there are platform/architecture differences that may result in non-deterministic execution across machines, and this is actually exactly what I'm trying to quantify
f
that is a feature of the metaflow-nflx-extensions package, think there are some restrictions in what can be resolved https://github.com/Netflix/metaflow-nflx-extensions?tab=readme-ov-file#environments-that-can-be-resolved
I think the README might not reflect the latest API though - @dry-beach-38304 would know for sure
d
what does
metaflow environment show --pathspec <flowname>/<id>/<stepname>
show?
n
We are using the metaflow-nflx-extensions package.
metaflow environment show --pathspec
shows plenty of information about the environment.
d
Ok. And what are you trying to do with the resolve command?
Use the environment locally, launch another flow with it, something else?
The command you shared is incomplete (although the error message is highly bizarre I’ll say that so I should fix that).
n
There are a couple of things that I'm hoping to do: 1. Generate a lock file for dependencies for a particular deployed/resolved environment, that can be checked into a git repo to help people perform local runs in a more reproducible way (
metaflow environment show
seems like it may do the trick) 2. Also grab the exact code which was used, to be able to re-run the flow locally, and compare differences in results between the local invocation and the AWS one
d
Ok. For the first one, we don’t currently export to a format like uv.lock or stuff like that though I do have some partial work on that. The solution would be to alias it using environment alias command and then used named_env as the decorator (technically you can get away without the alias but this is clearer).
For the second one, use create as the command.
If the code package is available and it will be if it ran on a remote node, there is a combination of option that will give you this.
Not in front of a computer but —help should clarify which ones.
n
Thank you! I'll play around with these. Have a good weekend!
d
Anytime. Let me know if you have more questions.
You too.