Skip to content

Commit bec36b8

Browse files
authored
Update Dockerfile
1 parent 8ddea29 commit bec36b8

File tree

1 file changed

+34
-42
lines changed

1 file changed

+34
-42
lines changed

images/scipy-ml-notebook/Dockerfile

Lines changed: 34 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -50,52 +50,44 @@ RUN chmod 777 /etc/datahub-profile.d/*.sh /tmp/activate.sh
5050

5151
USER jovyan
5252

53-
# CUDA setup w/mamba
54-
## TODO: Investigate this command, seems to duplicate cuda packages for nvidia (pypi + conda-forge).
55-
# cuda-toolkit is a skeleton package on CUDA 12, unlike CUDA <= 11
56-
RUN uv pip install --extra-index-url https://pypi.nvidia.com nvidia-cuda-nvcc-cu12 nvidia-nccl-cu12 cuda-python --system && \
53+
RUN pip3 install --no-cache-dir --upgrade uv
54+
55+
RUN uv pip install --system \
56+
--extra-index-url https://pypi.nvidia.com \
57+
nvidia-cuda-nvcc-cu12 \
58+
nvidia-nccl-cu12 \
59+
cuda-python \
60+
--index-url "" \
61+
protobuf==$PROTOBUF_VERSION \
62+
# OpenCV
63+
opencv-contrib-python-headless \
64+
opencv-python \
65+
# Other Utils
66+
PyQt5 \
67+
pycocotools \
68+
pillow \
69+
scapy \
70+
--index-url https://download.pytorch.org/whl/cu126 \
71+
nvidia-cudnn-cu12==$CUDNN_VERSION \
72+
torch==$TORCH_VERSION \
73+
torchvision \
74+
torchaudio \
75+
--index-url "" \
76+
tensorflow==$TENSORFLOW_VERSION \
77+
tensorflow-datasets \
78+
tensorrt==$TENSORRT_VERSION \
79+
keras==$KERAS_VERSION \
80+
tf-keras==$TF_KERAS_VERSION \
81+
transformers \
82+
datasets \
83+
accelerate \
84+
huggingface-hub \
85+
timm \
86+
&& \
5787
fix-permissions $CONDA_DIR && \
5888
fix-permissions /home/$NB_USER && \
5989
uv cache clean
6090

61-
# Install scipy pip packages
62-
## install protobuf to avoid weird base type error. seems like if we don't then it'll be installed twice.
63-
## https://github.com/spesmilo/electrum/issues/7825
64-
RUN uv pip install --no-cache-dir protobuf==$PROTOBUF_VERSION --system && \
65-
fix-permissions $CONDA_DIR && \
66-
fix-permissions /home/$NB_USER && \
67-
uv cache clean
68-
69-
## cuda-python installed to have parity with tensorflow and cudnn
70-
## Install pillow<7 due to dependency issue https://github.com/pytorch/vision/issues/1712
71-
## tensorrt installed to fix not having libnvinfer that has caused tensorflow issues.
72-
RUN uv pip install opencv-contrib-python-headless opencv-python --system && \
73-
fix-permissions $CONDA_DIR && \
74-
fix-permissions /home/$NB_USER && \
75-
uv cache clean
76-
77-
RUN uv pip install PyQt5 pycocotools pillow scapy --system && \
78-
fix-permissions $CONDA_DIR && \
79-
fix-permissions /home/$NB_USER && \
80-
uv cache clean
81-
82-
# Install CUDA/Torch/Tensorflow/Keras w/pip
83-
## no purge required but no-cache-dir is used. pip purge will actually break the build here!
84-
## Beware of potentially needing to update these if we update the drivers.
85-
## Check tensorrt_env_vars.sh if you have to bump tensorrt!
86-
87-
## tf-keras is keras 2.x for higher versions of tensorflow that would normally require keras 3
88-
RUN uv pip install nvidia-cudnn-cu12==$CUDNN_VERSION torch==$TORCH_VERSION torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126 --system && \
89-
uv pip install tensorflow==$TENSORFLOW_VERSION tensorflow-datasets tensorrt==$TENSORRT_VERSION keras==$KERAS_VERSION tf-keras==$TF_KERAS_VERSION --system && \
90-
fix-permissions $CONDA_DIR && \
91-
fix-permissions /home/$NB_USER && \
92-
uv cache clean
93-
94-
RUN uv pip install transformers datasets accelerate huggingface-hub timm --system && \
95-
fix-permissions $CONDA_DIR && \
96-
fix-permissions /home/$NB_USER && \
97-
uv cache clean
98-
9991
USER $NB_UID:$NB_GID
10092
ENV PATH=${PATH}:/usr/local/nvidia/bin:/opt/conda/bin
10193

0 commit comments

Comments
 (0)