Receiving data from Google Cloud

124 views
Skip to first unread message

Vishnu U

unread,
Aug 14, 2020, 10:28:08 AM8/14/20
to Google App Engine
I am working on a project where I have to send data from Raspberry Pi to Google Cloud, process it, and receive the result back to the same Raspberry Pi. Is this possible using Google App Engine?. If not is there any other service in GCP that can do this functionality?

wesley c

unread,
Aug 14, 2020, 9:15:58 PM8/14/20
to google-a...@googlegroups.com
While App Engine will serve your needs, based on what you asked, perhaps Google Cloud Functions would be a simpler solution. You can get started immediately by going to the Cloud console's Cloud Functions dashboard where you can create, code, deploy, and test your function, all from your browser. The Quickstart sample code is already dropped into the editor and ready for you to modify. Alternatively, if you already have that app you want to call in a Docker container, then you should use Google Cloud Run instead. App Engine is best suited for normal web apps like Flask or Django.

Hope this helps!
--Wesley

On Fri, Aug 14, 2020 at 7:28 AM Vishnu U <vish...@gmail.com> wrote:
I am working on a project where I have to send data from Raspberry Pi to Google Cloud, process it, and receive the result back to the same Raspberry Pi. Is this possible using Google App Engine?. If not is there any other service in GCP that can do this functionality?

--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"A computer never does what you want... only what you tell it."
    wesley chun :: @wescpy :: Software Architect & Engineer
    Developer Advocate at Google Cloud by day; at night...
    Python training & consulting : http://CyberwebConsulting.com
    "Core Python" books : http://CorePython.com
    Python blog: http://wescpy.blogspot.com

Vishnu U

unread,
Aug 14, 2020, 9:22:48 PM8/14/20
to google-a...@googlegroups.com

But my source of data is not any cloud storage or cloud data store. Suppose I received data on app engine from raspberry pi and I perform some calculation and want to return that data. Is this possible? 
--


You received this message because you are subscribed to the Google Groups "Google App Engine" group.


To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.


To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/CAB6eaA7sxv%3DgjxHXYPU3W3CcEKyorsF6X7SjMA6ny1aS3nwvog%40mail.gmail.com.


Vishnu U

unread,
Aug 14, 2020, 9:23:48 PM8/14/20
to Google App Engine

wesley c

unread,
Aug 15, 2020, 2:29:13 AM8/15/20
to google-a...@googlegroups.com
It's best if you describe your entire architecture then, because I was only going on what you stated in your OP... you "have to send data from Raspberry Pi to Google Cloud, process it, and receive the result back to the same Raspberry Pi." I answered that your use case looks like it fits Cloud Functions better than either App Engine or Cloud Run. There was no mention of GCS (Cloud Storage) nor Cloud Datastore. As mentioned, you *can* use App Engine to get the RaspPI data, process it, and return it, but it seems like it would be easier to use Cloud Functions instead to do the same thing.

Cloud Functions can take the data, do some processing and return it, just like App Engine, but easier. However, if the code that processes this data is more complex and is an entire *app* where you have many components or need to persist, provide a web UI, etc., then yes, App Engine would then be better. Cloud Functions is for serverless unction-hosting in the cloud, App Engine is for serverless app-hosting in the cloud, and Cloud Run is for serverless container-hosting in the cloud.

Vishnu U

unread,
Aug 15, 2020, 2:36:59 AM8/15/20
to Google App Engine
My aim is like i want to perform prediction using a Keras saved model. So I receive two sensor inputs from raspberry pi to Google Cloud and perform the prediction on the cloud and return that result back to raspberry pi to make necessary changes. Will cloud functions be suitable for this?

wesley c

unread,
Aug 15, 2020, 4:26:44 PM8/15/20
to google-a...@googlegroups.com
Ah, great. That was good to know, and yes, you can do it the easiest with Cloud Functions... since you're only serving a model, you don't need an entire app (App Engine). I've not done it myself, but start with this post on how to serve models w/tf.keras. Then follow-up with this post about a year later on how it can be done with Cloud Functions.

To quickly learn Cloud Functions, I'll refer to the advice I gave in my 1st response: "You can get started immediately by going to the Cloud console's Cloud Functions dashboard where you can create, code, deploy, and test your function, all from your browser. The Quickstart sample code is already dropped into the editor and ready for you to modify."

Good luck!
--Wesley

--

Vishnu U

unread,
Aug 16, 2020, 3:56:40 AM8/16/20
to Google App Engine
Thanks a lot. Now I got an idea on how to proceed. Also please explain to me in case there are multiple requests how GCP will handle them - is there any load balancer? This is because the project is time-critical.

wesley c

unread,
Aug 17, 2020, 4:13:56 AM8/17/20
to google-a...@googlegroups.com
GCF on GCP auto-scales (as does GAE & GCR). Each instance only supports one request at a time. Additional instances will be spun up to support other concurrent requests. If your function (or app or container) "goes viral," GCP automatically handles the traffic for you. However, not everyone has unlimited budget, so there's a way you can control the max # of instances spun-up. To learn more about concurrent requests, check out this page in our documentation: https://cloud.google.com/functions/docs/concepts/exec

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages