Hello folks! I got a bit confused about hosting Pr...
# prefect-community
i
Hello folks! I got a bit confused about hosting Prefect on a cloud VM explained here: https://discourse.prefect.io/t/hosting-a-remote-orion-instance-on-a-cloud-vm/967 Is my understanding true? We have our code locally in vscode, and we create a VM. Then we do all the settings mentioned in the link. Now, if we run the flow locally, it will be executed on the VM and not the local machine, right?
k
If you run a prefect agent inside your VM, Prefect will execute the flow in your VM
i
Thank you for the answer. And how is this different from the deployment mentioned in the documentation for Docker and Kubernetes? https://docs.prefect.io/concepts/deployments/ And for the example there for deployment on GCP, it is just for storing data. The flow run again can be local, Docker, or Kubernetes, right? docker means locally in docker, right? I was following

this video

, but it seems
DeploymentSpec
is not supported anymore. The API is changing so quickly. So is summary, we can run the flow: • locally • locally on Docker • kubernetes • VM right?
It's not also clear to me what happens when we do the deployment. For example we use a VM on GCP. We run deployment with a weekly schedule, now the VM should be running all the time and prefect needs to be running somewhere? We just have the Orion UI running and run our python file, right?
I know that I can connect to VM and do everything there to run flow and store data (and also store to GCS), but having the code on my local machine and rn it on VM is not clear to me, as I just see Docker or Kubernetes options.
@Kevin Kho Can you help plz?
m
Hey Isaac, our deployments have changed a bit from when this video was released as you pointed out. At the time the deployment is scheduled for, it will look for a running agent to pick it up and run the flow. As far as storage goes, check out this doc and see if it helps.
i
Thank you @Matt Conger, for the answer. I checked the docs. I'm a bit confused about the connection and ways to use prefect with a cloud like GCP. The storage part is clear for me, I think. For example, I can store data (prefect database and other metadata) locally or on GCS. I just don't understand the running part. Here is my understanding and my questions: • We can have the code on our local machine and create a VM on the cloud. This VM can be the Orion server on the VM. Then we can also connect the local code and the VM to run the flow on the VM. • In this case, the VM should always run with the Orion server. • If one of the tasks needs a GPU, for example, the training task, the VM should have a GPU, which will cost a lot to be running all the time when we just use it a few hours a month. • Is it possible to create one cheap VM for the server and one with a GPU for training tasks and launch it when necessary (to avoid costs - once a month, for example), have the code locally, and connect all of these together? Or do we have to go for Kubernetes? (I try not to go for that as I have not worked with it) • By all of these difficulties and confusions, what is the benefit compared to VertexAI workflows and ML training services? Using serverless services doesn't seem expensive there. • I'm looking for some examples of architecture now. I know you mention a lot of flexibility, but this just adds more confusion. • I also have MLflow in the training task for experiment tracking. I think the data for MLflow will be saved where we run the task or flow. How to manage this? Is there any help from Prefect to manage that?
a
Orion is orchestra layer and self hosting may indeed be challenging. One of the reasons you can sign up for Cloud. In that case, alk you need to set up is an agent and this can be done in a single command
For cost optimization questions, you can reach out to sales@prefect.io - we can help with technical questions here though
i
Thank you for the answer. I don't want to have tools on other cloud services. So you suggest to use Prefect Cloud if I want to scale, right?
a
yup, this sounds like a great idea 👍