11/03/2022, 9:30 AM
Hello, just started using Prefect. I tested the flow locally, configured the cloud UI and the storage block and then installed prefect on a GCP VM to take care of the execution. For now, the trick I found to not have the process stop when I quit the ssh session is using screen. It’s working fine. That being said, I have a few questions: • Using screen to detach the process from the terminal feels to me more like a hack rather than a long term solution. What would be a better way of having a prefect agent run in production on a VM? • Would you have an example that shows how to use the process block? I am not sure to understand its usage and how it gets connected to the VM. Could it be used to lunch a virtual environment or install the packages listed in a requirements.txt file for example? Thanks for your help!

Christopher Boyd

11/03/2022, 2:21 PM
Hi Jaafar, if you are running the agent on a vm, you can make it a service
For the process block, this is the default infrastructure if nothing is specified
If you want to install packages, or run a customized environment, you would probably be looking for something more like the DockerContainer infrastructure block

Ryan Peden

11/03/2022, 2:45 PM
On GCP, you also have the option of running Prefect flows as Cloud Run Jobs. I just published a guide on how to set it up if it sounds like a good fit for you.
🙌 1


11/04/2022, 11:56 AM
Thanks @Ryan Peden and @Christopher Boyd for the useful ressources 👍