GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Add Ray 2.33 support to SDK Client Builder, remove deprecated p… · googleapis/python-aiplatform@708a67b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • google/cloud/aiplatform/vertex_ray
    • client_builder.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎google/cloud/aiplatform/vertex_ray/client_builder.py‎

Copy file name to clipboardExpand all lines: google/cloud/aiplatform/vertex_ray/client_builder.py
+27-11Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
# Copyright 2023 Google LLC
3+
# Copyright 2024 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
1616
#
1717
import grpc
1818
import logging
19+
import ray
20+
1921
from typing import Dict
2022
from typing import Optional
2123
from google.cloud import aiplatform
@@ -45,16 +47,30 @@ def __init__(
4547
persistent_resource_id,
4648
" failed to start Head node properly.",
4749
)
48-
49-
super().__init__(
50-
dashboard_url=dashboard_uri,
51-
python_version=ray_client_context.python_version,
52-
ray_version=ray_client_context.ray_version,
53-
ray_commit=ray_client_context.ray_commit,
54-
protocol_version=ray_client_context.protocol_version,
55-
_num_clients=ray_client_context._num_clients,
56-
_context_to_restore=ray_client_context._context_to_restore,
57-
)
50+
if ray.__version__ == "2.33.0":
51+
super().__init__(
52+
dashboard_url=dashboard_uri,
53+
python_version=ray_client_context.python_version,
54+
ray_version=ray_client_context.ray_version,
55+
ray_commit=ray_client_context.ray_commit,
56+
_num_clients=ray_client_context._num_clients,
57+
_context_to_restore=ray_client_context._context_to_restore,
58+
)
59+
elif ray.__version__ == "2.9.3":
60+
super().__init__(
61+
dashboard_url=dashboard_uri,
62+
python_version=ray_client_context.python_version,
63+
ray_version=ray_client_context.ray_version,
64+
ray_commit=ray_client_context.ray_commit,
65+
protocol_version=ray_client_context.protocol_version,
66+
_num_clients=ray_client_context._num_clients,
67+
_context_to_restore=ray_client_context._context_to_restore,
68+
)
69+
else:
70+
raise ImportError(
71+
f"[Ray on Vertex AI]: Unsupported version {ray.__version__}."
72+
+ "Only 2.33.0 and 2.9.3 are supported."
73+
)
5874
self.persistent_resource_id = persistent_resource_id
5975
self.vertex_sdk_version = str(VERTEX_SDK_VERSION)
6076
self.shell_uri = ray_head_uris.get("RAY_HEAD_NODE_INTERACTIVE_SHELL_URI")

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.