Switch to PyTorch lightning in jupyter hub

This commit is contained in:
Leni Ven 2022-11-06 23:52:55 -08:00
parent 74b49aab6b
commit e5598e416f
1 changed files with 51 additions and 12 deletions

View File

@ -1,34 +1,71 @@
FROM nvidia/cuda:11.2.2-cudnn8-runtime-ubuntu20.04
# Base Image
# Not using this one since it only provides python3.7. This has been a
# long standing issue.
#
#FROM pytorch/pytorch:1.12.1-cuda11.3-cudnn8-runtime
FROM pytorchlightning/pytorch_lightning:base-cuda-py3.9-torch1.12-cuda11.6.1
# pytorch base provides the packages:
#
# python3, python3-pip
#
# and
#
# torch, torchvision
# Some python-packages need mysql-config,
# which is provided by libmysqlclient-dev
ARG NB_USER="jovyan"
USER root
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
g++ \
nodejs \
python3.8 \
python3-pip \
sudo \
bash \
curl \
libmysqlclient-dev \
zip \
libc6 \
&&\
ln --force --symbolic /usr/bin/python3 /usr/bin/python &&\
pip3 install \
jupyterlab \
pylint \
tensorflow-gpu==2.7.0 \
tensorboard==2.7.0 \
colored \
requests \
python-dateutil \
cloudpickle \
pickleshare \
packaging \
h5py \
matplotlib \
seaborn \
scikit-learn \
scipy \
tqdm \
networkx \
&&\
curl -fsSL https://deb.nodesource.com/setup_17.x | bash - &&\
gym \
pattern \
imageio \
opt-einsum \
einops \
torchinfo \
torchaudio \
torchtext \
torchmetrics \
torch-geometric \
torchviz \
tensorboard
RUN pip3 install \
jupyterlab \
ipywidgets &&\
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - &&\
apt-get install -y nodejs &&\
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install @jupyter-widgets/jupyterlab-manager &&\
jupyter nbextension enable --py widgetsnbextension
RUN useradd \
--create-home \
--password "hashlife" \
@ -40,11 +77,13 @@ RUN useradd \
mkdir -p /data &&\
chown $NB_USER /data
COPY --chown=$NB_USER jupyter_notebook_config.py /home/$NB_USER/.jupyter/
USER $NB_USER
WORKDIR /data
#ENV LD_LIBRARY_PATH /usr/local/cuda-10.1/compat:$LD_LIBRARY_PATH
CMD ["jupyter", "lab", "--ContentsManager.allow_hidden=True"]
CMD ["jupyter", "lab", \
"--ip=0.0.0.0", \
"--LabApp.token=''", \
"--ContentsManager.allow_hidden=True"]