Skip to content

Commit 702818d

Browse files
authored
Initial commit
1 parent 7f07d61 commit 702818d

File tree

4 files changed

+121
-0
lines changed

4 files changed

+121
-0
lines changed

Dockerfile

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
FROM nvidia/cuda:9.0-cudnn7-runtime-ubuntu16.04
2+
# Contributors: Syed Navaid (https://github.com/syedahmad)
3+
# Vlad Hosu (https://github.com/subpic)
4+
5+
RUN apt-get update && apt-get install -y \
6+
wget \
7+
vim \
8+
bzip2 \
9+
graphviz \
10+
mc \
11+
htop \
12+
emacs-nox \
13+
rsync \
14+
less \
15+
curl \
16+
#software-properties-common \
17+
build-essential \
18+
libfreetype6-dev \
19+
libpng12-dev \
20+
openssh-client
21+
22+
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
23+
24+
#Downgrade CUDA, TF issue: https://github.com/tensorflow/tensorflow/issues/17566#issuecomment-372490062
25+
RUN apt-get install --allow-downgrades --allow-change-held-packages -y libcudnn7=7.0.5.15-1+cuda9.0 git-lfs
26+
27+
#Install MINICONDA
28+
RUN wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O Miniconda.sh && \
29+
/bin/bash Miniconda.sh -b -p /opt/conda && \
30+
rm Miniconda.sh
31+
32+
ENV PATH /opt/conda/bin:$PATH
33+
34+
#Install ANACONDA Environment
35+
RUN conda create -y -n jupyter_env python=3.6 nb_conda_kernels py-xgboost-gpu \
36+
anaconda ipykernel tensorflow-gpu keras-gpu matplotlib numpy scipy pandas \
37+
Pillow pydot munch scikit-learn && \
38+
/opt/conda/envs/jupyter_env/bin/pip install jupyter-tensorboard gitless opencv-python && \
39+
/opt/conda/envs/jupyter_env/bin/python -m ipykernel.kernelspec
40+
41+
RUN conda create -y -n jupyter_env27 python=2.7 nb_conda_kernels py-xgboost-gpu \
42+
anaconda ipykernel tensorflow-gpu keras-gpu matplotlib numpy scipy pandas \
43+
Pillow pydot munch scikit-learn && \
44+
/opt/conda/envs/jupyter_env27/bin/pip install jupyter-tensorboard gitless opencv-python && \
45+
/opt/conda/envs/jupyter_env27/bin/python -m ipykernel.kernelspec
46+
47+
# Install OpenCV
48+
RUN apt-get update && apt-get install -y libopencv-dev && \
49+
echo 'ln /dev/null /dev/raw1394' >> ~/.bashrc
50+
51+
RUN set -x \
52+
&& cd /tmp \
53+
&& wget https://github.com/sdg-mit/gitless/releases/download/v0.8.8/gl-v0.8.8-linux-x86_64.tar.gz \
54+
&& tar -C /usr/bin/ -xvf gl-v0.8.8-linux-x86_64.tar.gz --strip-components=1 \
55+
&& rm -f gl-v0.8.8-linux-x86_64.tar.gz
56+
57+
COPY docker_deps/entrypoint.sh /root/
58+
COPY tests/test_libraries.py /tmp/
59+
COPY configs/jupyter_notebook_config.py /root/.jupyter/
60+
61+
RUN chmod +x /root/entrypoint.sh && \
62+
chown -R 777 /tmp/test_libraries.py
63+
64+
ENV LC_ALL=C.UTF-8 LANG=C.UTF-8
65+
ENV PYTHONPATH='/mnt/home/research/:/mnt/home/:$PYTHONPATH'
66+
ENV PASSWORD unknownknowns
67+
ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:$LD_LIBRARY_PATH
68+
69+
WORKDIR /mnt/home/
70+
71+
# IPython
72+
EXPOSE 8888 6006
73+
74+
CMD bash /root/entrypoint.sh

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker build -f Dockerfile -t jupyter-data-science .

configs/jupyter_notebook_config.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ==============================================================================
15+
import os
16+
from IPython.lib import passwd
17+
18+
c.JupyterApp.ip = '*'
19+
c.JupyterApp.port = int(os.getenv('PORT', 8888))
20+
c.JupyterApp.open_browser = False
21+
c.MultiKernelManager.default_kernel_name = 'jupyter_env'
22+
c.JupyterApp.terminado_settings = { 'shell_command': ['bash'] }
23+
24+
# sets a password if PASSWORD is set in the environment
25+
if 'PASSWORD' in os.environ:
26+
c.JupyterApp.password = passwd(os.environ['PASSWORD'])
27+
del os.environ['PASSWORD']

docker_deps/entrypoint.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
# ==============================================================================
16+
17+
conda init bash
18+
nohup /opt/conda/envs/jupyter_env/bin/tensorboard --logdir=/mnt/home/research/data/logs&
19+
/opt/conda/envs/jupyter_env/bin/jupyter-lab "$@" --allow-root

0 commit comments

Comments
 (0)