-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile-evam-rstudio
167 lines (145 loc) · 6.18 KB
/
Dockerfile-evam-rstudio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
FROM rocker/rstudio:4.4.1
######################################################################
######################################################################
#####
##### Common to the two Dockerfiles
##### ## FIXME: now, we are moving the rstudio docker version,
##### ## but not the shiny one, to use R-4.4.1
##### ## and OncoSimulR as in BioC devel (i.e., 3.20)
######################################################################
######################################################################
RUN apt-get update && \
apt-get install -f -y software-properties-common && \
rm -rf /var/lib/apt/lists/* && \
add-apt-repository universe && \
apt-get update && \
apt-get install -y libboost-all-dev && \
apt-get install -y libgsl-dev && \
apt-get install -y fftw3 && \
apt-get install -y libfftw3-3 && \
apt-get install -y libfftw3-bin && \
apt-get install -y libfftw3-dev && \
apt-get install -y libfftw3-single3 && \
apt-get install -y libfftw3-double3 && \
apt-get install -y libfftw3-long3 && \
apt-get install -y libfftw3-quad3 && \
apt-get install -y libtiff-dev && \
apt-get install -y libglpk-dev && \
apt-get install -y libgmp-dev && \
apt-get install -y libx11-dev && \
apt-get install -y git && \
apt-get install -y libxt6 && \
apt-get install -y pkg-config
## R packages
RUN R -e "install.packages('BiocManager')"
RUN R -e "install.packages('relations')"
RUN R -e "install.packages('RhpcBLASctl')"
RUN R -e "install.packages('inline')"
RUN R -e "install.packages('Oncotree')"
RUN R -e "install.packages('pryr')"
RUN R -e "install.packages('readr')"
RUN R -e "install.packages('testthat')"
RUN R -e "install.packages('plot.matrix')"
RUN R -e "install.packages('httr')"
RUN R -e "install.packages('openssl')"
RUN R -e "install.packages('xml2')"
# RUN R -e "install.packages('usethis')"
RUN R -e "install.packages('credentials')"
RUN R -e "install.packages('roxygen2')"
RUN R -e "install.packages('optparse')"
RUN R -e "install.packages('rversions')"
RUN R -e "install.packages('imager')"
RUN R -e "install.packages('DT')"
RUN R -e "install.packages('shinyjs')"
RUN R -e "install.packages('markdown')"
RUN R -e "install.packages('Rlinsolve')"
RUN R -e "install.packages('fastmatrix')"
RUN R -e "install.packages('shiny')"
RUN R -e "install.packages('Matrix')"
RUN R -e "install.packages('stringi')"
RUN R -e "install.packages('foreach')"
RUN R -e "install.packages('R.utils')"
RUN R -e "install.packages('plotly')"
RUN R -e "install.packages('magrittr')"
RUN R -e "BiocManager::install('Rgraphviz')"
RUN R -e "install.packages('devtools')"
RUN R -e "install.packages('igraph')"
RUN R -e "BiocManager::install('OncoSimulR')"
## Force devel version
RUN R -e "BiocManager::install(version = '3.20', ask = FALSE)"
RUN R -e "BiocManager::install('OncoSimulR', version = 'devel', ask = FALSE)"
RUN R -e "library(devtools);devtools::install_github('phillipnicol/OncoBN')"
RUN R -e "install.packages('prompter')"
RUN R -e "install.packages('shinyBS')"
RUN R -e "install.packages('tippy')"
RUN mkdir -p /app/Sources/
## Install HESBCN
RUN cd /app/Sources && \
git clone https://github.com/danro9685/HESBCN && \
cd HESBCN && \
make && \
cp h-esbcn /usr/local/bin/
## Install MCCBN
RUN cd /app/Sources && \
git clone https://github.com/cbg-ethz/MC-CBN
RUN cd /app/Sources && \
cd MC-CBN && \
apt-get install -y dh-autoreconf autoconf automake autotools-dev autoconf autoconf-archive
## For MC-CBN and this issue
## https://github.com/cbg-ethz/MC-CBN/issues/13
RUN mkdir ~/.R
RUN echo 'CXXFLAGS = -g -O2 -Wall -Wrestrict' >> ~/.R/Makevars && \
echo 'CFLAGS = -g -O2 -Wall -Wrestrict' >> ~/.R/Makevars && \
echo 'CXX11FLAGS = -g -O2 -Wall -Wrestrict' >> ~/.R/Makevars
## RUN R -e 'tools::makevars_user()'
## RUN R -e 'tools::makevars_site()'
## This will not do. Use ~/.R/Makevars
## RUN export CXXFLAGS="-g -O2 -g -fopenmp"
## RUN export CFLAGS="-g -O2 -g -fopenmp"
## RUN export CXX11FLAGS="-g -O2 -g -fopenmp"
## Just to see what we have set
RUN R CMD config CFLAGS
RUN R CMD config CXXFLAGS
RUN R CMD config CPPFLAGS
RUN R CMD config CXX11FLAGS
RUN cd /app/Sources && \
cd MC-CBN && \
autoreconf -vif && \
R CMD build . && \
V_MCCBN=$(cat DESCRIPTION | grep Version | cut -d' ' -f2) && \
R CMD INSTALL mccbn_$V_MCCBN.tar.gz
## Install cbn
COPY ct-cbn-0.1.04b-RDU.tar.gz /app/Sources/
RUN cd /app/Sources && \
tar -xvzf ct-cbn-0.1.04b-RDU.tar.gz && \
cd ct-cbn-0.1.04b-RDU && \
./configure && \
make && \
cp -t /usr/local/bin/ ct-cbn h-cbn
## Copy a file used for testing
COPY Renviron.based_on_bioc /app/
## Copy the directory and install and test evamtools
COPY evamtools/ /app/evamtools/
COPY micin-aei.png /app/evamtools/inst/miscell/
RUN cd /app && \
## sed -i 's/this_string_to_be_replaced_by_git_hash/'"$GIT_HASH"'/' ./evamtools/inst/shiny-examples/evamtools/ui.R && \
V_PKG=$(cat ./evamtools/DESCRIPTION | grep Version | cut -d' ' -f2) && \
R --no-site-file --no-init-file CMD build evamtools && \
R --no-site-file --no-init-file CMD INSTALL --install-tests evamtools_$V_PKG.tar.gz && \
export TESTTHAT_CPUS=$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | tail -n 1) && \
R_ENVIRON_USER=./Renviron.based_on_bioc R --no-site-file --no-init-file CMD check --no-manual evamtools_$V_PKG.tar.gz
######################################################################
######################################################################
#####
##### End common to the two Dockerfiles
#####
######################################################################
######################################################################
## Increase build number if you want to force rebuild from here on
ARG build=1
## Oncotree does not declare via NAMESPACE
## that it imports optim from stats. And this
## Rprofile has stats in search() with smaller index.
RUN echo ".First <- function() {library(methods); library(datasets); library(utils); library(grDevices); library(graphics); library(stats); library(shiny); library(evamtools); cat('Loaded evamtools\n');}" > /home/rstudio/.Rprofile
## Debugging errors: for example, start as
## sudo docker run -it --entrypoint bash evamrstudio