Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,9 @@ RUN uv pip uninstall --system --no-cache google-cloud-bigquery-storage
# to avoid affecting the larger build, we'll post-install it.
RUN uv pip install --no-build-isolation --no-cache --system "git+https://github.com/Kaggle/learntools"

# newer daal4py requires tbb>=2022, but libpysal is downgrading it for some reason
RUN uv pip install --system --no-cache "tbb>=2022" "libpysal==4.9.2"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the new colab base image includes tbb 2022.3.0 & libpysal 4.14.1. No reinstall needed.


# b/404590350: Ray and torchtune have conflicting tune cli, we will prioritize torchtune.
# b/315753846: Unpin translate package, currently conflicts with adk 1.17.0
# b/468379293: Unpin Pandas once cuml/cudf are compatible, version 3.0 causes issues
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

numpy/cudf: The pinned version are the ones now installed in the colab base image.

# b/468383498: numpy will auto-upgrade to 2.4.x, which causes issues with numerous packages
# b/404590350: Ray and torchtune have conflicting cli named `tune`. `ray` is not part of Colab's base image. Re-install `tune` to ensure the torchtune CLI is available by default.
# b/468367647: Unpin protobuf, version greater than v5.29.5 causes issues with numerous packages
RUN uv pip install --system --force-reinstall --no-cache --no-deps torchtune "google-cloud-translate==3.12.1" "numpy==2.0.2" "pandas==2.2.2"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

google-cloud-translate 3.24.0 and adk 1.21.0 are now installed in the new Colab base image.

RUN uv pip install --system --force-reinstall --no-cache --no-deps torchtune
RUN uv pip install --system --force-reinstall --no-cache "protobuf==5.29.5"

# Adding non-package dependencies:
Expand Down
2 changes: 1 addition & 1 deletion config.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BASE_IMAGE=us-docker.pkg.dev/colab-images/public/runtime
BASE_IMAGE_TAG=release-colab-external_20251024-060052_RC00
BASE_IMAGE_TAG=release-colab-external_20260126-060048_RC00
CUDA_MAJOR_VERSION=12
CUDA_MINOR_VERSION=5
6 changes: 3 additions & 3 deletions kaggle_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ keras-nlp
keras-tuner
kornia
langid
# b/328788268: libpysal 4.10 seems to fail with "module 'shapely' has no attribute 'Geometry'. Did you mean: 'geometry'"
libpysal<=4.9.2
libpysal
lime
line_profiler
mamba
Expand Down Expand Up @@ -116,8 +115,9 @@ scikit-plot
scikit-surprise
git+https://github.com/facebookresearch/segment-anything.git
squarify
tensorflow-cloud
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been unmaintained since 2021

tensorflow-io
# Must be compatible with torch version: https://github.com/meta-pytorch/torchcodec?tab=readme-ov-file#installing-torchcodec
torchcodec==0.9
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting in 2.9.0, torchaudio.load() uses torchcodec which needs to be installed separately.

See: https://docs.pytorch.org/audio/2.8/generated/torchaudio.load_with_torchcodec.html

torchinfo
torchmetrics
torchtune
Expand Down
8 changes: 0 additions & 8 deletions tests/test_tensorflow_cloud.py

This file was deleted.

9 changes: 4 additions & 5 deletions tests/test_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from kaggle_gcp import KaggleKernelCredentials, KaggleKernelWithProjetCredentials, init_translation_v2, init_translation_v3
from test.support.os_helper import EnvironmentVarGuard
from google.api_core import client_options
from google.cloud import translate, translate_v2
from google.cloud import translate_v3 as translate, translate_v2

def _make_credentials():
import google.auth.credentials
Expand Down Expand Up @@ -48,7 +48,7 @@ def test_user_provided_credentials_v2(self):
self.assertIsNotNone(client.credentials)
self.assertNotIsInstance(client.credentials, KaggleKernelCredentials)

@patch("google.cloud.translate.TranslationServiceClient", new=FakeClient)
@patch("google.cloud.translate_v3.TranslationServiceClient", new=FakeClient)
def test_default_credentials_v3(self):
env = EnvironmentVarGuard()
env.set('KAGGLE_USER_SECRETS_TOKEN', 'foobar')
Expand All @@ -60,7 +60,7 @@ def test_default_credentials_v3(self):
self.assertIsInstance(client.credentials, KaggleKernelCredentials)


@patch("google.cloud.translate.TranslationServiceClient", new=FakeClient)
@patch("google.cloud.translate_v3.TranslationServiceClient", new=FakeClient)
def test_user_provided_credentials_v3(self):
credentials = _make_credentials()
env = EnvironmentVarGuard()
Expand Down Expand Up @@ -107,13 +107,12 @@ def test_monkeypatching_idempotent(self):
self.assertEqual(client2_1, client2_2)
self.assertEqual(client3_1, client3_2)

@patch("google.cloud.translate.TranslationServiceClient", new=FakeClient)
@patch("google.cloud.translate_v3.TranslationServiceClient", new=FakeClient)
def test_client_credential_uniqueness_v3(self):
"""
Client instance must use unique KaggleKernelWithProjetCredentials with quota_project_id
when client_options.quota_project_id provided. (even if quota_project_id is same)
"""
credentials = _make_credentials()
env = EnvironmentVarGuard()
env.set('KAGGLE_USER_SECRETS_TOKEN', 'foobar')
env.set('KAGGLE_KERNEL_INTEGRATIONS', 'CLOUDAI')
Expand Down
16 changes: 0 additions & 16 deletions tests/test_user_secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,22 +200,6 @@ def call_get_cloudai_access_token():
client = UserSecretsClient()
secret_response = client._get_cloudai_access_token()
self.assertEqual(secret_response, (secret, now + timedelta(seconds=3600)))
def call_get_translation_access_token():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 4 methods were not called (dead code). The matching client._get_*_access_token() don't exist anymore. The AI Platform credentials are now used for accessing these services.

client = UserSecretsClient()
secret_response = client._get_translation_access_token()
self.assertEqual(secret_response, (secret, now + timedelta(seconds=3600)))
def call_get_natural_lang_access_token():
client = UserSecretsClient()
secret_response = client._get_natural_language_access_token()
self.assertEqual(secret_response, (secret, now + timedelta(seconds=3600)))
def call_get_video_intell_access_token():
client = UserSecretsClient()
secret_response = client._get_video_intelligence_access_token()
self.assertEqual(secret_response, (secret, now + timedelta(seconds=3600)))
def call_get_vision_access_token():
client = UserSecretsClient()
secret_response = client._get_vision_access_token()
self.assertEqual(secret_response, (secret, now + timedelta(seconds=3600)))

self._test_client(call_get_bigquery_access_token,
'/requests/GetUserSecretRequest', {'Target': GcpTarget.BIGQUERY.target},
Expand Down