Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How do I setup my python socket server on Google Cloud?

I am new to Google Cloud and I am sorry if I set the wrong location for my post. I would like to put my Socket Server on Google Cloud so it runs 24/7 without needing a local computer. We have already installed the necessary libraries that we need for the python script to run, however, we are still stuck on how we will access the trained model that we have. Basically we have a trained model that would classify an object. My colleague had already uploaded the model in the bucket and the problem that we are currently facing is that how could we access the model for the python script from the bucket?

0 2 896
2 REPLIES 2

Hi, Richard,

If you expect to run a script 24/7, serverless might not be the best choice, what comes to my mind is a Compute Engine VM.

That being said, I might need some clarification regarding this:

how could we access the model for the python script from the bucket?

I understand that you want to read the model that is located on a GCS bucket using a Python script, if so, you should download the file to your machine where the script is running and then make the script read the model that was downloaded. How? Well, that depends on your use case there are multiple ways:

- Python Client Libray
- Public Cloud Storage URL
- Signed Link

What is your use case?

If you are planning to run a script every certain time, you might try something like a Cloud Funcion + Cloud Scheduler.

But a Cloud Function can only run for 9 minutes on the first gen and 60 minutes on the second gen.