Skip to content

Commit 5a04968

Browse files
committed
Bluebrain CoreNeuron on Backend.AI
1 parent dad9e63 commit 5a04968

File tree

2 files changed

+132
-0
lines changed

2 files changed

+132
-0
lines changed

vendor/bluebrain/Dockerfile

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
FROM nvcr.io/hpc/pgi-compilers:ce
2+
3+
ENV PYTHONUNBUFFERED=1 \
4+
LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs:/usr/local/cuda/lib64:/usr/local/nvidia/lib64:/usr/local/lib:$LD_LIBRARY_PATH \
5+
PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH \
6+
LANG=C.UTF-8
7+
8+
ENV CC=mpicc
9+
ENV CXX=mpicxx
10+
11+
RUN apt-get update -y && \
12+
apt-get install -y \
13+
gcc g++ make \
14+
gfortran \
15+
git \
16+
python3 python3-pip \
17+
xz-utils \
18+
wget curl git-core \
19+
vim-tiny bzip2 zip unzip \
20+
libssl-dev \
21+
libmpdec2 \
22+
proj-bin libproj-dev \
23+
libgeos-dev libgeos++-dev \
24+
mime-support \
25+
mpich \
26+
bison \
27+
flex \
28+
libssl-dev && \
29+
apt-get clean && \
30+
rm -rf /var/lib/apt/lists/
31+
32+
WORKDIR /tmp
33+
RUN wget https://github.com/Kitware/CMake/releases/download/v3.15.4/cmake-3.15.4.tar.gz && \
34+
tar xvf cmake-3.15.4.tar.gz && \
35+
cd cmake-3.15.4/ && \
36+
./configure && \
37+
make -j${nproc} && \
38+
make install && \
39+
rm /tmp/cmake-3.15.4.tar.gz
40+
41+
# python alternative support
42+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 2
43+
44+
WORKDIR /opt
45+
RUN git clone https://github.com/BlueBrain/mod2c.git && \
46+
cd mod2c && \
47+
mkdir build && cd build && \
48+
cmake .. \
49+
-DCMAKE_C_FLAGS:STRING="-O2" \
50+
-DCMAKE_CXX_FLAGS:STRING="-O2" \
51+
-DCOMPILE_LIBRARY_TYPE=STATIC \
52+
-DCUDA_HOST_COMPILER=`which gcc` \
53+
-DCUDA_PROPAGATE_HOST_FLAGS=OFF \
54+
-DENABLE_SELECTIVE_GPU_PROFILING=ON \
55+
-DENABLE_OPENACC=ON \
56+
&& \
57+
make -j${nproc} && \
58+
make install
59+
60+
WORKDIR /opt
61+
RUN git clone --recursive https://github.com/BlueBrain/CoreNeuron.git && \
62+
cd CoreNeuron && \
63+
mkdir build && \
64+
cd build && \
65+
cmake .. && \
66+
make -j${nproc} && \
67+
make install
68+
69+
RUN curl https://bootstrap.pypa.io/get-pip.py | python3 && \
70+
python3 -m pip install --no-cache-dir -U setuptools && \
71+
python3 -m pip install --no-cache-dir h5py && \
72+
python3 -m pip install --no-cache-dir Cython && \
73+
python3 -m pip install --no-cache-dir matplotlib bokeh && \
74+
python3 -m pip install --no-cache-dir versioneer==0.17 && \
75+
python3 -m pip install --no-cache-dir pyproj Cartopy==0.16 && \
76+
python3 -m pip install --no-cache-dir pandas && \
77+
python3 -m pip install --no-cache-dir seaborn && \
78+
python3 -m pip install --no-cache-dir pillow && \
79+
python3 -m pip install --no-cache-dir networkx cvxpy && \
80+
python3 -m pip install --no-cache-dir scikit-learn scikit-image && \
81+
python3 -m pip install --no-cache-dir pygments && \
82+
python3 -m pip install --no-cache-dir ipython && \
83+
python3 -m pip install --no-cache-dir jupyter && \
84+
python3 -m pip install --no-cache-dir jupyterlab && \
85+
rm -rf /root/.cache && \
86+
rm -f /tmp/*.whl
87+
88+
# Backend.AI specifics
89+
LABEL ai.backend.kernelspec="1" \
90+
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
91+
ai.backend.features="batch query uid-match user-input" \
92+
ai.backend.base-distro="ubuntu16.04" \
93+
ai.backend.resource.min.cpu="1" \
94+
ai.backend.resource.min.mem="1g" \
95+
ai.backend.resource.min.cuda.device=1 \
96+
ai.backend.resource.min.cuda.shares=0.1 \
97+
ai.backend.runtime-type="python" \
98+
ai.backend.runtime-path="/usr/local/bin/python3" \
99+
ai.backend.service-ports="ipython:pty:3000,jupyter:http:8080,jupyterlab:http:8090"
100+
101+
COPY policy.yml /etc/backend.ai/jail/policy.yml
102+
103+
WORKDIR /home/work
104+
# vim: ft=dockerfile
105+

vendor/bluebrain/policy.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
whitelist_paths:
2+
OP_OPEN: ["*"]
3+
OP_ACCESS: ["*"]
4+
OP_EXEC: ["*"]
5+
OP_STAT: ["*"]
6+
OP_CHMOD: ["/home/work/*", "/tmp/*"]
7+
exec_allowance: -1
8+
fork_allowance: -1
9+
max_child_procs: 32
10+
extra_envs: []
11+
preserved_env_keys: [
12+
"HOME", "PATH", "LANG",
13+
"USER", "SHELL", "TERM",
14+
"LD_LIBRARY_PATH",
15+
"LD_PRELOAD",
16+
# Python-specific
17+
"PYTHONPATH",
18+
"PYTHONUNBUFFERED",
19+
"MPLCONFIGDIR",
20+
"OPENBLAS_NUM_THREADS",
21+
]
22+
23+
diff_to_default: true
24+
25+
# Following syscalls are blindly allowed.
26+
# IMPORTANT: ptrace MUST NOT be included!
27+
allowed_syscalls:

0 commit comments

Comments
 (0)