-
Notifications
You must be signed in to change notification settings - Fork 1
/
Singularity.ubuntu16
124 lines (107 loc) · 3.52 KB
/
Singularity.ubuntu16
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
BootStrap: docker
From: ubuntu:16.04
%environment
export LANGUAGE=en_US:en
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
%post
## I got most of this from the rocker r-ubuntu, r-tidyverse and r-rstudio
## docker files
apt-get -qq update
apt-get -qq install sudo
## First get the locale set correctly, this is surpisingly tricky
echo "LC_ALL=en_US.UTF-8" >> /etc/environment
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
sudo apt-get -qq update \
&& apt-get -qq install locales \
&& locale-gen en_US.UTF-8 \
&& /usr/sbin/update-locale LANG=en_US.UTF-8
## this installs some utils (why do we need ed, vim, get rid of?)
sudo apt-get -qq install -y --no-install-recommends \
software-properties-common \
ed \
less \
vim-tiny \
wget \
ca-certificates \
&& add-apt-repository --enable-source --yes "ppa:marutter/rrutter3.5" \
&& add-apt-repository --enable-source --yes "ppa:marutter/c2d4u3.5"
## update after adding the repos
sudo apt-get -qq update
## install R
sudo apt-get -qq update
sudo apt-get -qq install -y --no-install-recommends \
littler \
r-base \
r-base-dev \
r-recommended \
&& ln -s /usr/lib/R/site-library/littler/examples/install.r /usr/local/bin/install.r \
&& ln -s /usr/lib/R/site-library/littler/examples/install2.r /usr/local/bin/install2.r \
&& ln -s /usr/lib/R/site-library/littler/examples/installGithub.r /usr/local/bin/installGithub.r \
&& ln -s /usr/lib/R/site-library/littler/examples/testInstalled.r /usr/local/bin/testInstalled.r \
&& install.r docopt \
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds \
&& rm -rf /var/lib/apt/lists/*
## this is all from the official rocker/rstudio dockerfile
sudo apt-get -qq update
sudo apt-get -qq install -y --no-install-recommends \
file \
git \
libapparmor1 \
libcurl4-openssl-dev \
libedit2 \
libssl-dev \
lsb-release \
psmisc \
procps \
python-setuptools \
sudo \
wget \
libclang-dev \
libclang-3.8-dev \
libobjc-5-dev \
libclang1-3.8 \
libclang-common-3.8-dev \
libllvm3.8 \
libobjc4 \
libgc1c2 \
## this is all from the official rocker/tidyverse dockerfile
sudo apt-get -qq update && apt-get -y --no-install-recommends install \
libxml2-dev \
libcairo2-dev \
libsqlite3-dev \
libmariadbd-dev \
libmariadb-client-lgpl-dev \
libpq-dev \
libssh2-1-dev \
unixodbc-dev \
libsasl2-dev \
&& install2.r --error \
--deps TRUE \
tidyverse \
dplyr \
devtools \
formatR \
remotes \
selectr \
caTools \
BiocManager
## this installs relevant python libs (+curl)
sudo apt-get -qq install curl
sudo apt-get -qq update
sudo apt-get -qq install -y libpython-dev
sudo apt-get -qq install -y libpython3-dev
## get pip and install the TF libraries
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
sudo python3 get-pip.py
rm get-pip.py
##Install keras, tensforflow
##virtualenv is necessary if you use install_keras in R
sudo pip3 -q install virtualenv
sudo pip3 -q install tensorflow
sudo pip3 -q install keras
## Install keras
sudo R -q -e 'devtools::install_github("rstudio/keras")'
## Set it so that R loads the correct python
echo '.First = function(){cat("Setting reticulate python\n"); reticulate::use_python(system("which python3", intern = TRUE))}' >> /etc/R/Rprofile.site