https://prefect.io logo
Title
j

Jason Noxon

12/27/2022, 2:31 PM
Good Morning, Prefect Community! I am setting up Prefect 2 on an Ubuntu server, and I can run flows without issue. However, I want this setup under a "prefect" user and running automagically. Am I overlooking something like this in the documentation? Any direction would be greatly appreciated.
πŸ‘‹ 15
βœ… 4
n

Nate

12/27/2022, 2:33 PM
Hi @Jason Noxon! Generally, #prefect-community is a good channel to ask this sort of question in. By this
However, I want this setup under a "prefect" user and running automagically
I assume you mean you want to run an agent on this ubuntu machine, in which case you could check this out if you mean something else, feel free to clarify!
:thank-you: 1
j

Jason Noxon

12/27/2022, 2:34 PM
Just from the title, that is EXACTLY what I needed. Thank you!
:party-parrot: 6
n

Nate

12/27/2022, 2:35 PM
sure thing!
j

Jason Noxon

12/28/2022, 12:57 PM
Hi, Nate! One more question: any documentation for using a venv for that prefect user? So when prefect starts as the daemon that it uses a virtual environment?
n

Nate

12/28/2022, 6:36 PM
Hi Jason, not to nag but please ask future questions in #prefect-community as we'll have more eyes on the question / will be better able to assist you πŸ™‚ you can precede your
prefect agent start ...
command with whatever python interpreter you choose
...
ExecStart=/path/to/my/venv/python prefect agent start -q myQueue
...
this may be useful context it's my opinion that running virtual environments (to enable flow runs using the Process infrastructure) on VMs like this becomes difficult to manage at scale, so I would suggest that you may want to install docker on your VM and then you don't need to worry about the python environment your agent is running in on a project-by-project basis, because your dependencies for each project are built into some DockerContainer (more on building images)
j

Jason Noxon

12/28/2022, 7:39 PM
Oh my god, I am so sorry - I thought I was in the #prefect-community channel! Apologies.
n

Nate

12/28/2022, 7:41 PM
no problem at all πŸ˜„ it's just easier for us to help in that channel hopefully the above was still helpful
πŸ™Œ 1
πŸ˜›anda-dancing: 1
t

Taylor Curran

12/28/2022, 8:52 PM
Hi Jason πŸ™‚ welcome to Prefect slack πŸ˜›anda-dancing:
j

Jason Noxon

12/30/2022, 1:30 PM
Thanks, @Taylor Curran! Things you should know about me: I like movies, good food, and I don't post in the correct channel!
:cool-llama: 3
🀣 1