https://prefect.io logo
Title
e

emo loic

08/16/2022, 9:20 AM
Hello. If I want to run flows in a local subprocess. Do I have to specify the environment in which prefect agents will execute the tasks? Let's supposed my flow requires some dependencies that I have already installed in a python environment. When the agents will pick up the flow, where do I specify the environment they need to in other to run the flow?
o

Oscar Björhn

08/16/2022, 10:10 AM
If I remember correctly from when I was running agents locally a couple of weeks ago, by default the agent should run them in the same environment the agent is running in. Is that not what you're seeing? The above generally isn't a good idea in a production environment, but that's why deployments let you specify additional details about your deployment environment, for example if you want to run things in a docker container.
e

emo loic

08/16/2022, 10:20 AM
Do you have know any article or tutorials for deployment in docker or k8s ?
o

Oscar Björhn

08/16/2022, 10:22 AM
I should have asked first, are you on Prefect 1 or 2?
:thank-you: 1
e

emo loic

08/16/2022, 10:46 AM
prefect 2
a

Anna Geller

08/16/2022, 10:58 AM
if your agent is running in a process and your flow runs too, then yes, your agent needs to have all the pip package dependencies However: • your custom modules (not pip packages) can be packages into storage block alongside your flow, so those don't need to exist on the agent and can be picked up at runtime • when you run e.g. on K8s, then dependencies are in the image
e

emo loic

08/16/2022, 11:01 AM
How to configure the subprocess in other to include the dependencies ? @Anna Geller?
Do you have any article or blog to explain how to do that.
o

Oscar Björhn

08/16/2022, 11:06 AM
This might be a good start, although I'm not sure how much it goes into detail: https://orion-docs.prefect.io/concepts/deployments/
:thank-you: 1
e

emo loic

08/16/2022, 12:48 PM
it's not well detailled.
o

Oscar Björhn

08/16/2022, 12:51 PM
There's a bunch more articles here: https://discourse.prefect.io/tag/deployment
:thank-you: 1
1