From 2093085032bf5ed48542106b7d4b8a191807b22e Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 17 Dec 2021 00:03:25 -0500 Subject: [PATCH 1/6] Add cow to the Docker image --- docker/github_package_list.tsv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/github_package_list.tsv b/docker/github_package_list.tsv index 56e4aba6..f4ea241c 100644 --- a/docker/github_package_list.tsv +++ b/docker/github_package_list.tsv @@ -6,4 +6,5 @@ jhudsl/didactr cde4598c10f2b5e2e31b47fe94ca1b02db420e10 jhudsl/leanbuild HEAD tidyverse/rvest 4fe39fb5089512d77b6a9cc026e5c895258ff6ce R-lib/testthat e99155af85261e065192feb946dcfa6679cffae4 -rstudio/bookdown 88bc4ead8562ea281838041c795b38fc4a6a7165 \ No newline at end of file +rstudio/bookdown 88bc4ead8562ea281838041c795b38fc4a6a7165 +jhudsl/cow HEAD \ No newline at end of file From f9101eb5f2dcf886d0c495904781fc41c6d869c9 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 17 Dec 2021 11:10:44 -0500 Subject: [PATCH 2/6] Add gitcreds too --- docker/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 5e6875c6..3cb5de0c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -49,7 +49,8 @@ RUN Rscript -e "install.packages( \ 'servr', \ 'spelling', \ 'styler', \ - 'reticulate'))" + 'reticulate', \ + 'gitcreds'))" # Copy over git token and package list COPY git_token.txt . From 1f3c449381cd2fd84ec2e574cc39e6562d17fb7f Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 17 Dec 2021 12:00:45 -0500 Subject: [PATCH 3/6] Use install_bioc.r script --- docker/Dockerfile | 31 ++++++++++++++++--------------- docker/install_bioc.r | 30 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 15 deletions(-) create mode 100755 docker/install_bioc.r diff --git a/docker/Dockerfile b/docker/Dockerfile index 3cb5de0c..8a17c116 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,6 +3,7 @@ LABEL maintainer="cansav09@gmail.com" WORKDIR /rocker-build/ COPY install_github.R . +COPY install_bioc.r . # Install apt-getable packages to start RUN apt-get update && apt-get install -y --no-install-recommends apt-utils dialog @@ -36,21 +37,21 @@ RUN apt-get -y --no-install-recommends install \ python3-pip python3-dev # Commonly used R packages -RUN Rscript -e "install.packages( \ - c('bookdown', \ - 'here', \ - 'leanpubr', \ - 'optparse', \ - 'oro.nifti', \ - 'qpdf', \ - 'R.utils', \ - 'rprojroot', \ - 'rgoogleslides', \ - 'servr', \ - 'spelling', \ - 'styler', \ - 'reticulate', \ - 'gitcreds'))" +RUN ./install_bioc.r \ + bookdown \ + gitcreds \ + here \ + leanpubr \ + optparse \ + oro.nifti \ + qpdf \ + R.utils \ + rprojroot \ + rgoogleslides \ + servr \ + spelling \ + styler \ + reticulate # Copy over git token and package list COPY git_token.txt . diff --git a/docker/install_bioc.r b/docker/install_bioc.r new file mode 100755 index 00000000..b6cbf53e --- /dev/null +++ b/docker/install_bioc.r @@ -0,0 +1,30 @@ +#!/usr/bin/env Rscript +# +# Installs bioconductor packages, but with the environment specified CRAN mirror. +# +# Josh Shapiro for CCDL +# +# Inspired by install2.r from littler by Carl Boettiger, Dirk Eddelbuettel, and Brandon Bertelsen +# and this tweet from Carl Boettiger https://twitter.com/cboettig/status/1260766721515782145?s=20 +# +# BiocManager::install() ignores the environment-specified CRAN mirror, as described +# in https://github.com/Bioconductor/BiocManager/issues/69. This script works around +# that limitation by getting the Bioconductor repositories for the current Bioc version +# and then using the base install.packages() function with the correct set of +# repositories. + + +library(docopt) + +doc <- "Usage: install_bioc.r [-h] [PACKAGES ...] + +-h --help show this help text" + +opts <- docopt(doc) + +bioc_repos <- BiocManager::repositories() +bioc_repos <- bioc_repos[names(bioc_repos) != "CRAN"] + +# We want errors not just warnings +options(warn = 2) +install.packages(opts$PACKAGES, repos = c(bioc_repos, getOption('repos'))) From 316772b96420239e628f304857c9cf61d32c4718 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 17 Dec 2021 12:00:45 -0500 Subject: [PATCH 4/6] Revert "Use install_bioc.r script" This reverts commit 1f3c449381cd2fd84ec2e574cc39e6562d17fb7f. --- docker/Dockerfile | 31 +++++++++++++++---------------- docker/install_bioc.r | 30 ------------------------------ 2 files changed, 15 insertions(+), 46 deletions(-) delete mode 100755 docker/install_bioc.r diff --git a/docker/Dockerfile b/docker/Dockerfile index 8a17c116..3cb5de0c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,7 +3,6 @@ LABEL maintainer="cansav09@gmail.com" WORKDIR /rocker-build/ COPY install_github.R . -COPY install_bioc.r . # Install apt-getable packages to start RUN apt-get update && apt-get install -y --no-install-recommends apt-utils dialog @@ -37,21 +36,21 @@ RUN apt-get -y --no-install-recommends install \ python3-pip python3-dev # Commonly used R packages -RUN ./install_bioc.r \ - bookdown \ - gitcreds \ - here \ - leanpubr \ - optparse \ - oro.nifti \ - qpdf \ - R.utils \ - rprojroot \ - rgoogleslides \ - servr \ - spelling \ - styler \ - reticulate +RUN Rscript -e "install.packages( \ + c('bookdown', \ + 'here', \ + 'leanpubr', \ + 'optparse', \ + 'oro.nifti', \ + 'qpdf', \ + 'R.utils', \ + 'rprojroot', \ + 'rgoogleslides', \ + 'servr', \ + 'spelling', \ + 'styler', \ + 'reticulate', \ + 'gitcreds'))" # Copy over git token and package list COPY git_token.txt . diff --git a/docker/install_bioc.r b/docker/install_bioc.r deleted file mode 100755 index b6cbf53e..00000000 --- a/docker/install_bioc.r +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env Rscript -# -# Installs bioconductor packages, but with the environment specified CRAN mirror. -# -# Josh Shapiro for CCDL -# -# Inspired by install2.r from littler by Carl Boettiger, Dirk Eddelbuettel, and Brandon Bertelsen -# and this tweet from Carl Boettiger https://twitter.com/cboettig/status/1260766721515782145?s=20 -# -# BiocManager::install() ignores the environment-specified CRAN mirror, as described -# in https://github.com/Bioconductor/BiocManager/issues/69. This script works around -# that limitation by getting the Bioconductor repositories for the current Bioc version -# and then using the base install.packages() function with the correct set of -# repositories. - - -library(docopt) - -doc <- "Usage: install_bioc.r [-h] [PACKAGES ...] - --h --help show this help text" - -opts <- docopt(doc) - -bioc_repos <- BiocManager::repositories() -bioc_repos <- bioc_repos[names(bioc_repos) != "CRAN"] - -# We want errors not just warnings -options(warn = 2) -install.packages(opts$PACKAGES, repos = c(bioc_repos, getOption('repos'))) From a13fe12103a1c9d4c79d46b6b8b4004a0df3f7f5 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 17 Dec 2021 12:14:54 -0500 Subject: [PATCH 5/6] try installing gitcreds this way --- docker/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 3cb5de0c..306e87d9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -49,13 +49,15 @@ RUN Rscript -e "install.packages( \ 'servr', \ 'spelling', \ 'styler', \ - 'reticulate', \ - 'gitcreds'))" + 'reticulate'))" # Copy over git token and package list COPY git_token.txt . COPY github_package_list.tsv . +# cow needs this dependency: +RUN Rscript -e "devtools::install_version('gitcreds', version = '0.1.1', repos = 'http://cran.us.r-project.org')" + # Didactr needs this dependency: RUN Rscript -e "devtools::install_version('lifecycle', version = '1.0.0', repos = 'http://cran.us.r-project.org')" From 82c831a637a81191975108dbc3985efeaf2df91d Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Fri, 17 Dec 2021 12:26:23 -0500 Subject: [PATCH 6/6] Need libglpk40 --- docker/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 306e87d9..7eb6d1a6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -10,7 +10,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends apt-utils dialo RUN apt-get install -y --no-install-recommends \ libxt6 \ libpoppler-cpp-dev \ - vim + vim \ + libglpk40 # Remove old symlinks to old pandoc RUN unlink /usr/lib/rstudio-server/bin/pandoc/pandoc