From dd5d5cb003bd193a41442dbf5cc42aa8915a6286 Mon Sep 17 00:00:00 2001 From: A Vertex SDK engineer Date: Fri, 7 Mar 2025 11:45:42 -0800 Subject: [PATCH] feat: Add Ray 2.42 support to SDK Client Builder FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/googleapis/python-aiplatform/pull/4990 from googleapis:release-please--branches--main dc59b4d8695a379f75d0451d20e199fa16e890d7 PiperOrigin-RevId: 734636080 --- google/cloud/aiplatform/vertex_ray/client_builder.py | 6 +++--- google/cloud/aiplatform/vertex_ray/dashboard_sdk.py | 8 ++++---- setup.py | 11 +++++++---- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/google/cloud/aiplatform/vertex_ray/client_builder.py b/google/cloud/aiplatform/vertex_ray/client_builder.py index ce745435c1..4154c0c5d9 100644 --- a/google/cloud/aiplatform/vertex_ray/client_builder.py +++ b/google/cloud/aiplatform/vertex_ray/client_builder.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2024 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ def __init__( persistent_resource_id, " failed to start Head node properly.", ) - if ray.__version__ == "2.33.0": + if ray.__version__ in ("2.42.0", "2.33.0"): super().__init__( dashboard_url=dashboard_uri, python_version=ray_client_context.python_version, @@ -69,7 +69,7 @@ def __init__( else: raise ImportError( f"[Ray on Vertex AI]: Unsupported version {ray.__version__}." - + "Only 2.33.0 and 2.9.3 are supported." + + "Only 2.42.0, 2.33.0, and 2.9.3 are supported." ) self.persistent_resource_id = persistent_resource_id self.vertex_sdk_version = str(VERTEX_SDK_VERSION) diff --git a/google/cloud/aiplatform/vertex_ray/dashboard_sdk.py b/google/cloud/aiplatform/vertex_ray/dashboard_sdk.py index 680e772724..3598f70776 100644 --- a/google/cloud/aiplatform/vertex_ray/dashboard_sdk.py +++ b/google/cloud/aiplatform/vertex_ray/dashboard_sdk.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2024 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,15 +29,15 @@ def get_job_submission_client_cluster_info( """A vertex_ray implementation of get_job_submission_client_cluster_info(). Implements - https://github.com/ray-project/ray/blob/ray-2.33.0/python/ray/dashboard/modules/dashboard_sdk.py#L84 + https://github.com/ray-project/ray/blob/ray-2.42.0/python/ray/dashboard/modules/dashboard_sdk.py#L84 This will be called in from Ray Job API Python client. Args: address: Address without the module prefix `vertex_ray` but otherwise the same format as passed to ray.init(address="vertex_ray://..."). - *args: Reminder of positional args that might be passed down from + *args: Remainder of positional args that might be passed down from the framework. - **kwargs: Reminder of keyword args that might be passed down from + **kwargs: Remainder of keyword args that might be passed down from the framework. Returns: diff --git a/setup.py b/setup.py index 7e9cd2ed08..768d6abf84 100644 --- a/setup.py +++ b/setup.py @@ -101,19 +101,22 @@ preview_extra_require = [] ray_extra_require = [ - # Cluster only supports 2.9.3 and 2.33.0. Keep 2.4.0 for our testing environment. + # Cluster only supports 2.9.3, 2.33.0, and 2.42.0. Keep 2.4.0 for our + # testing environment. # Note that testing is submiting a job in a cluster with Ray 2.9.3 remotely. ( - "ray[default] >= 2.4, <= 2.33.0,!= 2.5.*,!= 2.6.*,!= 2.7.*,!=" + "ray[default] >= 2.4, <= 2.42.0,!= 2.5.*,!= 2.6.*,!= 2.7.*,!=" " 2.8.*,!=2.9.0,!=2.9.1,!=2.9.2, !=2.10.*, !=2.11.*, !=2.12.*, !=2.13.*, !=" " 2.14.*, !=2.15.*, !=2.16.*, !=2.17.*, !=2.18.*, !=2.19.*, !=2.20.*, !=" " 2.21.*, !=2.22.*, !=2.23.*, !=2.24.*, !=2.25.*, !=2.26.*, !=2.27.*, !=" - " 2.28.*, !=2.29.*, !=2.30.*, !=2.31.*, !=2.32.*; python_version<'3.11'" + " 2.28.*, !=2.29.*, !=2.30.*, !=2.31.*, !=2.32.*, !=2.34.*, !=2.35.*, !=" + " 2.36.*, !=2.37.*, !=2.38.*, !=2.39.*, !=2.40.*, !=2.41.*;" + " python_version<'3.11'" ), # To avoid ImportError: cannot import name 'packaging' from 'pkg_resources' "setuptools < 70.0.0", # Ray Data v2.4 in Python 3.11 is broken, but got fixed in Ray v2.5. - "ray[default] >= 2.5, <= 2.33.0; python_version=='3.11'", + "ray[default] >= 2.5, <= 2.42.0; python_version=='3.11'", "google-cloud-bigquery-storage", "google-cloud-bigquery", "pandas >= 1.0.0",