Install packages and dependencies is painful. It's OK to run the project after misearable searching and installing
dependent libs. However, you have accesses to mulitple different OSs. Some big data are not allowed to transfer outside. So you have to install the running environment again for the whole project. Looking back own techinical blogs may solve it quickily, but some errors that you did't take the notes. You'll suffer installing & searching problem again and agian.
Above pains are what I suffered, many times. An universe solution is packing environment portable that can be run after cloning the environment.
Docker provides perfect solution. I'm newbie to the docker. The basic demands are that the
rstudio server and
shiny server are integrated in the images. The rocker-org kindly pre-built all images satisfy me.
Another key import question is that it's hard to install Biocondutor packages based on the raw
rocker images. Searching again, Biocondutor provides
core & base docker images based on the
Outside packages are provided in the install-pkgs.R.
For machine learning and deep learning project, it's hard to integrating the keras into the Jrocker. Even though JJ Allaire provided a machine learning docker image based on
rocker/rstudio, I cant reproduce the basic keras example on the keras tutorial. Now I build a
Kerasjupyter notebook basd on
jupyter/scipy-notebook, and name it as
Jukeras. it works fine now.
World is better after build done.
docker pull chunjiesamliu/jrocker:latest docker run -it --rm chunjiesamliu/jrocker /usr/local/bin/R docker run -it --rm chunjiesamliu/jrocker /bin/bash
Run rstudio server
docker run -d -p 8686:8787 \ -v /home/liucj/:/home/liucj/ \ -e USER=liucj -e PASSWORD=<password> \ -e USERID=$EUID -e ROOT=TRUE \ --name Jrocker chunjiesamliu/jrocker
Run R scripts
docker run -i --rm --user $EUID \ --entrypoint /usr/local/bin/Rscript \ -v /your/path/:/docker/path/ \ chunjiesamliu/jrocker /docker/path/product.R
Run Jrocker for multiple sessions with no conflict
Every Rstudio server can run only one session, when you run one command with long time wait, you don't want to wait long time to run other command. So using jrocker to open other several sessions with no conflict, then save the data as
dat.rds.gz to load into your main rstudio session.
docker build -t chunjiesamliu/jrocker:latest . docker push chunjiesamliu/jrocker:latest