Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Aug 21, 2024
1 parent 71d97bd commit f1958b3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/source/reference/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion sky/clouds/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions sky/clouds/utils/aws_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,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]
Expand Down
6 changes: 6 additions & 0 deletions sky/provision/aws/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ def _create_node_tag(target_instance, is_head: bool = True) -> str:
created_instances = []
if target_reservations:
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': {}
}
Expand All @@ -459,6 +462,9 @@ def _create_node_tag(target_instance, is_head: bool = True) -> str:
reverse=True)
for reservation, reservation_count in target_reservations_list:
if reservation_count <= 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(reservation_count, to_start_count)
logger.debug(f'Creating {reservation_count} instances '
Expand Down

0 comments on commit f1958b3

Please sign in to comment.