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.
The overview of how containers work: Get Familiar with
Docker
andBinder
. This is more of a reference material that explains some technicalities ofDocker
(one of the popular containerization software) andBinder
(an online service that allows you to run a container withR
andRStudio
in the cloud with just a web browser).A tutorial for making your own git repository reproducible in
Binder
. It focuses on how to setup yourgit
repository in such a way, so that anyone can run it in the cloud usingBinder
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.A tutorial for building your own
Docker
container image withR
and R packages pre-installed and run it locally. It covers the process of customizing theDockerfile
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 toPlay with Docker
, you will not be able to build large container images, therefore if you do not haveDocker
installed on your computer, you will only be able to usePlay 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.A tutorial for those who want to try
Docker
, but cannot install it.Play with Docker
allows a similar experience in a web browser. TryDocker
in a web browser viaPlay with Docker
.