3. Containerizing R and R Packages for Ultimate Reproducibility


This section consists of four parts. Part a is a reference material, parts b, c, and d are tutorials, but you probably will not have time to go through both in class, so choose one of them to do in class and do the rest at home.

  1. The overview of how containers work: Get Familiar with Docker and Binder. This is more of a reference material that explains some technicalities of Docker (one of the popular containerization software) and Binder (an online service that allows you to run a container with R and RStudio in the cloud with just a web browser).

  2. A tutorial for making your own git repository reproducible in Binder. It focuses on how to setup your git repository in such a way, so that anyone can run it in the cloud using Binder with just a web browser. The primary use case for this is publishing a reproducible repository for a research project, primarily with code that reproduces figures from raw data or pre-calculated and cached modelling results. Binder is limited in memory and compute power, so it will not handle long running resource intensive computation.

  3. A tutorial for building your own Docker container image with R and R packages pre-installed and run it locally. It covers the process of customizing the Dockerfile and building the container image locally on your computer. You would normally use such container image for everyday work locally on in the academic High Performance Computing (HPC) cluster or on your own personal computer. Note: due to recent changes to Play with Docker, you will not be able to build large container images, therefore if you do not have Docker installed on your computer, you will only be able to use Play with Docker to build a slighly simpler container image that is unrelated to the project we were working on in other parts of the tutorial.

  4. A tutorial for those who want to try Docker, but cannot install it. Play with Docker allows a similar experience in a web browser. Try Docker in a web browser via Play with Docker.