Prefect Community, I need your help to get better ...
# prefect-community
x
Prefect Community, I need your help to get better understanding of how agent works in Prefect Orion. I am planning to run two agents from two different Linux servers. But I would like to start Prefect Orion in only one server by deploying a Prefect Orion in a Conda VM where the 1st agent is running. Will that work? Or, Every server where I run the agent, I need to deploy Prefect Orion in a Conda VM and use that VM to run the jobs queued in the Agent. Please shed some light. My understanding so far is, I have to install Prefect Orion Python libs in a Conda VM and start the agent in every Linux Server (one to one mapping). In the same server I can run multiple agents, but if I need to run a agent in another Linux server, I need to deploy and activate the Python VM. Thanks, Xavier Babu
n
Hi @Xavier Babu you can run agents anywhere you like! as long as: • the environment has access to your flow storage (github, s3, some local filesystem etc) • the
PREFECT_API_URL
and
PREFECT_API_KEY
environment variables are set • the place your agent is sending your work (which could be the same environment you're running your agent in) has all the python dependencies your flow needs to run so in your case, you could have a VM for your prefect orion server and another VM for an agent (or many agents), or you could have both processes on the same machine - its up to you! it might make things easier to manage if you run your deployments in a DockerContainer, since then you don't need to worry about your agents' linux process having all your different projects' python dependencies installed
x
Thank you, Nate. Let me work on it.
👍 1
Nate, Can you please share the link to learn more about "how to use GitHub for flow storage?"?
tutorial would be great
n
here are some docs on configuring storage blocks but you would essentially go to "Blocks" in the UI, click "+" to create a new block, and then select "GitHub" (you can specify a PAT if you need to pull code from a private repo) Once created, you can specify that deployments should pull from a specific github repo by referring to this block like
Copy code
prefect deployment build flow.py:my_flow -n DeploymentWhoseCodeLivesInGitHub --storage-block github/my-github-repo-block-name ...
x
Thanks, Nate