Skip to content

Commit

Permalink
chore: Use full path for Ray on Vertex Job Submission Client prefix
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 586736110
  • Loading branch information
matthew29tang authored and Copybara-Service committed Nov 30, 2023
1 parent 9a204c4 commit ae3677c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions tests/system/vertex_ray/test_cluster_management.py
Expand Up @@ -18,6 +18,7 @@
from google.cloud import aiplatform
from google.cloud.aiplatform.preview import vertex_ray
from tests.system.aiplatform import e2e_base
import datetime
import ray

RAY_VERSION = "2.4.0"
Expand All @@ -36,9 +37,12 @@ def test_cluster_management(self):
head_node_type = vertex_ray.Resources()
worker_node_types = [vertex_ray.Resources()]

timestamp = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")

cluster_resource_name = vertex_ray.create_ray_cluster(
head_node_type=head_node_type,
worker_node_types=worker_node_types,
cluster_name=f"ray-cluster-{timestamp}-test-cluster-management",
)

cluster_details = vertex_ray.get_ray_cluster(cluster_resource_name)
Expand Down
10 changes: 8 additions & 2 deletions tests/system/vertex_ray/test_job_submission_dashboard.py
Expand Up @@ -19,6 +19,7 @@
from google.cloud.aiplatform.preview import vertex_ray
from ray.job_submission import JobSubmissionClient
from tests.system.aiplatform import e2e_base
import datetime
import os
import ray
import time
Expand All @@ -39,17 +40,22 @@ def test_job_submission_dashboard(self):
head_node_type = vertex_ray.Resources()
worker_node_types = [vertex_ray.Resources()]

timestamp = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")

# Create cluster, get dashboard address
cluster_resource_name = vertex_ray.create_ray_cluster(
head_node_type=head_node_type,
worker_node_types=worker_node_types,
cluster_name=f"ray-cluster{timestamp}-test-job-submission-dashboard",
)

cluster_details = vertex_ray.get_ray_cluster(cluster_resource_name)

# Connect to cluster
# Need to use the full path since the installation is editable, not from a release
client = JobSubmissionClient(
"vertex_ray://{}".format(cluster_details.dashboard_address)
"google.cloud.aiplatform.preview.vertex_ray://{}".format(
cluster_details.dashboard_address
)
)

my_script = """
Expand Down

0 comments on commit ae3677c

Please sign in to comment.