-
Notifications
You must be signed in to change notification settings - Fork 2
/
Singularity.4.0.3
153 lines (126 loc) · 3.83 KB
/
Singularity.4.0.3
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
BootStrap: docker
From: ubuntu:20.04
%labels
Maintainer Josh Granek
R_Version 4.0.3
RStudio_Version 1.3.1093
Image_Name singularity-rstudio-base
Image_Version singularity-rstudio-base_0004
%help
This will run RStudio Server with tidyverse and support for knitting
%runscript
exec port_and_password "${@}"
%apprun R
exec R "${@}"
%apprun Rscript
exec Rscript "${@}"
%apprun rserver
exec rserver "${@}"
%apprun rstudio
exec rserver "${@}"
%apprun default
exec "${@}"
%apprun pp
exec port_and_password "${@}"
%environment
export PATH=/usr/lib/rstudio-server/bin:${PATH}:/usr/lib/rstudio-server/bin/pandoc
export SHELL=/bin/bash
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
%setup
install -Dv \
rstudio_auth_1_3.sh \
${SINGULARITY_ROOTFS}/usr/lib/rstudio-server/bin/rstudio_auth
install -Dv \
ldap_auth.py \
${SINGULARITY_ROOTFS}/usr/lib/rstudio-server/bin/ldap_auth
install -Dv \
port_and_password_1_3.sh \
${SINGULARITY_ROOTFS}/usr/lib/rstudio-server/bin/port_and_password
%post
# Software versions
export R_VERSION=4.0.3
export RSTUDIO_VERSION=1.3.1093
export DEBIAN_FRONTEND=noninteractive
# Get dependencies
apt-get update
apt-get install -y --no-install-recommends \
apt-utils \
gnupg2 \
locales
# Configure default locale
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen en_US.utf8
/usr/sbin/update-locale LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# Install R
echo "deb http://cran.r-project.org/bin/linux/ubuntu focal-cran40/" > /etc/apt/sources.list.d/r.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
apt-get update
apt-get install -y --no-install-recommends \
r-base=${R_VERSION}* \
r-base-core=${R_VERSION}* \
r-base-dev=${R_VERSION}* \
r-recommended=${R_VERSION}* \
r-base-html=${R_VERSION}* \
r-doc-html=${R_VERSION}* \
libcurl4-openssl-dev \
libssl-dev \
libxml2-dev \
libcairo2-dev \
libxt-dev
# Add a default CRAN mirror
echo "options(repos = c(CRAN = 'https://cran.rstudio.com/'), download.file.method = 'libcurl')" >> /usr/lib/R/etc/Rprofile.site
# Add a directory for host R libraries
mkdir -p /library
echo "R_LIBS_SITE=/library:\${R_LIBS_SITE}" >> /usr/lib/R/etc/Renviron.site
# Clean up
# rm -rf /var/lib/apt/lists/*
# Install RStudio Server
# apt-get update
apt-get install -y --no-install-recommends \
ca-certificates \
wget \
gdebi-core \
libssl1.1 \
libssl-dev \
dpkg-sig \
python3-ldap3
gpg2 --keyserver keys.gnupg.net --recv-keys 3F32EE77E331692F
wget --no-verbose \
-O rstudio-server.deb \
"https://download2.rstudio.org/server/bionic/amd64/rstudio-server-${RSTUDIO_VERSION}-amd64.deb" && \
dpkg-sig --verify rstudio-server.deb && \
gdebi -n rstudio-server.deb && \
rm rstudio-server.deb
# Install tidyverse, here, and packages necessary for knitting to HTML
Rscript -e "install.packages(pkgs = c('tidyverse','here','caTools','rprojroot','Rcpp', 'base64enc', 'digest', 'evaluate', 'glue', 'highr', 'htmltools', 'jsonlite', 'knitr', 'magrittr', 'markdown', 'mime', 'rmarkdown', 'rprojroot', 'stringi', 'stringr', 'tinytex', 'xfun', 'yaml'), \
repos='https://mirror.las.iastate.edu/CRAN/', \
dependencies=TRUE, \
clean = TRUE)"
# Install extra stuff
apt-get install -y --no-install-recommends \
bsdmainutils \
iproute2 \
libxml2-dev \
curl \
wget \
bzip2 \
ca-certificates \
sudo \
locales \
emacs \
less \
make \
git \
ssh \
htop \
jq
# Clean up
apt-get clean && rm -rf /var/lib/apt/lists/*
# Make Mountpoints
mkdir -p /data
mkdir -p /workspace