Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
suquark committed Oct 20, 2023
1 parent ecca47e commit 71ce79c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions sky/provision/gcp/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion sky/provision/gcp/instance_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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

Expand Down

0 comments on commit 71ce79c

Please sign in to comment.