Hello, What is the best practice when establishing...
# best-practices
b
Hello, What is the best practice when establishing prefect on the cloud? Should it run in a cloud instance or in a docker container in a cloud instance?
1
j
I’m not sure I understand your question, Bebeto. A Docker container is not necessary, but Docker has some conveniences and complexities. Are you trying to run Prefect 2 flows in AWS or another cloud provider?
m
Not to piggy back on this, but I'm curious as well. Say I want to create a VM on GCP and run Prefect there. Is there a good docker-compose example or other resources which show how one would go about this?
j
Hi Michael. You could just install conda into your GCP Compute Engine instance and put your agent there and run flows. The prefect-gcp collection has some conveniences. You can put your flow code in a GCP Cloud Storage bucket - Prefect 2 ships with that - you just need to install
gcsfs
. This Prefect tutorial walks through storage and infrastructure. If you want to see an example that uses Docker Compose - but not on GCP - here’s a guide.
🦜 1
🙏 1
b
@Jeff Hale I'm having this error:
[Errno 99] error while attempting to bind on address ('my-gcp compute public ip', 4200): cannot assign requested address
when I run
prefect orion start
please help
j
Looks like maybe you need to enter your GCP address instead of the string
my-gcp compute public ip
b
i did but its not working
j
If you can share the traceback and a minimum reproducible example that might be helpful.
b
Copy code
INFO:     Started server process [234109]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
ERROR:    [Errno 99] error while attempting to bind on address ('my-gcp compute public ip', 4200): cannot assign requested address
INFO:     Waiting for application shutdown.
INFO:     Application shutdown complete.
Orion stopped!
thats the info I get after running
prefect orion start
prefect config set PREFECT_ORION_API_HOST=my-gcp compute public ip
j
Sorry if I”m misunderstanding, but
my-gcp compute public ip
is just a stand in for your actual public IP - you’re using that IP address?
b
yeah, it is a place holder for the real ip. I don't think it is appropriate to share the ip here.
j
Yes, that’s fine. Just couldn’t tell.
1
j
@Jeff Hale: I am looking for a simple way to use prefect 2.0 on GCP. Is this tutorial still relevant for prefect 2.0 ? If not, could you please recommend one? Thanks!