Skip to content

Commit

Permalink
feat: raise error if not 1 head instance created; privte ips from api
Browse files Browse the repository at this point in the history
  • Loading branch information
kmushegi committed Aug 30, 2024
1 parent 6709bcd commit cbbb07c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sky/provision/lambda_cloud/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@ def launch_nodes(node_type: str, quantity: int):
raise

if head_instance_id is None:
instance_id = launch_nodes('head', 1)[0]
created_instance_ids.append(instance_id)
head_instance_id = instance_id
instance_ids = launch_nodes('head', 1)
if len(instance_ids) != 1:
raise RuntimeError(f"Expected exactly one instance, got {len(instance_ids)}")
created_instance_ids.append(instance_ids[0])
head_instance_id = instance_ids[0]

assert head_instance_id is not None, 'head_instance_id should not be None'

Expand Down Expand Up @@ -201,10 +203,8 @@ def get_cluster_info(
instances[instance_id] = [
common.InstanceInfo(
instance_id=instance_id,
# TODO (kmushegi): check if this is correct;
# external ip is preferred
internal_ip='',
external_ip=instance_info['ip'],
internal_ip=instance_info["private_ip"],
external_ip=instance_info["ip"],
ssh_port=22,
tags={},
)
Expand Down

0 comments on commit cbbb07c

Please sign in to comment.