Skip to content

Commit 7ef5d0b

Browse files
committed
NNI v1.5 for Python 3.5 & CUDA9
1 parent 1fccf2a commit 7ef5d0b

File tree

2 files changed

+159
-0
lines changed

2 files changed

+159
-0
lines changed

nni/Dockerfile

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
FROM nvidia/cuda:9.0-cudnn7-runtime-ubuntu16.04
2+
3+
RUN DEBIAN_FRONTEND=noninteractive && \
4+
apt-get update -y && \
5+
apt-get -y install --no-install-recommends \
6+
apt-utils \
7+
git \
8+
curl \
9+
vim \
10+
unzip \
11+
wget \
12+
build-essential \
13+
cmake \
14+
libopenblas-dev \
15+
automake \
16+
openssh-client \
17+
openssh-server \
18+
lsof \
19+
python3.5 \
20+
python3-dev \
21+
python3-pip \
22+
python3-tk \
23+
libcupti-dev && \
24+
curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
25+
apt-get update -y && \
26+
apt-get install -y nodejs && \
27+
apt-get clean && \
28+
rm -rf /var/lib/apt/lists/*
29+
30+
# python alternative support
31+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 2
32+
33+
RUN python3 -m pip install --upgrade pip setuptools==39.1.0 && \
34+
python3 -m pip --no-cache-dir install \
35+
numpy==1.14.3 \
36+
scipy==1.1.0 \
37+
&& \
38+
python3 -m pip --no-cache-dir install \
39+
tensorflow-gpu==1.10.0 \
40+
Keras==2.1.6 \
41+
torch==1.4.0 \
42+
torchvision==0.5.0 \
43+
scikit-learn==0.20.0 \
44+
&& \
45+
python3 -m pip --no-cache-dir install pandas==0.23.4 lightgbm==2.2.2
46+
47+
# Jupyter notebook extension
48+
RUN mkdir -p /home/work/.jupyter/nbextension
49+
WORKDIR /home/work/.jupyter/nbextension
50+
51+
RUN python3 -m pip install --no-cache-dir imbalanced-learn && \
52+
python3 -m pip install --no-cache-dir scikit-optimize && \
53+
python3 -m pip install --no-cache-dir bayesian-optimization && \
54+
python3 -m pip install --no-cache-dir scikit-plot && \
55+
python3 -m pip install --no-cache-dir vecstack && \
56+
python3 -m pip install --no-cache-dir category_encoders && \
57+
python3 -m pip install --no-cache-dir scikit-surprise && \
58+
python3 -m pip install --no-cache-dir konlpy && \
59+
python3 -m pip install --no-cache-dir folium && \
60+
python3 -m pip install --no-cache-dir lime && \
61+
python3 -m pip install --no-cache-dir gensim && \
62+
python3 -m pip install --no-cache-dir pyldavis && \
63+
python3 -m pip install --no-cache-dir fbprophet && \
64+
python3 -m pip install --no-cache-dir seaborn && \
65+
python3 -m pip install --no-cache-dir bokeh && \
66+
python3 -m pip install --no-cache-dir plotly && \
67+
python3 -m pip install --no-cache-dir pygal && \
68+
python3 -m pip install --no-cache-dir mlxtend && \
69+
# python3 -m pip install --no-cache-dir dtreeviz && \
70+
python3 -m pip install --no-cache-dir pyglet && \
71+
python3 -m pip install --no-cache-dir descartes && \
72+
python3 -m pip install --no-cache-dir geoplotlib && \
73+
python3 -m pip install --no-cache-dir featuretools && \
74+
python3 -m pip install --no-cache-dir graphviz && \
75+
python3 -m pip install --no-cache-dir geopandas && \
76+
python3 -m pip install --no-cache-dir keras_applications && \
77+
python3 -m pip install --no-cache-dir keras_preprocessing && \
78+
python3 -m pip install --no-cache-dir pillow && \
79+
python3 -m pip install --no-cache-dir jupyter && \
80+
python3 -m pip install --no-cache-dir ipython && \
81+
python3 -m pip install --no-cache-dir ipywidgets && \
82+
python3 -m pip install --no-cache-dir ipyparallel && \
83+
python3 -m pip install --no-cache-dir jupyterlab && \
84+
python3 -m pip install --no-cache-dir jupyterthemes && \
85+
python3 -m pip install --no-cache-dir jupyter-js-widgets-nbextension && \
86+
python3 -m pip install --no-cache-dir jupyter_contrib_nbextensions && \
87+
python3 -m pip install --no-cache-dir jupyter_nbextensions_configurator && \
88+
python3 -m pip install --no-cache-dir matplotlib bokeh && \
89+
python3 -m pip install --no-cache-dir tensorwatch && \
90+
python3 -m pip install --no-cache-dir torchvision && \
91+
python3 -m pip install --no-cache-dir tensorflow-hub==0.5.0 && \
92+
python3 -m pip install --no-cache-dir tf2onnx && \
93+
python3 -m pip install --no-cache-dir contextlib2 && \
94+
python3 -m pip install --no-cache-dir pycocotools && \
95+
rm -rf /root/.cache && \
96+
rm -f /tmp/*.whl
97+
98+
RUN jupyter nbextensions_configurator enable && \
99+
jupyter contrib nbextension install && \
100+
jupyter nbextension enable --py --sys-prefix widgetsnbextension && \
101+
jupyter contrib nbextension install && \
102+
jupyter serverextension enable --py jupyterlab --sys-prefix && \
103+
jupyter labextension install @jupyter-widgets/jupyterlab-manager && \
104+
git clone https://github.com/lambdalisue/jupyter-vim-binding vim_binding && \
105+
jupyter nbextension enable /home/work/.jupyter/nbextension/vim_binding/vim_binding
106+
107+
COPY policy.yml /etc/backend.ai/jail/policy.yml
108+
109+
RUN python3 -m pip --no-cache-dir install nni
110+
111+
ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/root/.local/bin:/usr/bin:/bin:/sbin
112+
113+
RUN python3 -m ipykernel install --display-name "Microsoft NNI Kernel 20.05 on Python 3.6 (CUDA9)" && \
114+
cat /usr/local/share/jupyter/kernels/python3/kernel.json
115+
116+
# Backend.AI specifics
117+
LABEL ai.backend.kernelspec="1" \
118+
ai.backend.envs.corecount="OPENBLAS_NUM_THREADS,OMP_NUM_THREADS,NPROC" \
119+
ai.backend.features="batch query uid-match user-input" \
120+
ai.backend.base-distro="ubuntu16.04" \
121+
ai.backend.resource.min.cpu="1" \
122+
ai.backend.resource.min.mem="1g" \
123+
ai.backend.resource.min.cuda.device=1 \
124+
ai.backend.resource.min.cuda.shares=0.1 \
125+
ai.backend.runtime-type="python" \
126+
ai.backend.runtime-path="/usr/local/bin/python" \
127+
ai.backend.service-ports="ipython:pty:3000,nniboard:http:8080,jupyter:http:8070,jupyterlab:http:8090"
128+
129+
WORKDIR /home/work
130+
# vim: ft=dockerfile

nni/policy.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
"USER", "SHELL", "TERM",
14+
"LD_LIBRARY_PATH",
15+
"LD_PRELOAD",
16+
"OPENBLAS_NUM_THREADS",
17+
"OMP_NUM_THREADS",
18+
"NPROC",
19+
# Python-specific
20+
"PYENV_ROOT", "PYTHONPATH",
21+
"PYTHONUNBUFFERED",
22+
"MPLCONFIGDIR",
23+
]
24+
25+
diff_to_default: true
26+
27+
# Following syscalls are blindly allowed.
28+
# IMPORTANT: ptrace MUST NOT be included!
29+
allowed_syscalls:

0 commit comments

Comments
 (0)