Question: How can we sync the environment between ...
# ask-metaflow
l
Question: How can we sync the environment between training and serving flows? The fast-bakery helps build/freeze all the deps for a model at training time. If fast-bakery builds an image in
train_flow.py
, is there a way to re-use that environment in
batch_inference_flow.py
? I'd like to be able to pass a model ID (or flow ID) from
train_flow.py
into the serve flow, and have the model and environment automatically be loaded.
1
a
Yes - the image used is recorded for every task. If you have the run id, you can pull the image as well.
l
I’m excited to see that! Specifically, if we have a run id for training. Can we pull that image and use it in a serving pipeline later? I'm imagining a scenario where the serving pipeline dynamically chooses which image to pull based on the trained model that it's loading. That way dependencies are guaranteed to be synced between training and serving.
a
Correct! That’s the use case
❤️ 1
m
Do we have an example of this @square-wire-39606?
a
I can follow up with an example in our private slack 🙂
🙌 1
thankyou 1
m
Great question @lively-lunch-9285 🤣 meow wave
😆 1