I have been using AWS Lambda to execute some R code by packaging the dependencies (CRAN Packages) and deploying it along with AWS Lambda. This helps me parrallelise running a small chunk of R code over huge set of data compared to running it on an instance. I have referred to this article GENOMICS ON AWS LAMBDA The Lambda executes using RPY2 on Python.
I am exploring possibility of running the R code on Google Cloud Functions as I am using Big Query for querying some data.
I see that Google Cloud Functions now supports only NodeJS. There are few ways to execute R script from NodeJS. NPM Stackoverflow
But I need to package all the necessary packages to run my R code also. On AWS I did it by using a AWS AMI to install all R packages then create a Zip which would get deployed.
I wonder if someone has tried running R code with packages on Google Cloud functions.
Being a Linux server application, R Studio server is one of the best solutions that could be hosted on Google Cloud (or Amazon Web Service or Azure) to automatically process large volumes of data in SQL/ R/ Python in a centralized manner.
Comparing Cloud Function and Cloud Run Cloud Functions only supports a single request at a time for each cloud function instance whereas Cloud Run is able to handle multiple requests at the same time and is able to scale up based on demand.
But as we continue to expand the capabilities of Cloud Functions, the number-one friction point of FaaS is the “startup tax,” a.k.a. cold starts: if your function has been scaled down to zero, it can take a few seconds for it to initialize and start serving requests.
I'd consider using AppEngine, or containers, for your task rather than CloudFunctions. There are some suggestions for how to do it here: http://code.markedmondson.me/4-ways-schedule-r-scripts-on-google-cloud-platform/ and on Compute Engine here: https://cloud.google.com/solutions/running-r-at-scale
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With