Skip to content

Commit 93ffd07

Browse files
committed
Intel Caffe , Python 3.6
1 parent b2eb685 commit 93ffd07

File tree

2 files changed

+127
-0
lines changed

2 files changed

+127
-0
lines changed

vendor/intel-caffe/Dockerfile

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
FROM ubuntu:16.04
2+
3+
4+
#ENV http_proxy proxy:port
5+
#ENV https_proxy proxy:port
6+
7+
RUN apt-get update && \
8+
apt-get install -y --no-install-recommends \
9+
bzip2 \
10+
build-essential \
11+
cmake \
12+
git \
13+
wget \
14+
ssh \
15+
openssh-server \
16+
numactl \
17+
vim \
18+
net-tools \
19+
iputils-ping \
20+
ufw \
21+
iptables && \
22+
rm -rf /var/lib/apt/lists/*
23+
24+
# Install conda and Intel Caffe conda package
25+
WORKDIR /tmp
26+
RUN wget --no-check-certificate -c https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh && \
27+
bash Miniconda2-latest-Linux-x86_64.sh -b -p /opt/conda && \
28+
/opt/conda/bin/conda config --add channels intel && \
29+
/opt/conda/bin/conda install -c intel caffe && \
30+
/opt/conda/bin/conda install -y -q intelpython3_full=2019.4 python=3 && \
31+
/opt/conda/bin/conda install -c anaconda opencv && \
32+
/opt/conda/bin/conda install -c conda-forge pycocotools && \
33+
/opt/conda/bin/conda install -c conda-forge nodejs && \
34+
/opt/conda/bin/conda install -c conda-forge jupyterlab && \
35+
/opt/conda/bin/conda install -c conda-forge jupyterthemes && \
36+
/opt/conda/bin/conda install -c conda-forge ipywidgets && \
37+
/opt/conda/bin/conda install -c conda-forge jupyter_contrib_nbextensions && \
38+
/opt/conda/bin/conda install -c conda-forge jupyter_nbextensions_configurator && \
39+
/opt/conda/bin/conda clean --all && \
40+
rm -rf /root/.cache && \
41+
rm -f /tmp/*.whl && \
42+
rm -rf /opt/conda/pkgs/* && \
43+
rm /tmp/Miniconda2-latest-Linux-x86_64.sh -f && \
44+
echo "export PATH=/opt/conda/bin:$PATH" >> /root/.bashrc
45+
46+
WORKDIR /home/work
47+
48+
ENV NOTVISIBLE "in users profile"
49+
RUN echo "export VISIBLE=now" >> /etc/profile
50+
51+
ENV PYTHONUNBUFFERED=1 \
52+
LIBRARY_PATH="/opt/conda/lib/libfabric" \
53+
PATH=/opt/conda/bin/libfabric:/opt/conda/bin:/opt/conda/condabin:/opt/conda/bin:$PATH \
54+
LANG=C.UTF-8 \
55+
CLASSPATH="/opt/conda/lib/mpi.jar" \
56+
CONDA_DEFAULT_ENV="base" \
57+
CONDA_EXE="/opt/conda/bin/conda" \
58+
CONDA_PREFIX="/opt/conda" \
59+
CONDA_PROMPT_MODIFIER="(base) " \
60+
CONDA_PYTHON_EXE="/opt/conda/bin/python" \
61+
CONDA_SHLVL="1" \
62+
FI_PROVIDER_PATH="/opt/conda/lib/libfabric/prov" \
63+
HOME="/home/work" \
64+
I_MPI_ROOT="/opt/conda" \
65+
LC_ALL="C.UTF-8" \
66+
LD_LIBRARY_PATH="/opt/conda/lib/libfabric:/opt/conda/lib" \
67+
MANPATH="/opt/conda/share/man:"
68+
69+
# Jupyter notebook extension
70+
RUN mkdir -p /home/work/.jupyter/nbextension
71+
WORKDIR /home/work/.jupyter/nbextension
72+
73+
RUN jupyter nbextensions_configurator enable && \
74+
jupyter contrib nbextension install && \
75+
jupyter nbextension enable --py --sys-prefix widgetsnbextension && \
76+
jupyter contrib nbextension install && \
77+
jupyter serverextension enable --py jupyterlab --sys-prefix && \
78+
jupyter labextension install @jupyter-widgets/jupyterlab-manager && \
79+
git clone https://github.com/lambdalisue/jupyter-vim-binding vim_binding && \
80+
jupyter nbextension enable /home/work/.jupyter/nbextension/vim_binding/vim_binding
81+
82+
# Install ipython kernelspec
83+
RUN python3 -m ipykernel install --display-name "Intel Caffe & Python 3.6 on Backend.AI" && \
84+
cat /opt/conda/share/jupyter/kernels/python3/kernel.json
85+
86+
COPY policy.yml /etc/backend.ai/jail/policy.yml
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.resource.min.cpu="1" \
93+
ai.backend.resource.min.mem="256m" \
94+
ai.backend.base-distro="ubuntu16.04" \
95+
ai.backend.runtime-type="python" \
96+
ai.backend.runtime-path="/opt/conda/bin/python3" \
97+
ai.backend.service-ports="ipython:pty:3000,jupyter:http:8080,jupyterlab:http:8090"
98+
99+
WORKDIR /home/work
100+
# vim: ft=dockerfile

vendor/intel-caffe/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)