Skip to content

Commit b3a02d4

Browse files
committed
Update base image
1 parent f48df1d commit b3a02d4

File tree

5 files changed

+33
-20
lines changed

5 files changed

+33
-20
lines changed

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:
@@ -29,39 +33,30 @@ ENV PATH="~/.local/bin:${PATH}"
2933
RUN uv pip uninstall --system google-cloud-bigquery-storage
3034

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

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

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

46-
# 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.
47-
# This conflict causes a number of package downgrades, which are handled in this command
48-
# b/302136621: Fix eli5 import for learntools
49-
RUN uv pip install --system --force-reinstall --extra-index-url https://pypi.nvidia.com "cuml-cu12==25.2.1" \
50-
"nvidia-cudnn-cu12==9.3.0.75" scipy tsfresh scikit-learn==1.2.2 category-encoders eli5
51-
52-
RUN uv pip install --system --force-reinstall "pynvjitlink-cu12==0.5.2"
53-
5449
# b/385145217 Latest Colab lacks mkl numpy, install it.
5550
RUN uv pip install --system --force-reinstall -i https://pypi.anaconda.org/intel/simple numpy
5651

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

6055
# b/404590350: Ray and torchtune have conflicting tune cli, we will prioritize torchtune.
61-
RUN uv pip install --system --force-reinstall --no-deps torchtune
56+
# b/415358158: Gensim removed from Colab image to upgrade scipy
57+
RUN uv pip install --system --force-reinstall --no-deps torchtune gensim
6258

6359
# Adding non-package dependencies:
64-
6560
ADD clean-layer.sh /tmp/clean-layer.sh
6661
ADD patches/nbconvert-extensions.tpl /opt/kaggle/nbconvert-extensions.tpl
6762
ADD patches/template_conf.json /opt/kaggle/conf.json
@@ -181,13 +176,13 @@ RUN mkdir -p /root/.jupyter && touch /root/.jupyter/jupyter_nbconvert_config.py
181176
mkdir -p /etc/ipython/ && echo "c = get_config(); c.IPKernelApp.matplotlib = 'inline'" > /etc/ipython/ipython_config.py && \
182177
/tmp/clean-layer.sh
183178

184-
# Fix to import bq_helper library without downgrading setuptools
179+
# Fix to import bq_helper library without downgrading setuptools and upgrading protobuf
185180
RUN mkdir -p ~/src && git clone https://github.com/SohierDane/BigQuery_Helper ~/src/BigQuery_Helper && \
186181
mkdir -p ~/src/BigQuery_Helper/bq_helper && \
187182
mv ~/src/BigQuery_Helper/bq_helper.py ~/src/BigQuery_Helper/bq_helper/__init__.py && \
188183
mv ~/src/BigQuery_Helper/test_helper.py ~/src/BigQuery_Helper/bq_helper/ && \
189184
sed -i 's/)/packages=["bq_helper"])/g' ~/src/BigQuery_Helper/setup.py && \
190-
uv pip install --system -e ~/src/BigQuery_Helper && \
185+
uv pip install --system -e ~/src/BigQuery_Helper "protobuf<3.21"&& \
191186
/tmp/clean-layer.sh
192187

193188

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)