

Vertical scaling is where you just throw more power at the problem. 1A - Vertical scaling aka “Getting a bigger boat” In that case you can choose to scale either horizontally or vertically. The first scenario is where you have a script that does something cool, but now you need it to say run against more data than you can throw at it locally or don’t have the CPU resources. This basically constitutes a continuous delivery (CD) basis, so to deploy new code I need but push to GitHub and my script, Shiny app, R API or model are updated automatically. The above are used within googleComputeEngineR’s templates, so as RStudio, Shiny and R APIs can be launched quickly. Some of these are available publically at this repo (you do need to login though) They are by default private, and over time I’ve built a library of useful images. Container registry - Once built images are available from here.Build Triggers - I never build Docker on my machine, I always commit the Dockerfiles to GitHub and then this service builds them for me.The tools I use day to day with my Docker workflows are: Within GCP containers are fundamental and once you have a Docker image, you will be able to use many of GCP’s services both now and in the future, as well as on other cloud providers. steveadore is a Docker client written in R.containerit is helpful to quickly generate a Dockerfile from an R script or project.The Rocker Project is where it all flows from, providing useful R Docker images.There is growing support for Docker in R, of which I’ll mention: I do think that Docker’s strengths seems to cover R’s weaknesses particularly well, but having Docker skills is going to be useful whatever you are doing, and is a good investment in the future. This means that a lot of the techniques described are not specific to R - you could have components running Python, Java, Rust, Node, whatever is easiest for you. It encapsulates code into a unit of computation that can be built on top of, one which doesn’t care which language or system that code needs to run. The common scenarios I want to cover are:ĭocker is the main mechanism to achieve scale on GCP. It seems this has developed into my niche, and I get questions about it so would like to be able to point to a URL.īoth R and the GCP rapidly evolve, so this will have to be updated I guess at some point in the future, but even as things stand now you can do some wonderful things with R, and can multiply those out to potentially billions of users with GCP. This post covers my current thinking on what I consider the optimal way to work with R on the Google Cloud Platform (GCP).
