[Backport] Docker fixes from release/1.38#1735
Conversation
- Replace deprecated numpy aliases (np.math.ceil → math.ceil, np.Inf → np.inf) - Upgrade Docker constraints: numpy>=2.0, cython>=3.0, remove scipy upper bound
There was a problem hiding this comment.
Code Review
This pull request updates several dependency versions across Dockerfiles and build scripts, including upgrading Python to 3.12.13, PyTorch to 2.10.0, and vLLM to 0.19.1. It also replaces deprecated NumPy calls (np.Inf and np.math.ceil) with standard Python equivalents. The review feedback highlights three key issues: first, reassigning the loop variable args to copy(args) in build_image.py accumulates mutations across builder iterations instead of using a clean copy; second, optimum_version was unpinned in install.sh but is still passed from build_image.py; and third, updating the default Python version to 3.12.13 causes a tagging mismatch for AscendImageBuilder, which relies on a Python 3.11 base image.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
This PR backports Docker build/dependency updates (notably moving Docker images to NumPy 2.x and adding missing deps) and includes small runtime code adjustments needed for NumPy 2 compatibility.
Changes:
- Update Dockerfiles to use
numpy>=2.0, relax SciPy pinning, and addipywidgets; refresh some GPU dependency constraints. - Adjust Docker image build tooling/workflow (default versions, cache-busting
CUR_TIME, stable/latest builder behavior). - Replace NumPy-aliased math/inf usage in a couple of Python modules for NumPy 2 compatibility (
np.math.ceil→math.ceil,np.Inf→np.inf).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| modelscope/pipelines/multi_modal/soonet_video_temporal_grounding_pipeline.py | Switch from np.math.ceil to math.ceil for NumPy 2 compatibility. |
| modelscope/models/cv/video_depth_estimation/models/model_checkpoint.py | Switch from np.Inf to np.inf for NumPy 2 compatibility. |
| docker/install.sh | Update install flow; positional version-arg handling needs to remain consistent with callers. |
| docker/Dockerfile.ubuntu.old | Add CUR_TIME arg to force rebuild/cache busting. |
| docker/Dockerfile.ubuntu | Move to NumPy 2 + dependency updates; add ipywidgets; adjust GPU/CPU dependency constraints. |
| docker/Dockerfile.ascend | Align dependencies with NumPy 2 + add ipywidgets. |
| docker/build_image.py | Update default versions, cache-busting substitution, builder behavior, and per-builder args copying. |
| .github/workflows/docker-image.yml | Update default Python version to match image build tooling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ms-opencompass pulls numpy<2.0, downgrading numpy from 2.x to 1.26.4. Force reinstall numpy>=2.0 after pip install .[eval] to restore it.
Summary
This PR backports Docker-related fixes from the
release/1.38branch tomaster. These commits were made on the release branch to fix Docker image builds and dependencies, and should also be applied to master to keep the Dockerfiles up-to-date.Note: The version bump commit (
872aa6eb update version v1.38.0) was intentionally excluded as it is release-specific.Commits included
b87b344fUpgrade numpy to 2.x for 1.38 Docker images204caba8fix: quote version of timm specs in Dockerfile.ubuntu (fix: quote version oftimmspecs in Dockerfile.ubuntu #1728) — skipped (empty after conflict resolution)1a534186Add ipywidgets dependency to Docker imagesfaae8512update docker7053c9d6fix29442858fixc0416accfixf5990192fix cpu imageChanges
These changes ensure Docker images build correctly and have the required dependencies.