skypilot-nightly 1.0.0.dev20250119__py3-none-any.whl → 1.0.0.dev20250121__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sky/__init__.py +2 -2
- sky/provision/aws/config.py +48 -26
- sky/serve/autoscalers.py +359 -301
- sky/serve/controller.py +10 -8
- sky/serve/core.py +54 -2
- sky/serve/load_balancer.py +27 -10
- sky/serve/serve_state.py +10 -5
- sky/serve/serve_utils.py +28 -1
- sky/serve/service.py +4 -3
- sky/serve/service_spec.py +31 -0
- sky/templates/sky-serve-controller.yaml.j2 +4 -0
- sky/utils/schemas.py +13 -0
- {skypilot_nightly-1.0.0.dev20250119.dist-info → skypilot_nightly-1.0.0.dev20250121.dist-info}/METADATA +1 -1
- {skypilot_nightly-1.0.0.dev20250119.dist-info → skypilot_nightly-1.0.0.dev20250121.dist-info}/RECORD +18 -18
- {skypilot_nightly-1.0.0.dev20250119.dist-info → skypilot_nightly-1.0.0.dev20250121.dist-info}/LICENSE +0 -0
- {skypilot_nightly-1.0.0.dev20250119.dist-info → skypilot_nightly-1.0.0.dev20250121.dist-info}/WHEEL +0 -0
- {skypilot_nightly-1.0.0.dev20250119.dist-info → skypilot_nightly-1.0.0.dev20250121.dist-info}/entry_points.txt +0 -0
- {skypilot_nightly-1.0.0.dev20250119.dist-info → skypilot_nightly-1.0.0.dev20250121.dist-info}/top_level.txt +0 -0
sky/__init__.py
CHANGED
@@ -5,7 +5,7 @@ from typing import Optional
|
|
5
5
|
import urllib.request
|
6
6
|
|
7
7
|
# Replaced with the current commit when building the wheels.
|
8
|
-
_SKYPILOT_COMMIT_SHA = '
|
8
|
+
_SKYPILOT_COMMIT_SHA = '8cf6c86efd3ed007a944422141efbdb0fbb6547f'
|
9
9
|
|
10
10
|
|
11
11
|
def _get_git_commit():
|
@@ -35,7 +35,7 @@ def _get_git_commit():
|
|
35
35
|
|
36
36
|
|
37
37
|
__commit__ = _get_git_commit()
|
38
|
-
__version__ = '1.0.0.
|
38
|
+
__version__ = '1.0.0.dev20250121'
|
39
39
|
__root_dir__ = os.path.dirname(os.path.abspath(__file__))
|
40
40
|
|
41
41
|
|
sky/provision/aws/config.py
CHANGED
@@ -553,17 +553,28 @@ def _configure_security_group(ec2, vpc_id: str, expected_sg_name: str,
|
|
553
553
|
|
554
554
|
def _get_or_create_vpc_security_group(ec2, vpc_id: str,
|
555
555
|
expected_sg_name: str) -> Any:
|
556
|
-
|
557
|
-
vpc_to_existing_sg = {
|
558
|
-
sg.vpc_id: sg for sg in _get_security_groups_from_vpc_ids(
|
559
|
-
ec2,
|
560
|
-
[vpc_id],
|
561
|
-
[expected_sg_name],
|
562
|
-
)
|
563
|
-
}
|
556
|
+
"""Find or create a security group in the specified VPC.
|
564
557
|
|
565
|
-
|
566
|
-
|
558
|
+
Args:
|
559
|
+
ec2: The initialized EC2 client object.
|
560
|
+
vpc_id: The ID of the VPC where the security group should be queried
|
561
|
+
or created.
|
562
|
+
expected_sg_name: The expected name of the security group.
|
563
|
+
|
564
|
+
Returns:
|
565
|
+
The security group object containing the details of the security group.
|
566
|
+
|
567
|
+
Raises:
|
568
|
+
exceptions.NoClusterLaunchedError: If the security group creation fails
|
569
|
+
and is not due to an existing duplicate.
|
570
|
+
botocore.exceptions.ClientError: If the security group creation fails
|
571
|
+
due to AWS service issues.
|
572
|
+
"""
|
573
|
+
# Figure out which security groups with this name exist for each VPC...
|
574
|
+
security_group = _get_security_group_from_vpc_id(ec2, vpc_id,
|
575
|
+
expected_sg_name)
|
576
|
+
if security_group is not None:
|
577
|
+
return security_group
|
567
578
|
|
568
579
|
try:
|
569
580
|
# create a new security group
|
@@ -573,34 +584,45 @@ def _get_or_create_vpc_security_group(ec2, vpc_id: str,
|
|
573
584
|
VpcId=vpc_id,
|
574
585
|
)
|
575
586
|
except ec2.meta.client.exceptions.ClientError as e:
|
587
|
+
if e.response['Error']['Code'] == 'InvalidGroup.Duplicate':
|
588
|
+
# The security group already exists, but we didn't see it
|
589
|
+
# because of eventual consistency.
|
590
|
+
logger.warning(f'{expected_sg_name} already exists when creating.')
|
591
|
+
security_group = _get_security_group_from_vpc_id(
|
592
|
+
ec2, vpc_id, expected_sg_name)
|
593
|
+
assert (security_group is not None and
|
594
|
+
security_group.group_name == expected_sg_name), (
|
595
|
+
f'Expected {expected_sg_name} but got {security_group}')
|
596
|
+
logger.info(
|
597
|
+
f'Found existing security group {colorama.Style.BRIGHT}'
|
598
|
+
f'{security_group.group_name}{colorama.Style.RESET_ALL} '
|
599
|
+
f'[id={security_group.id}]')
|
600
|
+
return security_group
|
576
601
|
message = ('Failed to create security group. Error: '
|
577
602
|
f'{common_utils.format_exception(e)}')
|
578
603
|
logger.warning(message)
|
579
604
|
raise exceptions.NoClusterLaunchedError(message) from e
|
580
605
|
|
581
|
-
security_group =
|
582
|
-
|
583
|
-
|
584
|
-
assert security_group, 'Failed to create security group'
|
585
|
-
security_group = security_group[0]
|
586
|
-
|
606
|
+
security_group = _get_security_group_from_vpc_id(ec2, vpc_id,
|
607
|
+
expected_sg_name)
|
608
|
+
assert security_group is not None, 'Failed to create security group'
|
587
609
|
logger.info(f'Created new security group {colorama.Style.BRIGHT}'
|
588
610
|
f'{security_group.group_name}{colorama.Style.RESET_ALL} '
|
589
611
|
f'[id={security_group.id}]')
|
590
612
|
return security_group
|
591
613
|
|
592
614
|
|
593
|
-
def
|
594
|
-
|
595
|
-
|
596
|
-
unique_group_names = set(group_names)
|
597
|
-
|
615
|
+
def _get_security_group_from_vpc_id(ec2, vpc_id: str,
|
616
|
+
group_name: str) -> Optional[Any]:
|
617
|
+
"""Get security group by VPC ID and group name."""
|
598
618
|
existing_groups = list(
|
599
619
|
ec2.security_groups.filter(Filters=[{
|
600
620
|
'Name': 'vpc-id',
|
601
|
-
'Values':
|
621
|
+
'Values': [vpc_id]
|
602
622
|
}]))
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
623
|
+
|
624
|
+
for sg in existing_groups:
|
625
|
+
if sg.group_name == group_name:
|
626
|
+
return sg
|
627
|
+
|
628
|
+
return None
|