Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running R and packages on GCP cloud function [closed]

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.

like image 855
Anant Bhandarkar Avatar asked Jul 20 '17 11:07

Anant Bhandarkar


People also ask

Can you run R on Google cloud?

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.

What is the difference between cloud run and cloud function?

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.

What is cold start in cloud functions?

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.


1 Answers

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

like image 52
brendan Avatar answered Sep 22 '22 04:09

brendan