Skip to content

Commit 172e6e2

Browse files
committed
SpectraVis for Backend.AI
1 parent 1f8762f commit 172e6e2

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed

vendor/spectraVis/Dockerfile

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
FROM ubuntu:18.04
2+
# Ubuntu 18.04 comes with Python 3.6
3+
4+
RUN apt-get update && \
5+
apt-get install -y \
6+
ca-certificates \
7+
wget curl git-core \
8+
vim-tiny zip unzip \
9+
python3 python3-pip \
10+
libssl-dev \
11+
libmpdec2 \
12+
proj-bin libproj-dev \
13+
libgeos-dev libgeos++-dev \
14+
mime-support \
15+
gcc g++ && \
16+
apt-get clean && \
17+
rm -rf /var/lib/apt/lists/
18+
19+
ENV PYTHONUNBUFFERED=1 \
20+
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH \
21+
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH \
22+
LANG=C.UTF-8
23+
24+
# python alternative support
25+
RUN update-alternatives --install /usr/bin/python python /usr/local/bin/python3 2
26+
27+
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
28+
apt-get update -y && \
29+
apt-get install -y nodejs
30+
31+
WORKDIR /opt
32+
RUN git clone https://github.com/edeno/SpectraVis.git && \
33+
cd SpectraVis && \
34+
npm install
35+
36+
RUN curl https://bootstrap.pypa.io/get-pip.py | python3 && \
37+
python3 -m pip install --no-cache-dir -U setuptools && \
38+
python3 -m pip install --no-cache-dir h5py && \
39+
python3 -m pip install --no-cache-dir Cython && \
40+
python3 -m pip install --no-cache-dir matplotlib bokeh && \
41+
python3 -m pip install --no-cache-dir versioneer==0.17 && \
42+
python3 -m pip install --no-cache-dir pyproj Cartopy==0.16 && \
43+
python3 -m pip install --no-cache-dir pandas && \
44+
python3 -m pip install --no-cache-dir seaborn && \
45+
python3 -m pip install --no-cache-dir pillow && \
46+
python3 -m pip install --no-cache-dir networkx cvxpy && \
47+
python3 -m pip install --no-cache-dir scikit-learn scikit-image && \
48+
python3 -m pip install --no-cache-dir pygments && \
49+
python3 -m pip install --no-cache-dir ipython && \
50+
python3 -m pip install --no-cache-dir jupyter && \
51+
python3 -m pip install --no-cache-dir jupyterlab && \
52+
rm -rf /root/.cache && \
53+
rm -f /tmp/*.whl
54+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 2
55+
56+
# Install ipython kernelspec
57+
RUN python3 -m ipykernel install --display-name "SpectraVis on Backend.AI" && \
58+
cat /usr/local/share/jupyter/kernels/python3/kernel.json
59+
60+
# Backend.AI specifics
61+
LABEL ai.backend.kernelspec="1" \
62+
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
63+
ai.backend.features="batch query uid-match user-input" \
64+
ai.backend.resource.min.cpu="1" \
65+
ai.backend.resource.min.mem="256m" \
66+
ai.backend.base-distro="ubuntu16.04" \
67+
ai.backend.runtime-type="python" \
68+
ai.backend.runtime-path="/usr/bin/python3" \
69+
ai.backend.service-ports="spectravis:http:8000"
70+
71+
COPY policy.yml /etc/backend.ai/jail/policy.yml
72+
73+
# vim: ft=dockerfile

vendor/spectraVis/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: 256
10+
extra_envs: []
11+
preserved_env_keys: [
12+
"HOME", "PATH", "LANG",
13+
"PYENV_ROOT", "PYTHONPATH",
14+
"PYTHONUNBUFFERED",
15+
"MPLCONFIGDIR",
16+
"OPENBLAS_NUM_THREADS",
17+
"OMP_NUM_THREADS",
18+
"NPROC",
19+
"LD_LIBRARY_PATH",
20+
"LD_PRELOAD",
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)