From 71ce79c55dca42df84e5ee43e2729665ed4b5650 Mon Sep 17 00:00:00 2001 From: Siyuan Date: Fri, 20 Oct 2023 15:25:37 -0700 Subject: [PATCH] update --- sky/provision/gcp/instance.py | 6 +++--- sky/provision/gcp/instance_utils.py | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sky/provision/gcp/instance.py b/sky/provision/gcp/instance.py index 06457d11128f..c216b66dfe0a 100644 --- a/sky/provision/gcp/instance.py +++ b/sky/provision/gcp/instance.py @@ -273,13 +273,13 @@ def wait_instances(region: str, cluster_name: str, def get_cluster_info( region: str, - cluster_name: str, + cluster_name_on_cloud: str, provider_config: Optional[Dict[str, Any]] = None) -> common.ClusterInfo: """See sky/provision/__init__.py""" - assert provider_config is not None, cluster_name + assert provider_config is not None, cluster_name_on_cloud zone = provider_config['availability_zone'] project_id = provider_config['project_id'] - label_filters = {TAG_RAY_CLUSTER_NAME: cluster_name} + label_filters = {TAG_RAY_CLUSTER_NAME: cluster_name_on_cloud} handlers: List[Type[instance_utils.GCPInstance]] = [ instance_utils.GCPComputeInstance diff --git a/sky/provision/gcp/instance_utils.py b/sky/provision/gcp/instance_utils.py index 407597ec01d0..32b17229c513 100644 --- a/sky/provision/gcp/instance_utils.py +++ b/sky/provision/gcp/instance_utils.py @@ -968,13 +968,16 @@ def set_labels(cls, node_id: str, labels: dict, wait_for_operation: bool = True) -> dict: + node = cls.load_resource().projects().locations().nodes().get( + name=node_id, + ) body = { "labels": dict(node["labels"], **labels), } update_mask = "labels" operation = (cls.load_resource().projects().locations().nodes().patch( - name=node["name"], + name=node_id, updateMask=update_mask, body=body, ).execute()) @@ -989,8 +992,12 @@ def set_labels(cls, @classmethod def create_instance(cls, + cluster_name: str, + project_id: str, + availability_zone: str, node_config: dict, labels: dict, + is_head_node: bool, wait_for_operation: bool = True) -> Tuple[dict, str]: raise NotImplementedError