@@ -7,6 +7,10 @@ FROM gcr.io/kaggle-images/python-lightgbm-whl:${BASE_IMAGE_TAG}-${LIGHTGBM_VERSI
7
7
{{ end }}
8
8
FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG}
9
9
10
+ #b/415358342: UV reports missing requirements files https://github.com/googlecolab/colabtools/issues/5237
11
+ ENV UV_CONSTRAINT= \
12
+ UV_BUILD_CONSTRAINT=
13
+
10
14
ADD kaggle_requirements.txt /kaggle_requirements.txt
11
15
12
16
# Freeze existing requirements from base image for critical packages:
@@ -27,26 +31,19 @@ RUN uv pip install --system -r /requirements.txt
27
31
RUN uv pip uninstall --system google-cloud-bigquery-storage
28
32
29
33
# 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
33
-
34
- # b/408284435: Keras 3.6 broke test_keras.py > test_train > keras.datasets.mnist.load_data()
35
- # See https://github.com/keras-team/keras/commit/dcefb139863505d166dd1325066f329b3033d45a
36
- # 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"
34
+ # b/408284143: google-cloud-automl 2.0.0 introduced incompatible API changes, need to pin to 1.0.1,
35
+ # installed outside of kaggle_requirements.txt due to requiring an incompatibile version of protobuf.
36
+ RUN uv pip install --system --force-reinstall --prerelease=allow kagglehub[pandas-datasets,hf-datasets,signing]>=0.3.12 \
37
+ google-cloud-automl==1.0.1
39
38
40
39
# uv cannot install this in requirements.txt without --no-build-isolation
41
40
# to avoid affecting the larger build, we'll post-install it.
42
41
RUN uv pip install --no-build-isolation --system "git+https://github.com/Kaggle/learntools"
43
42
44
43
# 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
44
# This conflict causes a number of package downgrades, which are handled in this command
46
- # b/302136621: Fix eli5 import for learntools
47
45
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
-
46
+ "nvidia-cudnn-cu12==9.3.0.75"
50
47
RUN uv pip install --system --force-reinstall "pynvjitlink-cu12==0.5.2"
51
48
52
49
# b/385145217 Latest Colab lacks mkl numpy, install it.
@@ -56,10 +53,10 @@ RUN uv pip install --system --force-reinstall -i https://pypi.anaconda.org/intel
56
53
RUN uv pip install --system "tbb>=2022" "libpysal==4.9.2"
57
54
58
55
# b/404590350: Ray and torchtune have conflicting tune cli, we will prioritize torchtune.
59
- 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
60
58
61
59
# Adding non-package dependencies:
62
-
63
60
ADD clean-layer.sh /tmp/clean-layer.sh
64
61
ADD patches/nbconvert-extensions.tpl /opt/kaggle/nbconvert-extensions.tpl
65
62
ADD patches/template_conf.json /opt/kaggle/conf.json
@@ -171,13 +168,13 @@ RUN mkdir -p /root/.jupyter && touch /root/.jupyter/jupyter_nbconvert_config.py
171
168
mkdir -p /etc/ipython/ && echo "c = get_config(); c.IPKernelApp.matplotlib = 'inline'" > /etc/ipython/ipython_config.py && \
172
169
/tmp/clean-layer.sh
173
170
174
- # Fix to import bq_helper library without downgrading setuptools
171
+ # Fix to import bq_helper library without downgrading setuptools and upgrading protobuf
175
172
RUN mkdir -p ~/src && git clone https://github.com/SohierDane/BigQuery_Helper ~/src/BigQuery_Helper && \
176
173
mkdir -p ~/src/BigQuery_Helper/bq_helper && \
177
174
mv ~/src/BigQuery_Helper/bq_helper.py ~/src/BigQuery_Helper/bq_helper/__init__.py && \
178
175
mv ~/src/BigQuery_Helper/test_helper.py ~/src/BigQuery_Helper/bq_helper/ && \
179
176
sed -i 's/)/packages=["bq_helper"])/g' ~/src/BigQuery_Helper/setup.py && \
180
- uv pip install --system -e ~/src/BigQuery_Helper && \
177
+ uv pip install --system -e ~/src/BigQuery_Helper "protobuf<3.21" && \
181
178
/tmp/clean-layer.sh
182
179
183
180
0 commit comments