Skip to content

Commit 51c7de1

Browse files
committed
Update base image
1 parent 3cdabdf commit 51c7de1

5 files changed

Lines changed: 33 additions & 20 deletions

File tree

Dockerfile.tmpl

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ FROM gcr.io/kaggle-images/python-lightgbm-whl:${BASE_IMAGE_TAG}-${LIGHTGBM_VERSI
77
{{ end }}
88
FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG}
99

10+
#b/415358342: UV reports missing requirements files https://github.com/googlecolab/colabtools/issues/5237
11+
ENV UV_CONSTRAINT= \
12+
UV_BUILD_CONSTRAINT=
13+
1014
ADD kaggle_requirements.txt /kaggle_requirements.txt
1115

1216
# Freeze existing requirements from base image for critical packages:
@@ -27,39 +31,30 @@ RUN uv pip install --system -r /requirements.txt
2731
RUN uv pip uninstall --system google-cloud-bigquery-storage
2832

2933
# b/394382016: sigstore (dependency of kagglehub) requires a prerelease packages, installing separate.
30-
RUN uv pip install --system --force-reinstall --prerelease=allow kagglehub[pandas-datasets,hf-datasets,signing]>=0.3.9
31-
32-
# b/408284143: google-cloud-automl 2.0.0 introduced incompatible API changes, need to pin to 1.0.1
34+
# google-cloud-automl 2.0.0 introduced incompatible API changes, need to pin to 1.0.1
35+
RUN uv pip install --system --force-reinstall --prerelease=allow kagglehub[pandas-datasets,hf-datasets,signing]>=0.3.12 \
36+
google-cloud-automl==1.0.1
3337

3438
# b/408284435: Keras 3.6 broke test_keras.py > test_train > keras.datasets.mnist.load_data()
3539
# See https://github.com/keras-team/keras/commit/dcefb139863505d166dd1325066f329b3033d45a
3640
# Colab base is on Keras 3.8, we have to install the package separately
37-
RUN uv pip install --system google-cloud-automl==1.0.1 google-cloud-aiplatform google-cloud-translate==3.12.1 \
38-
google-cloud-videointelligence google-cloud-vision google-genai "keras<3.6"
41+
RUN uv pip install --system "keras<3.6"
3942

4043
# uv cannot install this in requirements.txt without --no-build-isolation
4144
# to avoid affecting the larger build, we'll post-install it.
4245
RUN uv pip install --no-build-isolation --system "git+https://github.com/Kaggle/learntools"
4346

44-
# b/408281617: Torch is adamant that it can not install cudnn 9.3.x, only 9.1.x, but Tensorflow can only support 9.3.x.
45-
# This conflict causes a number of package downgrades, which are handled in this command
46-
# b/302136621: Fix eli5 import for learntools
47-
RUN uv pip install --system --force-reinstall --extra-index-url https://pypi.nvidia.com "cuml-cu12==25.2.1" \
48-
"nvidia-cudnn-cu12==9.3.0.75" scipy tsfresh scikit-learn==1.2.2 category-encoders eli5
49-
50-
RUN uv pip install --system --force-reinstall "pynvjitlink-cu12==0.5.2"
51-
5247
# b/385145217 Latest Colab lacks mkl numpy, install it.
5348
RUN uv pip install --system --force-reinstall -i https://pypi.anaconda.org/intel/simple numpy
5449

5550
# newer daal4py requires tbb>=2022, but libpysal is downgrading it for some reason
5651
RUN uv pip install --system "tbb>=2022" "libpysal==4.9.2"
5752

5853
# b/404590350: Ray and torchtune have conflicting tune cli, we will prioritize torchtune.
59-
RUN uv pip install --system --force-reinstall --no-deps torchtune
54+
# b/415358158: Gensim removed from Colab image to upgrade scipy
55+
RUN uv pip install --system --force-reinstall --no-deps torchtune gensim
6056

6157
# Adding non-package dependencies:
62-
6358
ADD clean-layer.sh /tmp/clean-layer.sh
6459
ADD patches/nbconvert-extensions.tpl /opt/kaggle/nbconvert-extensions.tpl
6560
ADD patches/template_conf.json /opt/kaggle/conf.json
@@ -171,13 +166,13 @@ RUN mkdir -p /root/.jupyter && touch /root/.jupyter/jupyter_nbconvert_config.py
171166
mkdir -p /etc/ipython/ && echo "c = get_config(); c.IPKernelApp.matplotlib = 'inline'" > /etc/ipython/ipython_config.py && \
172167
/tmp/clean-layer.sh
173168
174-
# Fix to import bq_helper library without downgrading setuptools
169+
# Fix to import bq_helper library without downgrading setuptools and upgrading protobuf
175170
RUN mkdir -p ~/src && git clone https://github.com/SohierDane/BigQuery_Helper ~/src/BigQuery_Helper && \
176171
mkdir -p ~/src/BigQuery_Helper/bq_helper && \
177172
mv ~/src/BigQuery_Helper/bq_helper.py ~/src/BigQuery_Helper/bq_helper/__init__.py && \
178173
mv ~/src/BigQuery_Helper/test_helper.py ~/src/BigQuery_Helper/bq_helper/ && \
179174
sed -i 's/)/packages=["bq_helper"])/g' ~/src/BigQuery_Helper/setup.py && \
180-
uv pip install --system -e ~/src/BigQuery_Helper && \
175+
uv pip install --system -e ~/src/BigQuery_Helper "protobuf<3.21"&& \
181176
/tmp/clean-layer.sh
182177
183178

config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
BASE_IMAGE=us-docker.pkg.dev/colab-images/public/runtime
2-
BASE_IMAGE_TAG=release-colab_20250219-060225_RC01
2+
BASE_IMAGE_TAG=release-colab_20250404-060113_RC00
33
LIGHTGBM_VERSION=4.6.0
44
CUDA_MAJOR_VERSION=12
55
CUDA_MINOR_VERSION=5

kaggle_requirements.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ arrow
2020
bayesian-optimization
2121
boto3
2222
catboost
23+
category-encoders
2324
cesium
2425
comm
2526
cytoolz
@@ -32,6 +33,8 @@ deap
3233
dipy
3334
docker
3435
easyocr
36+
# b/302136621: Fix eli5 import for learntools
37+
eli5
3538
emoji
3639
fastcore>=1.7.20
3740
fasttext
@@ -42,6 +45,13 @@ fuzzywuzzy
4245
geojson
4346
# geopandas > v0.14.4 breaks learn tools
4447
geopandas==v0.14.4
48+
gensim
49+
google-cloud-aiplatform
50+
# b/315753846: Unpin translate package.
51+
google-cloud-translate==3.12.1
52+
google-cloud-videointelligence
53+
google-cloud-vision
54+
google-genai
4555
gpxpy
4656
h2o
4757
haversine
@@ -112,12 +122,16 @@ qtconsole
112122
ray
113123
rgf-python
114124
s3fs
125+
# b/302136621: Fix eli5 import for learntools
126+
scikit-learn==1.2.2
115127
# Scikit-learn accelerated library for x86
116128
scikit-learn-intelex>=2023.0.1
117129
scikit-multilearn
118130
scikit-optimize
119131
scikit-plot
120132
scikit-surprise
133+
# b/415358158: Gensim removed from Colab image to upgrade scipy to 1.14.1
134+
scipy==1.15.1
121135
# Also pinning seaborn for learntools
122136
seaborn==0.12.2
123137
git+https://github.com/facebookresearch/segment-anything.git

tests/test_automl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
def _make_credentials():
1010
import google.auth.credentials
11-
return Mock(spec=google.auth.credentials.Credentials)
11+
credentials = Mock(spec=google.auth.credentials.Credentials)
12+
credentials.universe_domain = 'googleapis.com'
13+
return credentials
1214

1315
class TestAutoMl(unittest.TestCase):
1416

tests/test_gcs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
def _make_credentials():
1010
import google.auth.credentials
11-
return Mock(spec=google.auth.credentials.Credentials)
11+
credentials = Mock(spec=google.auth.credentials.Credentials)
12+
credentials.universe_domain = 'googleapis.com'
13+
return credentials
1214

1315
class TestStorage(unittest.TestCase):
1416

0 commit comments

Comments
 (0)