Skip to content

Commit 8e6df42

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
feat: Add Ray 2.47 support to RoV Bigquery read/write
PiperOrigin-RevId: 784263792
1 parent 7319600 commit 8e6df42

5 files changed

Lines changed: 24 additions & 23 deletions

File tree

google/cloud/aiplatform/vertex_ray/bigquery_datasink.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
)
5252

5353

54-
# BigQuery write for Ray 2.42.0, 2.33.0, and 2.9.3
54+
# BigQuery write for Ray 2.47.1, 2.42.0, 2.33.0, and 2.9.3
5555
if Datasink is None:
5656
_BigQueryDatasink = None
5757
else:

google/cloud/aiplatform/vertex_ray/dashboard_sdk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_job_submission_client_cluster_info(
2929
"""A vertex_ray implementation of get_job_submission_client_cluster_info().
3030
3131
Implements
32-
https://github.com/ray-project/ray/blob/ray-2.42.0/python/ray/dashboard/modules/dashboard_sdk.py#L84
32+
https://github.com/ray-project/ray/blob/ray-2.47.1/python/ray/dashboard/modules/dashboard_sdk.py#L84
3333
This will be called in from Ray Job API Python client.
3434
3535
Args:

google/cloud/aiplatform/vertex_ray/data.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ def read_bigquery(
6161
executing the query if provided. Otherwise, the entire dataset is read.
6262
For query syntax guidelines, see
6363
https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax
64-
parallelism: 2.33.0, 2.42.0: This argument is deprecated. Use
64+
parallelism: 2.33.0, 2.42.0, 2.47.1: This argument is deprecated. Use
6565
``override_num_blocks`` argument. 2.9.3: The requested parallelism of
6666
the read. If -1, it will be automatically chosen based on the available
6767
cluster resources and estimated in-memory data size.
6868
ray_remote_args: kwargs passed to ray.remote in the read tasks.
69-
concurrency: Supported for 2.33.0 and 2.42.0 only: The maximum number of
69+
concurrency: Supported for 2.33.0, 2.42.0 and 2.47.1 only: The maximum number of
7070
Ray tasks to run concurrently. Set this to control number of tasks to
7171
run concurrently. This doesn't change the total number of tasks run or
7272
the total number of output blocks. By default, concurrency is
7373
dynamically decided based on the available resources.
74-
override_num_blocks: Supported for 2.33.0 and 2.42.0 only: Override the
74+
override_num_blocks: Supported for 2.33.0, 2.42.0 and 2.47.1 only: Override the
7575
number of output blocks from all read tasks. By default, the number of
7676
output blocks is dynamically decided based on input data size and
7777
available resources. You shouldn't manually set this value in most
@@ -95,7 +95,7 @@ def read_bigquery(
9595
parallelism=parallelism,
9696
ray_remote_args=ray_remote_args,
9797
)
98-
elif ray.__version__ in ("2.33.0", "2.42.0"):
98+
elif ray.__version__ in ("2.33.0", "2.42.0", "2.47.1"):
9999
return ray.data.read_datasource(
100100
datasource=datasource,
101101
parallelism=parallelism,
@@ -106,7 +106,7 @@ def read_bigquery(
106106
else:
107107
raise ImportError(
108108
f"[Ray on Vertex AI]: Unsupported version {ray.__version__}."
109-
+ "Only 2.42.0, 2.33.0, and 2.9.3 are supported."
109+
+ "Only 2.47.1, 2.42.0, 2.33.0, and 2.9.3 are supported."
110110
)
111111

112112

@@ -134,19 +134,20 @@ def write_bigquery(
134134
The default number of retries is 10.
135135
ray_remote_args: kwargs passed to ray.remote in the write tasks.
136136
overwrite_table: Not supported in 2.9.3.
137-
2.33.0, 2.42.0: Whether the write will overwrite the table if it already
138-
exists. The default behavior is to overwrite the table.
137+
2.33.0, 2.42.0, 2.47.1: Whether the write will overwrite the table
138+
if it already exists. The default behavior is to overwrite the table.
139139
If false, will append to the table if it exists.
140140
concurrency: Not supported in 2.9.3.
141-
2.33.0, 2.42.0: The maximum number of Ray tasks to run concurrently. Set this
142-
to control number of tasks to run concurrently. This doesn't change the
143-
total number of tasks run or the total number of output blocks. By default,
144-
concurrency is dynamically decided based on the available resources.
141+
2.33.0, 2.42.0, 2.47.1: The maximum number of Ray tasks to run concurrently.
142+
Set this to control number of tasks to run concurrently. This doesn't
143+
change the total number of tasks run or the total number of output blocks.
144+
By default, concurrency is dynamically decided based on the available
145+
resources.
145146
"""
146147
if ray.__version__ == "2.4.0":
147148
raise RuntimeError(_V2_4_WARNING_MESSAGE)
148149

149-
elif ray.__version__ in ("2.9.3", "2.33.0", "2.42.0"):
150+
elif ray.__version__ in ("2.9.3", "2.33.0", "2.42.0", "2.47.1"):
150151
if ray.__version__ == "2.9.3":
151152
warnings.warn(_V2_9_WARNING_MESSAGE, DeprecationWarning, stacklevel=1)
152153
if ray_remote_args is None:
@@ -173,7 +174,7 @@ def write_bigquery(
173174
datasink=datasink,
174175
ray_remote_args=ray_remote_args,
175176
)
176-
elif ray.__version__ in ("2.33.0", "2.42.0"):
177+
elif ray.__version__ in ("2.33.0", "2.42.0", "2.47.1"):
177178
datasink = _BigQueryDatasink(
178179
project_id=project_id,
179180
dataset=dataset,
@@ -188,5 +189,5 @@ def write_bigquery(
188189
else:
189190
raise ImportError(
190191
f"[Ray on Vertex AI]: Unsupported version {ray.__version__}."
191-
+ "Only 2.42.0, 2.33.0 and 2.9.3 are supported."
192+
+ "Only 2.47.1, 2.42.0, 2.33.0 and 2.9.3 are supported."
192193
)

google/cloud/aiplatform/vertex_ray/util/_validation_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@
2626
from google.cloud.aiplatform.utils import resource_manager_utils
2727

2828
SUPPORTED_RAY_VERSIONS = immutabledict(
29-
{"2.9": "2.9.3", "2.33": "2.33.0", "2.42": "2.42.0"}
29+
{"2.9": "2.9.3", "2.33": "2.33.0", "2.42": "2.42.0", "2.47": "2.47.1"}
3030
)
3131
SUPPORTED_RAY_VERSIONS_FROM_PYTHON_VERSIONS = immutabledict(
3232
{
3333
"3.10": ("2.9", "2.33", "2.42"),
34-
"3.11": ("2.42"),
34+
"3.11": ("2.42", "2.47"),
3535
}
3636
)
3737
_V2_4_WARNING_MESSAGE = (
38-
"After google-cloud-aiplatform>1.53.0, using Ray version = 2.4 will result"
39-
" in an error. Please use Ray version = 2.33.0 or 2.42.0 (default) instead."
38+
"After google-cloud-aiplatform>1.53.0, using Ray version = 2.4 will result in "
39+
"an error. Please use Ray version = 2.33.0, 2.42.0 or 2.47.1 (default) instead."
4040
)
4141
_V2_9_WARNING_MESSAGE = (
4242
"In March 2025, using Ray version = 2.9 will result in an error. "
43-
"Please use Ray version = 2.33.0 or 2.42.0 (default) instead."
43+
"Please use Ray version = 2.33.0, 2.42.0, or 2.47.1 (default) instead."
4444
)
4545

4646

tests/unit/vertex_ray/test_cluster_init.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
_TEST_RESPONSE_RUNNING_1_POOL_RESIZE_0_WORKER.resource_pools[0].replica_count = 1
5454

5555
_TEST_V2_4_WARNING_MESSAGE = (
56-
"After google-cloud-aiplatform>1.53.0, using Ray version = 2.4 will result"
57-
" in an error. Please use Ray version = 2.33.0 or 2.42.0 (default) instead."
56+
"After google-cloud-aiplatform>1.53.0, using Ray version = 2.4 will result in "
57+
"an error. Please use Ray version = 2.33.0, 2.42.0 or 2.47.1 (default) instead."
5858
)
5959

6060

0 commit comments

Comments
 (0)