Skip to content

Commit

Permalink
Merge pull request #85 from ucsd-ets/mamba-scipy-ml-fixup
Browse files Browse the repository at this point in the history
Add more mamba statements to scipy-ml-fixup
  • Loading branch information
dafeliton authored Mar 27, 2024
2 parents de6c878 + f6f0c09 commit 73e599c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 16 deletions.
25 changes: 15 additions & 10 deletions images/datascience-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,30 @@ USER jovyan
# Python/Mamba Deps
ARG PY_VER_SHORT=3.11
## Package versions
ARG JUPYTERSERVER_VERSION=2.12.5 JUPYTERHUB_VERSION=4.0.2 JUPYTERLAB_VERSION=4.1.2 NBCONVERT_VERSION=7.16.1 NOTEBOOK_VERSION=7.1.1 NBCLASSIC_VERSION=1.0.0
ARG JUPYTERSERVER_VERSION=2.13.0 JUPYTERHUB_VERSION=4.1.1 JUPYTERLAB_VERSION=4.1.5 NBCONVERT_VERSION=7.16.3 NOTEBOOK_VERSION=7.1.2 NBCLASSIC_VERSION=1.0.0
ARG PANDAS_VERSION=2.2.1 STATSMODELS_VERSION=0.14.1

# Install essential+datascience pip packages
## mistune added for nbgrader issues
RUN pip install pillow typing-extensions tzlocal appdirs gputil mock pytest umap-learn \
nltk statsmodels==$STATSMODELS_VERSION pandas==$PANDAS_VERSION 'mistune>=2' --upgrade && \
pip install dpkt nose datascience && \
RUN mamba install -c conda-forge pillow typing-extensions tzlocal appdirs gputil mock pytest umap-learn && \
mamba install -c conda-forge nltk statsmodels=$STATSMODELS_VERSION pandas=$PANDAS_VERSION mistune && \
mamba install -c conda-forge dpkt nose datascience && \
python -c 'import matplotlib.pyplot' && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER && \
pip cache purge
mamba clean --all

# Install jupyterlab+extensions
RUN pip install jupyterhub==$JUPYTERHUB_VERSION jupyter-server==$JUPYTERSERVER_VERSION jupyterlab==$JUPYTERLAB_VERSION notebook==$NOTEBOOK_VERSION nbclassic==$NBCLASSIC_VERSION jupyterlab_rise \
jupyter_server_terminals jupyter-collaboration jupyterlab-github jupyterlab-latex jupyterlab-git \
jupyterlab-fasta jupyterlab-pullrequests jupyterlab-geojson jupyterlab-link-share \
nbconvert==$NBCONVERT_VERSION && \
pip cache purge
RUN mamba install -c conda-forge jupyterhub=$JUPYTERHUB_VERSION jupyter_server=$JUPYTERSERVER_VERSION && \
mamba install -c conda-forge jupyterlab=$JUPYTERLAB_VERSION notebook=$NOTEBOOK_VERSION nbclassic=$NBCLASSIC_VERSION && \
mamba install -c conda-forge jupyterlab_rise jupyter_server_terminals jupyter-collaboration && \
mamba install -c conda-forge jupyterlab-github jupyterlab-latex jupyterlab-git jupyterlab-fasta jupyterlab-geojson && \
mamba install -c conda-forge nbconvert=$NBCONVERT_VERSION && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER && \
mamba clean --all
# TODO: Deprecated pkgs? Cause a massive downgrade
### mamba install -c conda-forge jupyterlab-pullrequests jupyterlab-link-share

# Install R packages
RUN mamba install -c conda-forge r-markdown r-covr r-git2r r-crosstalk r-dt -y && \
Expand Down
11 changes: 6 additions & 5 deletions images/scipy-ml-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,16 @@ RUN pip install --no-cache-dir protobuf==$PROTOBUF_VERSION
## Install pillow<7 due to dependency issue https://github.com/pytorch/vision/issues/1712
## tensorrt installed to fix not having libnvinfer that has caused tensorflow issues.
RUN pip install opencv-contrib-python-headless \
opencv-python \
pyqt5 \
scapy \
pycocotools \
pillow && \
opencv-python && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER && \
pip cache purge

RUN mamba install -c conda-forge pyqt pycocotools pillow scapy && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER && \
mamba clean --all

# Install CUDA/Torch/Tensorflow/Keras w/pip
## no purge required but no-cache-dir is used. pip purge will actually break the build here!
## Beware of potentially needing to update these if we update the drivers.
Expand Down
2 changes: 1 addition & 1 deletion images/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ images:
build_args:
PYTHON_VERSION: python-3.11.8
PY_VER_SHORT: "3.11"
JUPYTERHUB_VERSION: 4.0.2
JUPYTERHUB_VERSION: 4.1.1
info_cmds: [PY_VER, PIP_LIST, CONDA_INFO, CONDA_LIST, APT_PKG_LIST]

rstudio-notebook:
Expand Down
8 changes: 8 additions & 0 deletions images/tests_common/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,22 @@
# Python
"matplotlib-base": "matplotlib",
"beautifulsoup4": "bs4",
"gputil": "GPUtil",
"jupyterlab-github": "jupyterlab_github",
"jupyterlab-latex": "jupyterlab_latex",
"jupyterlab-fasta": "jupyterlab_fasta",
"jupyterlab-geojson": "jupyterlab_geojson",
"jupyter-collaboration": "jupyter_collaboration",
"scikit-learn": "sklearn",
"scikit-image": "skimage",
"spylon-kernel": "spylon_kernel",
"typing-extensions": "typing_extensions",
"pytables": "tables",
"pyqt": "PyQt5",
"pillow": "PIL",
"nltk_data": "nltk",
"pytorch": "torch",
"umap-learn": "umap",
# R
"randomforest": "randomForest",
"rsqlite": "DBI",
Expand Down

0 comments on commit 73e599c

Please sign in to comment.