@@ -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:
@@ -29,39 +33,30 @@ ENV PATH="~/.local/bin:${PATH}"
29
33
RUN uv pip uninstall --system google-cloud-bigquery-storage
30
34
31
35
# 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
35
39
36
40
# b/408284435: Keras 3.6 broke test_keras.py > test_train > keras.datasets.mnist.load_data()
37
41
# See https://github.com/keras-team/keras/commit/dcefb139863505d166dd1325066f329b3033d45a
38
42
# 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"
41
44
42
45
# uv cannot install this in requirements.txt without --no-build-isolation
43
46
# to avoid affecting the larger build, we'll post-install it.
44
47
RUN uv pip install --no-build-isolation --system "git+https://github.com/Kaggle/learntools"
45
48
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
-
54
49
# b/385145217 Latest Colab lacks mkl numpy, install it.
55
50
RUN uv pip install --system --force-reinstall -i https://pypi.anaconda.org/intel/simple numpy
56
51
57
52
# newer daal4py requires tbb>=2022, but libpysal is downgrading it for some reason
58
53
RUN uv pip install --system "tbb>=2022" "libpysal==4.9.2"
59
54
60
55
# 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
62
58
63
59
# Adding non-package dependencies:
64
-
65
60
ADD clean-layer.sh /tmp/clean-layer.sh
66
61
ADD patches/nbconvert-extensions.tpl /opt/kaggle/nbconvert-extensions.tpl
67
62
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
181
176
mkdir -p /etc/ipython/ && echo "c = get_config(); c.IPKernelApp.matplotlib = 'inline'" > /etc/ipython/ipython_config.py && \
182
177
/tmp/clean-layer.sh
183
178
184
- # Fix to import bq_helper library without downgrading setuptools
179
+ # Fix to import bq_helper library without downgrading setuptools and upgrading protobuf
185
180
RUN mkdir -p ~/src && git clone https://github.com/SohierDane/BigQuery_Helper ~/src/BigQuery_Helper && \
186
181
mkdir -p ~/src/BigQuery_Helper/bq_helper && \
187
182
mv ~/src/BigQuery_Helper/bq_helper.py ~/src/BigQuery_Helper/bq_helper/__init__.py && \
188
183
mv ~/src/BigQuery_Helper/test_helper.py ~/src/BigQuery_Helper/bq_helper/ && \
189
184
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" && \
191
186
/tmp/clean-layer.sh
192
187
193
188
0 commit comments