Skip to content

Commit 2d0a667

Browse files
RockfordMankiniUCSDkevinsun0904yifanzhu1121N2akiti
authored
2025.4 (#96)
* Changed datascience image to install packages using uv * isntalled typing extensions using conda * fixed typo * changed versioning from conda to pip * fixed typo * Redeclare JUPYTERHUB_VERSION after FROM call * Small fix * fixed typo * fixed typo * Migrated scipy-ml to uv * Removed commented out notebooks * Changed pyqt to PyQt5 * removed prepull from all notebooks * Removed comments and migrated cuda to pip * Added index-url * Commented out cuda conda fix * Removed comments * datascience-notebook: add r-sf; ensure modern sqlite for JupyterLab; keep conda lib on loader path * Update main.yml * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update Dockerfile --------- Co-authored-by: kevinsun0904 <kevinsun0904@gmail.com> Co-authored-by: yifanzhu1121 <kiki.zhuyifan@gmail.com> Co-authored-by: N2akiti <n2akiti@ucsd.edu>
1 parent 102bf56 commit 2d0a667

3 files changed

Lines changed: 57 additions & 81 deletions

File tree

images/datascience-notebook/Dockerfile

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# If you are building manually, pass PYTHON_VERSION/PY_VER_SHORT/JUPYTERHUB_VERSION with --build-arg
1+
# If you are building manually, pass PYTHON_VERSION/PY_VER_SHORT/JUPYTERHUB_VERSION with --build-arg
22
ARG PYTHON_VERSION=python-3.11.8
33
ARG PY_VER_SHORT=3.11
44
ARG JUPYTERHUB_VERSION=4.1.5
@@ -14,6 +14,12 @@ ENV DEBCONF_NOWARNINGS="yes"
1414
RUN apt-get update -y && \
1515
apt-get -qq install -y --no-install-recommends \
1616
git \
17+
libgdal-dev \
18+
libproj-dev \
19+
libgeos-dev \
20+
libudunits2-dev \
21+
libgit2-dev \
22+
pkg-config \
1723
curl \
1824
rsync \
1925
unzip \
@@ -64,35 +70,37 @@ USER jovyan
6470

6571
# Python/Mamba Deps
6672
## Package versions
67-
ARG JUPYTERSERVER_VERSION=2.14.2 NBGRADER_VERSION=0.9.3 JUPYTERLAB_VERSION=4.2.4 NBCONVERT_VERSION=7.16.4 NOTEBOOK_VERSION=7.2.1 NBCLASSIC_VERSION=1.1.0
73+
ARG JUPYTERHUB_VERSION=4.1.5 JUPYTERSERVER_VERSION=2.14.2 NBGRADER_VERSION=0.9.3 JUPYTERLAB_VERSION=4.2.4 NBCONVERT_VERSION=7.16.4 NOTEBOOK_VERSION=7.2.1 NBCLASSIC_VERSION=1.1.0
6874
ARG PANDAS_VERSION=2.2.3 STATSMODELS_VERSION=0.14.4 BOTTLENECK_VERSION=1.4.2 NUMEXPR_VERSION=2.10.2
6975

76+
# Install uv for faster package installations
77+
RUN pip3 install --no-cache-dir --upgrade uv
78+
7079
# Install essential+datascience pip packages
7180
## mistune added for nbgrader issues
72-
RUN mamba install -c conda-forge pillow typing-extensions tzlocal appdirs gputil mock pytest umap-learn && \
73-
mamba install -c conda-forge nltk statsmodels=$STATSMODELS_VERSION pandas=$PANDAS_VERSION mistune && \
74-
mamba install -c conda-forge dpkt nose datascience pyarrow bottleneck=$BOTTLENECK_VERSION umap-learn numexpr=$NUMEXPR_VESION && \
81+
RUN uv pip install pillow typing-extensions tzlocal appdirs gputil mock pytest umap-learn --system && \
82+
uv pip install nltk statsmodels==$STATSMODELS_VERSION pandas==$PANDAS_VERSION mistune --system && \
83+
uv pip install dpkt nose datascience pyarrow bottleneck==$BOTTLENECK_VERSION umap-learn numexpr==$NUMEXPR_VERSION --system && \
7584
python -c 'import matplotlib.pyplot' && \
7685
fix-permissions $CONDA_DIR && \
7786
fix-permissions /home/$NB_USER && \
78-
mamba clean --all
87+
uv cache clean
7988

8089
# Install jupyterlab+extensions
81-
RUN mamba install -c conda-forge jupyterhub=$JUPYTERHUB_VERSION jupyter_server=$JUPYTERSERVER_VERSION && \
82-
mamba install -c conda-forge jupyterlab=$JUPYTERLAB_VERSION notebook=$NOTEBOOK_VERSION nbclassic=$NBCLASSIC_VERSION && \
83-
# (TODO: Re-enable collab once RTC is fixed) mamba install -c conda-forge jupyterlab_rise jupyter_server_terminals jupyter-collaboration && \
84-
mamba install -c conda-forge jupyterlab_rise jupyter_server_terminals && \
85-
mamba install -c conda-forge jupyterlab-latex jupyterlab-git jupyterlab-fasta jupyterlab-geojson && \
86-
mamba install -c conda-forge nbconvert=$NBCONVERT_VERSION nbgrader=$NBGRADER_VERSION && \
90+
RUN uv pip install jupyterhub==$JUPYTERHUB_VERSION jupyter_server==$JUPYTERSERVER_VERSION --system && \
91+
uv pip install jupyterlab==$JUPYTERLAB_VERSION notebook==$NOTEBOOK_VERSION nbclassic==$NBCLASSIC_VERSION --system && \
92+
# (TODO: Re-enable collab once RTC is fixed) uv pip install jupyterlab_rise jupyter_server_terminals jupyter-collaboration --system && \
93+
uv pip install jupyterlab_rise jupyter_server_terminals --system && \
94+
uv pip install jupyterlab-latex jupyterlab-git jupyterlab-fasta jupyterlab-geojson --system && \
95+
uv pip install nbconvert==$NBCONVERT_VERSION nbgrader==$NBGRADER_VERSION --system && \
8796
fix-permissions $CONDA_DIR && \
8897
fix-permissions /home/$NB_USER && \
89-
mamba clean --all
98+
uv cache clean
9099

91100
# Install R packages
92-
RUN mamba install -c conda-forge r-markdown r-covr r-git2r r-crosstalk r-dt -y && \
101+
RUN R -e "install.packages(c('sf', 'markdown', 'covr', 'git2r', 'crosstalk', 'DT'), repos='https://cloud.r-project.org')" && \
93102
fix-permissions $CONDA_DIR && \
94-
fix-permissions /home/$NB_USER && \
95-
mamba clean -a -y
103+
fix-permissions /home/$NB_USER
96104

97105
# Run install-python + cleanup
98106
RUN /usr/share/datahub/scripts/install-python-all.sh && \
@@ -107,7 +115,4 @@ RUN jupyter labextension disable @jupyterlab/extensionmanager-extension
107115
ENV NBGRADER_COURSEID="NA"
108116
ENV JUPYTERHUB_USER=${NB_USER}
109117

110-
RUN pip cache purge
111-
RUN conda clean -t -p -i -y
112-
113118
WORKDIR /home/jovyan

images/scipy-ml-notebook/Dockerfile

Lines changed: 31 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -50,71 +50,42 @@ 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 mamba install -c "nvidia/label/cuda-12.6.0" cuda-nvcc \
57-
cuda-toolkit=$CUDA_VERSION \
58-
# For CUDA 11: cudatoolkit=$CUDA_VERSION \
59-
cuda-version=$CUDA_VERSION \
60-
nccl \
61-
-y && \
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+
--extra-index-url https://download.pytorch.org/whl/cu126 \
58+
nvidia-cuda-nvcc-cu12 \
59+
nvidia-nccl-cu12 \
60+
cuda-python \
61+
protobuf==$PROTOBUF_VERSION \
62+
opencv-contrib-python-headless \
63+
opencv-python \
64+
PyQt5 \
65+
pycocotools \
66+
pillow \
67+
scapy \
68+
nvidia-cudnn-cu12==$CUDNN_VERSION \
69+
torch==$TORCH_VERSION \
70+
torchvision \
71+
torchaudio \
72+
tensorflow==$TENSORFLOW_VERSION \
73+
tensorflow-datasets \
74+
tensorrt==$TENSORRT_VERSION \
75+
keras==$KERAS_VERSION \
76+
tf-keras==$TF_KERAS_VERSION \
77+
transformers \
78+
datasets \
79+
accelerate \
80+
huggingface-hub \
81+
timm \
82+
&& \
6283
fix-permissions $CONDA_DIR && \
6384
fix-permissions /home/$NB_USER && \
64-
mamba clean -a -y
65-
66-
# Install scipy pip packages
67-
## install protobuf to avoid weird base type error. seems like if we don't then it'll be installed twice.
68-
## https://github.com/spesmilo/electrum/issues/7825
69-
## pip cache purge didnt work here for some reason.
70-
RUN pip install --no-cache-dir protobuf==$PROTOBUF_VERSION
71-
## cuda-python installed to have parity with tensorflow and cudnn
72-
## Install pillow<7 due to dependency issue https://github.com/pytorch/vision/issues/1712
73-
## tensorrt installed to fix not having libnvinfer that has caused tensorflow issues.
74-
RUN pip install opencv-contrib-python-headless \
75-
opencv-python && \
76-
fix-permissions $CONDA_DIR && \
77-
fix-permissions /home/$NB_USER && \
78-
pip cache purge
79-
80-
RUN mamba install -c conda-forge pyqt pycocotools pillow scapy && \
81-
fix-permissions $CONDA_DIR && \
82-
fix-permissions /home/$NB_USER && \
83-
mamba clean --all
84-
85-
# Install CUDA/Torch/Tensorflow/Keras w/pip
86-
## no purge required but no-cache-dir is used. pip purge will actually break the build here!
87-
## Beware of potentially needing to update these if we update the drivers.
88-
## Check tensorrt_env_vars.sh if you have to bump tensorrt!
89-
90-
## tf-keras is keras 2.x for higher versions of tensorflow that would normally require keras 3
91-
RUN pip install nvidia-cudnn-cu12==$CUDNN_VERSION torch==$TORCH_VERSION torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126 && \
92-
pip install tensorflow==$TENSORFLOW_VERSION tensorflow-datasets tensorrt==$TENSORRT_VERSION keras==$KERAS_VERSION tf-keras==$TF_KERAS_VERSION && \
93-
fix-permissions $CONDA_DIR && \
94-
fix-permissions /home/$NB_USER && \
95-
mamba clean -a -y && \
96-
pip cache purge
97-
98-
RUN pip install transformers datasets accelerate huggingface-hub timm && \
99-
fix-permissions $CONDA_DIR && \
100-
fix-permissions /home/$NB_USER && \
101-
mamba clean -a -y && \
102-
pip cache purge
85+
uv cache clean
10386

10487
USER $NB_UID:$NB_GID
10588
ENV PATH=${PATH}:/usr/local/nvidia/bin:/opt/conda/bin
10689

107-
# CUDA fixes for CONDA
108-
## Copy libdevice file to the required path
109-
RUN mkdir -p $CONDA_DIR/lib/nvvm/libdevice && \
110-
cp $CONDA_DIR/nvvm/libdevice/libdevice.10.bc $CONDA_DIR/lib/nvvm/libdevice/
111-
#CUDA 11: cp $CONDA_DIR/lib/libdevice.10.bc $CONDA_DIR/lib/nvvm/libdevice/
112-
113-
# TensorRT fix for tensorflow
114-
## https://github.com/tensorflow/tensorflow/issues/61468 (could not find TensorRT)
115-
## This will most definitely have to be changed after 8.6.1...
116-
RUN ln -s /opt/conda/lib/python3.11/site-packages/tensorrt_libs/libnvinfer_plugin.so.8 /opt/conda/lib/python3.11/site-packages/tensorrt_libs/libnvinfer_plugin.so.$TENSORRT_VERSION && \
117-
ln -s /opt/conda/lib/python3.11/site-packages/tensorrt_libs/libnvinfer.so.8 /opt/conda/lib/python3.11/site-packages/tensorrt_libs/libnvinfer.so.$TENSORRT_VERSION
118-
11990
# Run datahub scripts
12091
RUN . /tmp/activate.sh

images/spec.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ images:
2222
integration_tests: false
2323
info_cmds: [PY_VER, PIP_LIST, CUDA_VERSION, CONDA_INFO, CONDA_LIST, APT_PKG_LIST]
2424
prune: false # comment if scipy-ml stops being the last container
25-
#prepull: false #-- uncomment to disable prepulling behavior for scipy-ml. gives you space on machine in exchange for build time.
25+
# prepull: false #-- uncomment to disable prepulling behavior for scipy-ml. gives you space on machine in exchange for build time.
2626

2727
tag:
28-
prefix: "2025.2"
28+
prefix: "2025.3"
2929

3030
all_info_cmds:
3131
PY_VER:

0 commit comments

Comments
 (0)