Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions sample/sagemaker/2017-07-24/service-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -8313,6 +8313,67 @@
"min":0,
"pattern":"arn:aws[a-z\\-]*:sagemaker:[a-z0-9\\-]*:[0-9]{12}:cluster/[a-z0-9]{12}"
},
"ClusterAutoScalerType":{
"type":"string",
"enum":["Karpenter"]
},
"ClusterAutoScalingConfig":{
"type":"structure",
"required":["Mode"],
"members":{
"Mode":{
"shape":"ClusterAutoScalingMode",
"documentation":"<p>Describes whether autoscaling is enabled or disabled for the cluster. Valid values are <code>Enable</code> and <code>Disable</code>.</p>"
},
"AutoScalerType":{
"shape":"ClusterAutoScalerType",
"documentation":"<p>The type of autoscaler to use. Currently supported value is <code>Karpenter</code>.</p>"
}
},
"documentation":"<p>Specifies the autoscaling configuration for a HyperPod cluster.</p>"
},
"ClusterAutoScalingConfigOutput":{
"type":"structure",
"required":[
"Mode",
"Status"
],
"members":{
"Mode":{
"shape":"ClusterAutoScalingMode",
"documentation":"<p>Describes whether autoscaling is enabled or disabled for the cluster.</p>"
},
"AutoScalerType":{
"shape":"ClusterAutoScalerType",
"documentation":"<p>The type of autoscaler configured for the cluster.</p>"
},
"Status":{
"shape":"ClusterAutoScalingStatus",
"documentation":"<p>The current status of the autoscaling configuration. Valid values are <code>InService</code>, <code>Failed</code>, <code>Creating</code>, and <code>Deleting</code>.</p>"
},
"FailureMessage":{
"shape":"String",
"documentation":"<p>If the autoscaling status is <code>Failed</code>, this field contains a message describing the failure.</p>"
}
},
"documentation":"<p>The autoscaling configuration and status information for a HyperPod cluster.</p>"
},
"ClusterAutoScalingMode":{
"type":"string",
"enum":[
"Enable",
"Disable"
]
},
"ClusterAutoScalingStatus":{
"type":"string",
"enum":[
"InService",
"Failed",
"Creating",
"Deleting"
]
},
"ClusterAvailabilityZone":{
"type":"string",
"pattern":"[a-z]{2}-[a-z]+-\\d[a-z]"
Expand Down Expand Up @@ -10483,6 +10544,14 @@
"NodeProvisioningMode":{
"shape":"ClusterNodeProvisioningMode",
"documentation":"<p>The mode for provisioning nodes in the cluster. You can specify the following modes:</p> <ul> <li> <p> <b>Continuous</b>: Scaling behavior that enables 1) concurrent operation execution within instance groups, 2) continuous retry mechanisms for failed operations, 3) enhanced customer visibility into cluster events through detailed event streams, 4) partial provisioning capabilities. Your clusters and instance groups remain <code>InService</code> while scaling. This mode is only supported for EKS orchestrated clusters.</p> </li> </ul>"
},
"ClusterRole":{
"shape":"RoleArn",
"documentation":"<p>The Amazon Resource Name (ARN) of the IAM role that HyperPod assumes to perform cluster autoscaling operations. This role must have permissions for <code>sagemaker:BatchAddClusterNodes</code> and <code>sagemaker:BatchDeleteClusterNodes</code>. This is only required when autoscaling is enabled and when HyperPod is performing autoscaling operations.</p>"
},
"AutoScaling":{
"shape":"ClusterAutoScalingConfig",
"documentation":"<p>The autoscaling configuration for the cluster. Enables automatic scaling of cluster nodes based on workload demand using a Karpenter-based system.</p>"
}
}
},
Expand Down Expand Up @@ -15551,6 +15620,14 @@
"NodeProvisioningMode":{
"shape":"ClusterNodeProvisioningMode",
"documentation":"<p>The mode used for provisioning nodes in the cluster.</p>"
},
"ClusterRole":{
"shape":"RoleArn",
"documentation":"<p>The Amazon Resource Name (ARN) of the IAM role that HyperPod uses for cluster autoscaling operations.</p>"
},
"AutoScaling":{
"shape":"ClusterAutoScalingConfigOutput",
"documentation":"<p>The current autoscaling configuration and status for the autoscaler.</p>"
}
}
},
Expand Down Expand Up @@ -43560,6 +43637,14 @@
"InstanceGroupsToDelete":{
"shape":"ClusterInstanceGroupsToDelete",
"documentation":"<p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>"
},
"ClusterRole":{
"shape":"RoleArn",
"documentation":"<p>The Amazon Resource Name (ARN) of the IAM role that HyperPod assumes for cluster autoscaling operations. Cannot be updated while autoscaling is enabled.</p>"
},
"AutoScaling":{
"shape":"ClusterAutoScalingConfig",
"documentation":"<p>Updates the autoscaling configuration for the cluster. Use to enable or disable automatic node scaling.</p>"
}
}
},
Expand Down
22 changes: 22 additions & 0 deletions src/sagemaker_core/main/code_injection/shape_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,22 @@
],
"type": "structure",
},
"ClusterAutoScalingConfig": {
"members": [
{"name": "Mode", "shape": "ClusterAutoScalingMode", "type": "string"},
{"name": "AutoScalerType", "shape": "ClusterAutoScalerType", "type": "string"},
],
"type": "structure",
},
"ClusterAutoScalingConfigOutput": {
"members": [
{"name": "Mode", "shape": "ClusterAutoScalingMode", "type": "string"},
{"name": "AutoScalerType", "shape": "ClusterAutoScalerType", "type": "string"},
{"name": "Status", "shape": "ClusterAutoScalingStatus", "type": "string"},
{"name": "FailureMessage", "shape": "String", "type": "string"},
],
"type": "structure",
},
"ClusterEbsVolumeConfig": {
"members": [
{"name": "VolumeSizeInGB", "shape": "ClusterEbsVolumeSizeInGB", "type": "integer"},
Expand Down Expand Up @@ -2251,6 +2267,8 @@
"shape": "ClusterNodeProvisioningMode",
"type": "string",
},
{"name": "ClusterRole", "shape": "RoleArn", "type": "string"},
{"name": "AutoScaling", "shape": "ClusterAutoScalingConfig", "type": "structure"},
],
"type": "structure",
},
Expand Down Expand Up @@ -4647,6 +4665,8 @@
"shape": "ClusterNodeProvisioningMode",
"type": "string",
},
{"name": "ClusterRole", "shape": "RoleArn", "type": "string"},
{"name": "AutoScaling", "shape": "ClusterAutoScalingConfigOutput", "type": "structure"},
],
"type": "structure",
},
Expand Down Expand Up @@ -15827,6 +15847,8 @@
"shape": "ClusterInstanceGroupsToDelete",
"type": "list",
},
{"name": "ClusterRole", "shape": "RoleArn", "type": "string"},
{"name": "AutoScaling", "shape": "ClusterAutoScalingConfig", "type": "structure"},
],
"type": "structure",
},
Expand Down
3 changes: 2 additions & 1 deletion src/sagemaker_core/main/config_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@
"type": "array",
"items": {"type": "string"},
},
}
},
"cluster_role": {"type": "string"},
},
},
"CompilationJob": {
Expand Down
14 changes: 14 additions & 0 deletions src/sagemaker_core/main/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -3226,6 +3226,8 @@ class Cluster(Base):
orchestrator: The type of orchestrator used for the SageMaker HyperPod cluster.
node_recovery: The node recovery mode configured for the SageMaker HyperPod cluster.
node_provisioning_mode: The mode used for provisioning nodes in the cluster.
cluster_role: The Amazon Resource Name (ARN) of the IAM role that HyperPod uses for cluster autoscaling operations.
auto_scaling: The current autoscaling configuration and status for the autoscaler.

"""

Expand All @@ -3242,6 +3244,8 @@ class Cluster(Base):
orchestrator: Optional[shapes.ClusterOrchestrator] = Unassigned()
node_recovery: Optional[str] = Unassigned()
node_provisioning_mode: Optional[str] = Unassigned()
cluster_role: Optional[str] = Unassigned()
auto_scaling: Optional[shapes.ClusterAutoScalingConfigOutput] = Unassigned()

def get_name(self) -> str:
attributes = vars(self)
Expand Down Expand Up @@ -3292,6 +3296,8 @@ def create(
orchestrator: Optional[shapes.ClusterOrchestrator] = Unassigned(),
node_recovery: Optional[str] = Unassigned(),
node_provisioning_mode: Optional[str] = Unassigned(),
cluster_role: Optional[str] = Unassigned(),
auto_scaling: Optional[shapes.ClusterAutoScalingConfig] = Unassigned(),
session: Optional[Session] = None,
region: Optional[str] = None,
) -> Optional["Cluster"]:
Expand All @@ -3307,6 +3313,8 @@ def create(
orchestrator: The type of orchestrator to use for the SageMaker HyperPod cluster. Currently, the only supported value is "eks", which is to use an Amazon Elastic Kubernetes Service cluster as the orchestrator.
node_recovery: The node recovery mode for the SageMaker HyperPod cluster. When set to Automatic, SageMaker HyperPod will automatically reboot or replace faulty nodes when issues are detected. When set to None, cluster administrators will need to manually manage any faulty cluster instances.
node_provisioning_mode: The mode for provisioning nodes in the cluster. You can specify the following modes: Continuous: Scaling behavior that enables 1) concurrent operation execution within instance groups, 2) continuous retry mechanisms for failed operations, 3) enhanced customer visibility into cluster events through detailed event streams, 4) partial provisioning capabilities. Your clusters and instance groups remain InService while scaling. This mode is only supported for EKS orchestrated clusters.
cluster_role: The Amazon Resource Name (ARN) of the IAM role that HyperPod assumes to perform cluster autoscaling operations. This role must have permissions for sagemaker:BatchAddClusterNodes and sagemaker:BatchDeleteClusterNodes. This is only required when autoscaling is enabled and when HyperPod is performing autoscaling operations.
auto_scaling: The autoscaling configuration for the cluster. Enables automatic scaling of cluster nodes based on workload demand using a Karpenter-based system.
session: Boto3 session.
region: Region name.

Expand Down Expand Up @@ -3344,6 +3352,8 @@ def create(
"Orchestrator": orchestrator,
"NodeRecovery": node_recovery,
"NodeProvisioningMode": node_provisioning_mode,
"ClusterRole": cluster_role,
"AutoScaling": auto_scaling,
}

operation_input_args = Base.populate_chained_attributes(
Expand Down Expand Up @@ -3459,6 +3469,8 @@ def update(
] = Unassigned(),
node_recovery: Optional[str] = Unassigned(),
instance_groups_to_delete: Optional[List[str]] = Unassigned(),
cluster_role: Optional[str] = Unassigned(),
auto_scaling: Optional[shapes.ClusterAutoScalingConfig] = Unassigned(),
) -> Optional["Cluster"]:
"""
Update a Cluster resource
Expand Down Expand Up @@ -3493,6 +3505,8 @@ def update(
"RestrictedInstanceGroups": restricted_instance_groups,
"NodeRecovery": node_recovery,
"InstanceGroupsToDelete": instance_groups_to_delete,
"ClusterRole": cluster_role,
"AutoScaling": auto_scaling,
}
logger.debug(f"Input request: {operation_input_args}")
# serialize the input request
Expand Down
34 changes: 34 additions & 0 deletions src/sagemaker_core/main/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3406,6 +3406,40 @@ class ClarifyExplainerConfig(Base):
inference_config: Optional[ClarifyInferenceConfig] = Unassigned()


class ClusterAutoScalingConfig(Base):
"""
ClusterAutoScalingConfig
Specifies the autoscaling configuration for a HyperPod cluster.

Attributes
----------------------
mode: Describes whether autoscaling is enabled or disabled for the cluster. Valid values are Enable and Disable.
auto_scaler_type: The type of autoscaler to use. Currently supported value is Karpenter.
"""

mode: str
auto_scaler_type: Optional[str] = Unassigned()


class ClusterAutoScalingConfigOutput(Base):
"""
ClusterAutoScalingConfigOutput
The autoscaling configuration and status information for a HyperPod cluster.

Attributes
----------------------
mode: Describes whether autoscaling is enabled or disabled for the cluster.
auto_scaler_type: The type of autoscaler configured for the cluster.
status: The current status of the autoscaling configuration. Valid values are InService, Failed, Creating, and Deleting.
failure_message: If the autoscaling status is Failed, this field contains a message describing the failure.
"""

mode: str
status: str
auto_scaler_type: Optional[str] = Unassigned()
failure_message: Optional[str] = Unassigned()


class ClusterEbsVolumeConfig(Base):
"""
ClusterEbsVolumeConfig
Expand Down
Loading