From 5a3f7aa35d4d07802929a2e021c75e3694dd9d5e Mon Sep 17 00:00:00 2001 From: Tiffany Xiang Date: Mon, 28 Sep 2026 16:02:08 +0000 Subject: [PATCH 1/2] Upgrade colab base image to 20260917-060051 --- Dockerfile.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.tmpl b/Dockerfile.tmpl index 8d72c7a5..e2887333 100644 --- a/Dockerfile.tmpl +++ b/Dockerfile.tmpl @@ -1,7 +1,7 @@ {{ if eq .Accelerator "gpu" }} -FROM us-docker.pkg.dev/colab-images/public/runtime:release-colab-external-images_20260716-060051_RC00 +FROM us-docker.pkg.dev/colab-images/public/runtime:release-colab-external-images_20260917-060051_RC00 {{ else }} -FROM us-docker.pkg.dev/colab-images/public/cpu-runtime:release-colab-external-images_20260716-060051_RC00 +FROM us-docker.pkg.dev/colab-images/public/cpu-runtime:release-colab-external-images_20260917-060051_RC00 {{ end}} ADD kaggle_requirements.txt /kaggle_requirements.txt From f8307b28fe42ea84e0d3530b92a310956e3d4ca8 Mon Sep 17 00:00:00 2001 From: Tiffany Xiang Date: Mon, 28 Sep 2026 19:07:22 +0000 Subject: [PATCH 2/2] fix: update Python package paths and adjust dependencies for compatibility with Python 3.13 --- Dockerfile.tmpl | 12 ++++++------ kaggle_requirements.txt | 34 +++++++++++++++++++--------------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/Dockerfile.tmpl b/Dockerfile.tmpl index e2887333..2f52ab4d 100644 --- a/Dockerfile.tmpl +++ b/Dockerfile.tmpl @@ -36,7 +36,7 @@ ADD clean-layer.sh /tmp/clean-layer.sh ADD patches/nbconvert-extensions.tpl /opt/kaggle/nbconvert-extensions.tpl ADD patches/template_conf.json /opt/kaggle/conf.json -ARG PACKAGE_PATH=/usr/local/lib/python3.12/dist-packages +ARG PACKAGE_PATH=/usr/local/lib/python3.13/dist-packages # Install GPU-specific non-pip packages. {{ if eq .Accelerator "gpu" }} @@ -56,9 +56,9 @@ RUN sed -i "s/httpredir.debian.org/debian.uchicago.edu/" /etc/apt/sources.list & apt-get install -y graphviz && pip install graphviz && \ /tmp/clean-layer.sh -ADD patches/keras_internal.py \ - patches/keras_internal_test.py \ - $PACKAGE_PATH/tensorflow_decision_forests/keras/ +# patches/keras_internal.py is not installed right now. tensorflow_decision_forests +# is no longer in the base image and its latest release (1.12.0) ships no cp313 +# wheel, so there is no tensorflow_decision_forests/keras/ to patch. RUN apt-get install -y libfreetype6-dev && \ apt-get install -y libglib2.0-0 libxext6 libsm6 libxrender1 libfontconfig1 --fix-missing && \ @@ -86,7 +86,7 @@ RUN mkdir -p /usr/share/nltk_data && \ # git-lfs 3.7.1 built with Go 1.26, and Ubuntu's git-lfs 3.0.2 package # overwrites it with an older build from Go 1.18. # vtk dependencies -RUN apt-get install -y libgl1-mesa-glx && \ +RUN apt-get install -y libgl1 libglx-mesa0 && \ # xvfbwrapper dependencies apt-get install -y xvfb && \ /tmp/clean-layer.sh @@ -147,7 +147,7 @@ ADD patches/kaggle_gcp.py \ # Figure out why this is in a different place? # Found by doing a export PYTHONVERBOSE=1 and then running python and checking for where it looked for it. -ADD patches/sitecustomize.py /usr/lib/python3.12/sitecustomize.py +ADD patches/sitecustomize.py /usr/lib/python3.13/sitecustomize.py ARG GIT_COMMIT=unknown \ BUILD_DATE=unknown diff --git a/kaggle_requirements.txt b/kaggle_requirements.txt index f838ed57..56213f32 100644 --- a/kaggle_requirements.txt +++ b/kaggle_requirements.txt @@ -26,17 +26,10 @@ dipy docker easyocr emoji -# TODO: b/545164527 - unpin once fastai supports fastcore v2. -# fastcore v2 removed L.starmap, breaking fastai's Optimizer.set_hypers: -# https://github.com/fastai/fastai/issues/4154 -# Pinned here rather than on a direct dep because nbdev, execnb, ghapi, fastgit -# and fastspec all pull fastcore uncapped; only constraining fastcore itself -# makes the resolver backtrack all of them. -fastcore<2 fasttext featuretools fiona -flax +flax>=0.12 # TODO: b/545164527 - unpin once dipy ships its fury<2.0 cap. # fury 2.0 swapped VTK for pygfx/wgpu, breaking `from dipy.viz import window`. # dipy requires fury uncapped; fix is merged upstream but unreleased: @@ -62,8 +55,11 @@ isoweek jedi # jitler 0.11.1 breaks simulation image jiter==0.10.0 -# b/276358430: fix Jupyter lsp freezing up the jupyter server -jupyter-lsp==1.5.1 +# b/276358430: jupyter-lsp was pinned to 1.5.1 to stop Jupyter lsp freezing up +# the jupyter server. That pin is unusable on Python 3.13: it holds jupyterlab +# back to the 3.x line, which pulls jupyter-ydoc 0.2.5 -> y-py 0.6.2, and y-py +# publishes no cp313 wheel and its sdist no longer builds. jupyterlab 4.x +# replaced y-py with pycrdt, so leave jupyter-lsp unpinned. # b/333854354: pin jupyter-server to version 2.12.5; later versions break LSP (b/333854354) jupyter_server==2.12.5 jupyter_server_proxy @@ -91,6 +87,15 @@ nbdev nilearn olefile onnx +# The base image ships an inconsistent OpenCV set: opencv-python and +# opencv-python-headless at 5.0.0.93 but opencv-contrib-python at 4.14.0.94. +# They all install into the same cv2/ package and clobber each other, and +# OpenCV 5.0 dropped long-standing APIs (e.g. cv2.CascadeClassifier). Hold the +# whole set on the last 4.x release so cv2 stays consistent and notebooks that +# use the 4.x API keep working. +opencv-contrib-python<5 +opencv-python<5 +opencv-python-headless<5 openslide-bin openslide-python optuna @@ -113,10 +118,6 @@ pyexcel-ods pymongo pypdf pytesseract -# fastprogress pulls in python-fasthtml uncapped, and 0.14.6 raised its -# floor to fastcore v2, which conflicts with the fastcore<2 pin above. -# Remove once fastcore can be unpinned. -python-fasthtml<0.14.6 python-lsp-server pytorch-ignite pytorch-lightning @@ -132,7 +133,9 @@ scikit-plot scikit-surprise git+https://github.com/facebookresearch/segment-anything.git squarify -tensorflow-io +# tensorflow-io was dropped when the base image moved to Python 3.13. Its last +# release (0.37.1, 2024-07-01) declares requires_python <3.13 and ships no cp313 +# wheels, and the project is unmaintained. # Must be compatible with torch version: https://github.com/meta-pytorch/torchcodec?tab=readme-ov-file#installing-torchcodec torchcodec==0.11.0 torchinfo @@ -142,6 +145,7 @@ transformers>=5.0.0 # The base image ships urllib3 2.5; pin up to a newer release. # Remove once the base image ships >=2.7 itself. urllib3>=2.7 +universal-pathlib vtk wavio xvfbwrapper