Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,25 @@ RUN if [[ $(uname -m) =~ "aarch64" ]]; then \

WORKDIR /opt/monai

# Patch NVIDIA's pip constraint file:
# - keep the base image's numpy pin if it has one (nv25.03 pins numpy==1.26.4 as its
# torch was compiled against NumPy 1.x; nv25.12 ships an empty constraint.txt)
# - add setuptools<71 (newer setuptools removed pkg_resources needed by legacy setup.py)
# - pin urllib3>=2 so that notebook cells doing !pip install legacy packages (e.g.
# bentoml==0.13.1) cannot downgrade urllib3 to 1.x, which would break requests,
# huggingface_hub, gdown, transformers, mlflow, etc. for every subsequent notebook
# - remove jupytext/isort pins so the tutorial runner can install its required versions
RUN (grep '^numpy' /etc/pip/constraint.txt || true) > /tmp/new_constraints.txt \
&& printf 'setuptools<71\nurllib3>=2\n' >> /tmp/new_constraints.txt \
&& cp /tmp/new_constraints.txt /etc/pip/constraint.txt

# install full deps
COPY requirements.txt requirements-min.txt requirements-dev.txt /tmp/
RUN cp /tmp/requirements.txt /tmp/req.bak \
&& awk '!/torch/' /tmp/requirements.txt > /tmp/tmp && mv /tmp/tmp /tmp/requirements.txt \
&& python -m pip install --upgrade --no-cache-dir --no-build-isolation pip wheel wheel-stub \
&& python -m pip install --no-cache-dir --no-build-isolation -r /tmp/requirements-dev.txt
&& python -m pip install --no-cache-dir --no-build-isolation -r /tmp/requirements-dev.txt \
&& python -m pip install --no-cache-dir --no-build-isolation papermill jupytext autopep8 autoflake ipywidgets

# compile ext and remove temp files
# TODO: remark for issue [revise the dockerfile #1276](https://github.com/Project-MONAI/MONAI/issues/1276)
Expand Down
7 changes: 5 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ black>=26.3.1
isort>=5.1, <6, !=6.0.0
ruff>=0.14.11,<0.15
pybind11
setuptools<71 # pkg_resources removed in setuptools>=71; needed by MetricsReloaded setup.py
types-setuptools
mypy>=1.5.0, <1.12.0
ninja
Expand All @@ -33,9 +34,11 @@ tifffile; platform_system == "Linux" or platform_system == "Darwin"
pandas
requests
einops
transformers>=4.53.0
mlflow>=2.12.2,<3.13
transformers>=4.53.0, <5.0 # 5.x references torch.float8_e8m0fnu absent in older PyTorch builds
mlflow>=2.12.2, <3.0 # 3.x broken on Python 3.12 (relative import in mlflow.utils.uv_utils)
clearml>=1.10.0rc0
aim; platform_system == "Linux" # experiment tracking backend for spleen_segmentation_aim tutorial
lightning>=2.0 # PyTorch Lightning for lightning-based training tutorials
matplotlib>=3.6.3
tensorboardX
types-PyYAML
Expand Down
Loading