Skip to content

Commit e096cbc

Browse files
authored
Upgrade colab base image to 20260917-060051 (#1562)
### Base image - GPU and CPU images now use `release-colab-external-images_20260917-060051_RC00` (previously `20260716-060051`). - The new base image moves from Python 3.12 to Python 3.13. ### Dockerfile.tmpl - **Python paths:** `PACKAGE_PATH` and the `sitecustomize.py` destination now point to `python3.13` instead of `python3.12`. - **Stopped installing the `keras_internal.py` patch:** `tensorflow_decision_forests` is no longer in the base image, and its latest release (1.12.0) has no cp313 wheel, so the `tensorflow_decision_forests/keras/` directory it patched doesn't exist. - **vtk apt dependency:** replaced `libgl1-mesa-glx`, which newer Ubuntu no longer provides, with `libgl1` and `libglx-mesa0`. ### kaggle_requirements.txt **Removed** - `tensorflow-io`: the last release (0.37.1, July 2024) requires `python<3.13`, has no cp313 wheels, and the project is unmaintained. - The `jupyter-lsp==1.5.1` pin (b/276358430): on 3.13 it keeps jupyterlab on 3.x, which pulls in `jupyter-ydoc 0.2.5` and then `y-py 0.6.2`. `y-py` has no cp313 wheel and its sdist no longer builds. jupyterlab 4.x uses `pycrdt` instead, so jupyter-lsp is now unpinned. - The `fastcore<2` pin and the `python-fasthtml<0.14.6` pin that only existed because of it (b/545164527). **Added or changed** - `opencv-python<5`, `opencv-python-headless<5` and `opencv-contrib-python<5`: the base image mixes OpenCV versions (`opencv-python`/`-headless` at 5.0.0.93, `opencv-contrib-python` at 4.14.0.94). All three install into the same `cv2/` package and overwrite each other, and OpenCV 5.0 drops long-standing APIs such as `cv2.CascadeClassifier`. Holding all three on 4.x keeps `cv2` consistent and backward compatible. - `flax` is now `flax>=0.12`. - Added `universal-pathlib` because Pyxis ([#1402](Kaggle/kaggle-environments#1402), merged Sep 18) added `universal-pathlib` to kaggle-environments' [pyproject.toml](https://github.com/Kaggle/kaggle-environments/blob/d7729da06cc1382eb742d6980dc3180aa85caa28/pyproject.toml#L41). b/493600019
1 parent 1ed8d43 commit e096cbc

2 files changed

Lines changed: 27 additions & 23 deletions

File tree

‎Dockerfile.tmpl‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{ if eq .Accelerator "gpu" }}
2-
FROM us-docker.pkg.dev/colab-images/public/runtime:release-colab-external-images_20260716-060051_RC00
2+
FROM us-docker.pkg.dev/colab-images/public/runtime:release-colab-external-images_20260917-060051_RC00
33
{{ else }}
4-
FROM us-docker.pkg.dev/colab-images/public/cpu-runtime:release-colab-external-images_20260716-060051_RC00
4+
FROM us-docker.pkg.dev/colab-images/public/cpu-runtime:release-colab-external-images_20260917-060051_RC00
55
{{ end}}
66

77
ADD kaggle_requirements.txt /kaggle_requirements.txt
@@ -36,7 +36,7 @@ ADD clean-layer.sh /tmp/clean-layer.sh
3636
ADD patches/nbconvert-extensions.tpl /opt/kaggle/nbconvert-extensions.tpl
3737
ADD patches/template_conf.json /opt/kaggle/conf.json
3838

39-
ARG PACKAGE_PATH=/usr/local/lib/python3.12/dist-packages
39+
ARG PACKAGE_PATH=/usr/local/lib/python3.13/dist-packages
4040

4141
# Install GPU-specific non-pip packages.
4242
{{ if eq .Accelerator "gpu" }}
@@ -56,9 +56,9 @@ RUN sed -i "s/httpredir.debian.org/debian.uchicago.edu/" /etc/apt/sources.list &
5656
apt-get install -y graphviz && pip install graphviz && \
5757
/tmp/clean-layer.sh
5858

59-
ADD patches/keras_internal.py \
60-
patches/keras_internal_test.py \
61-
$PACKAGE_PATH/tensorflow_decision_forests/keras/
59+
# patches/keras_internal.py is not installed right now. tensorflow_decision_forests
60+
# is no longer in the base image and its latest release (1.12.0) ships no cp313
61+
# wheel, so there is no tensorflow_decision_forests/keras/ to patch.
6262

6363
RUN apt-get install -y libfreetype6-dev && \
6464
apt-get install -y libglib2.0-0 libxext6 libsm6 libxrender1 libfontconfig1 --fix-missing && \
@@ -86,7 +86,7 @@ RUN mkdir -p /usr/share/nltk_data && \
8686
# git-lfs 3.7.1 built with Go 1.26, and Ubuntu's git-lfs 3.0.2 package
8787
# overwrites it with an older build from Go 1.18.
8888
# vtk dependencies
89-
RUN apt-get install -y libgl1-mesa-glx && \
89+
RUN apt-get install -y libgl1 libglx-mesa0 && \
9090
# xvfbwrapper dependencies
9191
apt-get install -y xvfb && \
9292
/tmp/clean-layer.sh
@@ -147,7 +147,7 @@ ADD patches/kaggle_gcp.py \
147147

148148
# Figure out why this is in a different place?
149149
# Found by doing a export PYTHONVERBOSE=1 and then running python and checking for where it looked for it.
150-
ADD patches/sitecustomize.py /usr/lib/python3.12/sitecustomize.py
150+
ADD patches/sitecustomize.py /usr/lib/python3.13/sitecustomize.py
151151

152152
ARG GIT_COMMIT=unknown \
153153
BUILD_DATE=unknown

‎kaggle_requirements.txt‎

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,10 @@ dipy
2626
docker
2727
easyocr
2828
emoji
29-
# TODO: b/545164527 - unpin once fastai supports fastcore v2.
30-
# fastcore v2 removed L.starmap, breaking fastai's Optimizer.set_hypers:
31-
# https://github.com/fastai/fastai/issues/4154
32-
# Pinned here rather than on a direct dep because nbdev, execnb, ghapi, fastgit
33-
# and fastspec all pull fastcore uncapped; only constraining fastcore itself
34-
# makes the resolver backtrack all of them.
35-
fastcore<2
3629
fasttext
3730
featuretools
3831
fiona
39-
flax
32+
flax>=0.12
4033
# TODO: b/545164527 - unpin once dipy ships its fury<2.0 cap.
4134
# fury 2.0 swapped VTK for pygfx/wgpu, breaking `from dipy.viz import window`.
4235
# dipy requires fury uncapped; fix is merged upstream but unreleased:
@@ -62,8 +55,11 @@ isoweek
6255
jedi
6356
# jitler 0.11.1 breaks simulation image
6457
jiter==0.10.0
65-
# b/276358430: fix Jupyter lsp freezing up the jupyter server
66-
jupyter-lsp==1.5.1
58+
# b/276358430: jupyter-lsp was pinned to 1.5.1 to stop Jupyter lsp freezing up
59+
# the jupyter server. That pin is unusable on Python 3.13: it holds jupyterlab
60+
# back to the 3.x line, which pulls jupyter-ydoc 0.2.5 -> y-py 0.6.2, and y-py
61+
# publishes no cp313 wheel and its sdist no longer builds. jupyterlab 4.x
62+
# replaced y-py with pycrdt, so leave jupyter-lsp unpinned.
6763
# b/333854354: pin jupyter-server to version 2.12.5; later versions break LSP (b/333854354)
6864
jupyter_server==2.12.5
6965
jupyter_server_proxy
@@ -91,6 +87,15 @@ nbdev
9187
nilearn
9288
olefile
9389
onnx
90+
# The base image ships an inconsistent OpenCV set: opencv-python and
91+
# opencv-python-headless at 5.0.0.93 but opencv-contrib-python at 4.14.0.94.
92+
# They all install into the same cv2/ package and clobber each other, and
93+
# OpenCV 5.0 dropped long-standing APIs (e.g. cv2.CascadeClassifier). Hold the
94+
# whole set on the last 4.x release so cv2 stays consistent and notebooks that
95+
# use the 4.x API keep working.
96+
opencv-contrib-python<5
97+
opencv-python<5
98+
opencv-python-headless<5
9499
openslide-bin
95100
openslide-python
96101
optuna
@@ -113,10 +118,6 @@ pyexcel-ods
113118
pymongo
114119
pypdf
115120
pytesseract
116-
# fastprogress pulls in python-fasthtml uncapped, and 0.14.6 raised its
117-
# floor to fastcore v2, which conflicts with the fastcore<2 pin above.
118-
# Remove once fastcore can be unpinned.
119-
python-fasthtml<0.14.6
120121
python-lsp-server
121122
pytorch-ignite
122123
pytorch-lightning
@@ -132,7 +133,9 @@ scikit-plot
132133
scikit-surprise
133134
git+https://github.com/facebookresearch/segment-anything.git
134135
squarify
135-
tensorflow-io
136+
# tensorflow-io was dropped when the base image moved to Python 3.13. Its last
137+
# release (0.37.1, 2024-07-01) declares requires_python <3.13 and ships no cp313
138+
# wheels, and the project is unmaintained.
136139
# Must be compatible with torch version: https://github.com/meta-pytorch/torchcodec?tab=readme-ov-file#installing-torchcodec
137140
torchcodec==0.11.0
138141
torchinfo
@@ -142,6 +145,7 @@ transformers>=5.0.0
142145
# The base image ships urllib3 2.5; pin up to a newer release.
143146
# Remove once the base image ships >=2.7 itself.
144147
urllib3>=2.7
148+
universal-pathlib
145149
vtk
146150
wavio
147151
xvfbwrapper

0 commit comments

Comments
 (0)