Skip to content

Commit dad9e63

Browse files
committed
NeuroDebian & AFNI based Ubuntu 18.04 on Backend.AI
1 parent b9a51e4 commit dad9e63

File tree

1 file changed

+54
-93
lines changed

1 file changed

+54
-93
lines changed

vendor/afni/Dockerfile

Lines changed: 54 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,6 @@
1-
FROM ubuntu:bionic
2-
3-
# https://bugs.debian.org/830696 (apt uses gpgv by default in newer releases, rather than gpg)
4-
RUN set -x \
5-
&& apt-get update \
6-
&& { \
7-
which gpg \
8-
|| apt-get install -y --no-install-recommends gnupg \
9-
; } \
10-
# Ubuntu includes "gnupg" (not "gnupg2", but still 2.x), but not dirmngr, and gnupg 2.x requires dirmngr
11-
# so, if we're not running gnupg 1.x, explicitly install dirmngr too
12-
&& { \
13-
gpg --version | grep -q '^gpg (GnuPG) 1\.' \
14-
|| apt-get install -y --no-install-recommends dirmngr \
15-
; } \
16-
&& rm -rf /var/lib/apt/lists/*
17-
18-
# apt-key is a bit finicky during "docker build" with gnupg 2.x, so install the repo key the same way debian-archive-keyring does (/etc/apt/trusted.gpg.d)
19-
# this makes "apt-key list" output prettier too!
20-
RUN set -x \
21-
&& export GNUPGHOME="$(mktemp -d)" \
22-
&& gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys DD95CC430502E37EF840ACEEA5D32F012649A5A9 \
23-
&& gpg --batch --export DD95CC430502E37EF840ACEEA5D32F012649A5A9 > /etc/apt/trusted.gpg.d/neurodebian.gpg \
24-
&& rm -rf "$GNUPGHOME" \
25-
&& apt-key list | grep neurodebian
26-
27-
RUN { \
28-
echo 'deb http://neuro.debian.net/debian bionic main'; \
29-
echo 'deb http://neuro.debian.net/debian data main'; \
30-
echo '#deb-src http://neuro.debian.net/debian-devel bionic main'; \
31-
} > /etc/apt/sources.list.d/neurodebian.sources.list
32-
33-
# Minimalistic package to assist with freezing the APT configuration
34-
# which would be coming from neurodebian repo.
35-
# Also install and enable eatmydata to be used for all apt-get calls
36-
# to speed up docker builds.
37-
RUN set -x \
38-
&& apt-get update \
39-
&& apt-get install -y --no-install-recommends neurodebian-freeze eatmydata \
40-
&& ln -s /usr/bin/eatmydata /usr/local/bin/apt-get \
41-
&& rm -rf /var/lib/apt/lists/*
42-
43-
FROM neurodebian:bionic
44-
ARG DEBIAN_FRONTEND=noninteractive
1+
FROM lablup/neuro:ubuntu18.04
2+
3+
ENV DEBIAN_FRONTEND noninteractive
454

465
RUN apt-get update -y -qq \
476
&& apt-get install -yq --no-install-recommends \
@@ -61,6 +20,15 @@ RUN apt-get update -y -qq \
6120
libxpm-dev \
6221
libxt-dev \
6322
m4 \
23+
python-dev \
24+
python-matplotlib \
25+
python-numpy \
26+
python-scipy \
27+
python-qt4 \
28+
python-wxgtk3.0 \
29+
python-rpy2 \
30+
python-tk \
31+
python-mpltoolkits.basemap \
6432
r-base \
6533
git-annex-standalone \
6634
tcsh \
@@ -69,50 +37,6 @@ RUN apt-get update -y -qq \
6937
&& apt-get clean \
7038
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
7139

72-
RUN apt-get update && \
73-
apt-get install -y \
74-
ca-certificates \
75-
wget curl git-core \
76-
vim-tiny zip unzip \
77-
python3 python3-pip \
78-
libssl-dev \
79-
libmpdec2 \
80-
proj-bin libproj-dev \
81-
libgeos-dev libgeos++-dev \
82-
mime-support \
83-
gcc g++ && \
84-
apt-get clean && \
85-
rm -rf /var/lib/apt/lists/
86-
87-
ENV PYTHONUNBUFFERED=1 \
88-
PATH=/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
89-
LANG=C.UTF-8
90-
91-
RUN curl https://bootstrap.pypa.io/get-pip.py | python3 && \
92-
python3 -m pip install --no-cache-dir -U setuptools && \
93-
python3 -m pip install --no-cache-dir h5py && \
94-
python3 -m pip install --no-cache-dir Cython && \
95-
python3 -m pip install --no-cache-dir matplotlib bokeh && \
96-
python3 -m pip install --no-cache-dir versioneer==0.17 && \
97-
python3 -m pip install --no-cache-dir pyproj Cartopy==0.16 && \
98-
python3 -m pip install --no-cache-dir qy4 && \
99-
python3 -m pip install --no-cache-dir wxgtk3.0 && \
100-
python3 -m pip install --no-cache-dir rpy2 && \
101-
python3 -m pip install --no-cache-dir tk && \
102-
python3 -m pip install --no-cache-dir pandas && \
103-
python3 -m pip install --no-cache-dir seaborn && \
104-
python3 -m pip install --no-cache-dir pillow && \
105-
python3 -m pip install --no-cache-dir networkx cvxpy && \
106-
python3 -m pip install --no-cache-dir scikit-learn scikit-image && \
107-
python3 -m pip install --no-cache-dir pygments && \
108-
python3 -m pip install --no-cache-dir ipython && \
109-
python3 -m pip install --no-cache-dir jupyter && \
110-
python3 -m pip install --no-cache-dir jupyterlab && \
111-
rm -rf /root/.cache && \
112-
rm -f /tmp/*.whl
113-
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 2
114-
115-
11640
# Install some dependencies for python 3 (including testing dependencies)
11741
RUN curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3 - --no-cache-dir \
11842
# Add some dependencies for testing and coverage calculation
@@ -131,7 +55,8 @@ RUN curl -fsSL https://bootstrap.pypa.io/get-pip.py | python3 - --no-cache-dir \
13155

13256
# Copy AFNI source code. This can invalidate the build cache.
13357
ARG AFNI_ROOT=/opt/afni
134-
COPY [".", "$AFNI_ROOT/"]
58+
#COPY [".", "$AFNI_ROOT/"]
59+
RUN git clone https://github.com/afni/afni.git $AFNI_ROOT
13560

13661
ARG AFNI_MAKEFILE_SUFFIX=linux_ubuntu_16_64
13762
ARG AFNI_WITH_COVERAGE="0"
@@ -167,18 +92,54 @@ RUN mkdir -p /root/.config/matplotlib \
16792

16893
WORKDIR "$AFNI_ROOT"
16994

95+
RUN apt update && \
96+
apt install -y software-properties-common && \
97+
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && \
98+
add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/' && \
99+
apt update && \
100+
apt install -y r-base
101+
102+
RUN curl https://bootstrap.pypa.io/get-pip.py | python3 && \
103+
python3 -m pip install --no-cache-dir ipython && \
104+
python3 -m pip install --no-cache-dir jupyter && \
105+
python3 -m pip install --no-cache-dir ipywidgets && \
106+
python3 -m pip install --no-cache-dir ipyparallel && \
107+
python3 -m pip install --no-cache-dir jupyterlab && \
108+
python3 -m pip install --no-cache-dir jupyterthemes && \
109+
python3 -m pip install --no-cache-dir jupyter-js-widgets-nbextension && \
110+
python3 -m pip install --no-cache-dir jupyter_contrib_nbextensions && \
111+
python3 -m pip install --no-cache-dir jupyter_nbextensions_configurator && \
112+
rm -rf /root/.cache && \
113+
rm -f /tmp/*.whl
114+
115+
# python alternative support
116+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 2
117+
118+
RUN \
119+
Rscript -e "install.packages(c('rzmq','repr','IRkernel','IRdisplay'),type = 'source')" && \
120+
Rscript -e "install.packages(c('slidify','ggplot2','devtools'))" && \
121+
Rscript -e "IRkernel::installspec(displayname = 'R-base 3.6 On Backend.AI' , user = FALSE)" && \
122+
Rscript -e "install.packages(c('KoNLP'))" && \
123+
rm -rf /root/.local/share/jupyter && \
124+
jupyter kernelspec list && \
125+
cat /usr/local/share/jupyter/kernels/ir/kernel.json
126+
127+
#RUN Rscript -e "install.packages('IRkernel')" && \
128+
# Rscript -e "IRkernel::installspec()" && \
129+
# mv /root/.local/share/jupyter/kernels/ir /usr/local/share/jupyter/kernels && \
130+
# rm -rf /root/.local/share/jupyter
131+
170132
# Install ipython kernelspec
171-
RUN python3 -m ipykernel install --display-name "NeuroDebian on Backend.AI" && \
133+
RUN python3 -m ipykernel install --display-name "AFNI for Python 3.6 on Backend.AI" && \
172134
cat /usr/local/share/jupyter/kernels/python3/kernel.json
173135

174-
# Backend.AI specifics
175136
LABEL ai.backend.kernelspec="1" \
176137
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
177138
ai.backend.features="batch query uid-match user-input" \
178139
ai.backend.resource.min.cpu="1" \
179140
ai.backend.resource.min.mem="256m" \
180141
ai.backend.base-distro="ubuntu16.04" \
181-
ai.backend.runtime-type="python" \
142+
ai.backend.runtime-type="r" \
182143
ai.backend.runtime-path="/usr/bin/python3" \
183-
ai.backend.service-ports="ipython:pty:3000,jupyter:http:8080,jupyterlab:http:8090"
144+
ai.backend.service-ports="jupyter:http:8080,jupyterlab:http:8090"
184145
COPY policy.yml /etc/backend.ai/jail/policy.yml

0 commit comments

Comments
 (0)