diff --git a/docs/source/reference/config.rst b/docs/source/reference/config.rst index 8913841cb84..3c193a768c8 100644 --- a/docs/source/reference/config.rst +++ b/docs/source/reference/config.rst @@ -3,7 +3,7 @@ Advanced Configurations =========================== -You can pass **optional configuraitions** to SkyPilot in the ``~/.sky/config.yaml`` file. +You can pass **optional configurations** to SkyPilot in the ``~/.sky/config.yaml`` file. Such configurations apply to all new clusters and do not affect existing clusters. diff --git a/sky/clouds/cloud.py b/sky/clouds/cloud.py index de15f2070b8..9775109ac80 100644 --- a/sky/clouds/cloud.py +++ b/sky/clouds/cloud.py @@ -179,7 +179,7 @@ def regions_with_offering(cls, instance_type: str, @classmethod def optimize_by_zone(cls) -> bool: - """Returns whether the optimizer by zone.""" + """Returns whether to optimize this cloud by zone (default: region).""" return False @classmethod diff --git a/sky/clouds/utils/aws_utils.py b/sky/clouds/utils/aws_utils.py index fbf1a4f8f3b..49cb2810e16 100644 --- a/sky/clouds/utils/aws_utils.py +++ b/sky/clouds/utils/aws_utils.py @@ -45,8 +45,6 @@ def list_reservations_for_instance_type( if not use_reservations(): return [] ec2 = aws.client('ec2', region_name=region) - # TODO(zhwu): We need to test the tenancy to make sure the current active - # user can consume the reservations. response = ec2.describe_capacity_reservations(Filters=[{ 'Name': 'instance-type', 'Values': [instance_type] diff --git a/sky/provision/aws/instance.py b/sky/provision/aws/instance.py index 94afa376ed3..664439dfe88 100644 --- a/sky/provision/aws/instance.py +++ b/sky/provision/aws/instance.py @@ -439,6 +439,9 @@ def _create_node_tag(target_instance, is_head: bool = True) -> str: created_instances = [] if target_reservation_names: node_config = copy.deepcopy(config.node_config) + # Clear the capacity reservation specification settings in the + # original node config, as we will create instances with + # reservations with specific settings for each reservation. node_config['CapacityReservationSpecification'] = { 'CapacityReservationTarget': {} } @@ -461,6 +464,9 @@ def _create_node_tag(target_instance, is_head: bool = True) -> str: reverse=True) for r in target_reservations_list: if r.available_resources <= 0: + # We have sorted the reservations by the available resources, + # so if the reservation is not available, the following + # reservations are not available either. break reservation_count = min(r.available_resources, to_start_count) logger.debug(f'Creating {reservation_count} instances '