Permalink
Browse files

Add automated support for running R CMD check via Docker.

  • Loading branch information...
mbjones committed May 26, 2016
1 parent c5bc999 commit 9d8484425bb740507cae5736c9b87e6522907ca8
Showing with 82 additions and 0 deletions.
  1. +28 −0 docker-compose.yml
  2. +2 −0 docker/.Rprofile
  3. +11 −0 docker/Dockerfile-devel
  4. +11 −0 docker/Dockerfile-stable
  5. +18 −0 docker/Dockerfile-texlive
  6. +8 −0 docker/rcheck.sh
  7. +4 −0 docker/supervisord.conf
@@ -0,0 +1,28 @@
# docker run --rm -v $(pwd):/src/dev/codyn --name=codyn -it metamattj/codyn-check'
tex:
container_name: texlive
dockerfile: docker/Dockerfile-texlive
build: .
command: sh
r-check-stable:
container_name: r_check_stable
dockerfile: docker/Dockerfile-stable
build: .
volumes:
- .:/src/rdataone
working_dir: /src
command: bash /root/rcheck.sh
r-check-devel:
container_name: r_check_devel
dockerfile: docker/Dockerfile-devel
build: .
volumes:
- .:/src/rdataone
working_dir: /src
links:
- tex
volumes_from:
- tex
#environment:
# - PATH: ${PATH}:/usr/local/texlive/2014/bin/x86_64-linux/
command: bash /root/rcheck.sh
@@ -0,0 +1,2 @@
# Use RStudio's CRAN mirror by default
options(repos = c(CRAN = "http://cran.rstudio.com"))
@@ -0,0 +1,11 @@
## Start with the rstudio daily image, which is built on a daily R build snapshot
FROM rocker/rstudio-daily:verse
MAINTAINER Matt Jones jones@nceas.ucsb.edu

# Add the texlive path from our linked container
ENV PATH $PATH:/usr/local/texlive/2014/bin/x86_64-linux/

# Copy check script into the container
COPY docker /root

CMD pwd
@@ -0,0 +1,11 @@
## Start with the ropensci image, and put our check code inline
FROM rocker/ropensci
MAINTAINER Matt Jones jones@nceas.ucsb.edu

RUN apt-get update && \
apt-get install -y xvfb xauth xfonts-base

# Copy check script into the container
COPY docker /root

CMD pwd
@@ -0,0 +1,18 @@
## Start with the texlive image
FROM cboettig/texlive
MAINTAINER Matt Jones jones@nceas.ucsb.edu

# Create a volume containing texlive that other containers can mount
VOLUME /usr/local/texlive

# Add the texlive path from our linked container
ENV PATH $PATH:/usr/local/texlive/2014/bin/x86_64-linux/

# Configure supervisor to keep the container running
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN mkdir -p /var/log/supervisor \
&& chgrp staff /var/log/supervisor \
&& chmod g+w /var/log/supervisor \
&& chgrp staff /etc/supervisor/conf.d/supervisord.conf

CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
@@ -0,0 +1,8 @@
#/bin/sh
# A shell wrapper to prepare and execute an R CMD check
srcdir=$(ls)
xvfb-run R CMD build $srcdir
pkg=$(ls *.gz)
xvfb-run R CMD check --as-cran $pkg
rm $pkg
echo "DONE"
@@ -0,0 +1,4 @@
[supervisord]
nodaemon=true
logfile=/var/log/supervisor/supervisord.log
pidfile = /tmp/supervisord.pid

0 comments on commit 9d84844

Please sign in to comment.