update_compute_node_group
¶
update_compute_node_group(
cluster_identifier: ClusterIdentifier,
compute_node_group_identifier: ComputeNodeGroupIdentifier,
*,
config_overrides: Optional[PCSClientConfig] = None,
ami_id: Optional[AmiIdOrEmpty] = None,
security_group_ids: Optional[SecurityGroupIdListOrEmpty] = None,
ssh_key_name: Optional[KeyPairNameOrEmpty] = None,
subnet_ids: Optional[StringList] = None,
launch_template_mode: Optional[LaunchTemplateMode] = None,
custom_launch_template: Optional[CustomLaunchTemplate] = None,
purchase_option: Optional[PurchaseOption] = None,
spot_options: Optional[SpotOptions] = None,
scaling_configuration: Optional[ScalingConfigurationRequest] = None,
iam_instance_profile_arn: Optional[InstanceProfileArn] = None,
slurm_configuration: Optional[
UpdateComputeNodeGroupSlurmConfigurationRequest
] = None,
node_lifecycle_actions: Optional[UpdateNodeLifecycleActionsRequest] = None,
instance_health_checks: Optional[UpdateInstanceHealthChecksRequest] = None,
client_token: Optional[SBClientToken] = None,
) -> UpdateComputeNodeGroupResponse
Updates a compute node group. You can update many of the fields related to your compute node group including the configurations for networking, compute nodes, and settings specific to your scheduler (such as Slurm).
Parameters:
-
ami_id(Optional[AmiIdOrEmpty], default:None) –The ID of the Amazon Machine Image (AMI) that PCS uses to launch instances. This value overrides the AMI ID in the custom launch template. Specify an empty string (
"") to remove the AMI ID from the compute node group and use the AMI ID specified in the custom launch template. Omit this value to leave the current setting unchanged. -
security_group_ids(Optional[SecurityGroupIdListOrEmpty], default:None) –The IDs of the EC2 security groups to configure directly on the compute node group. The security groups must be in the same VPC as the cluster. PCS uses these security groups instead of the security groups in the custom launch template. You can't specify this value if the custom launch template defines network interfaces. Specify an empty list (
[]) to remove the security groups from the compute node group and use the security groups in the custom launch template. Omit this value to leave the current setting unchanged. -
ssh_key_name(Optional[KeyPairNameOrEmpty], default:None) –The name of the EC2 key pair to configure directly on the compute node group. The key pair must exist in your account and Amazon Web Services Region. PCS uses this key pair instead of the key pair in the custom launch template. Specify an empty string (
"") to remove the key pair from the compute node group and use the key pair in the custom launch template. Omit this value to leave the current setting unchanged. You must have permission forec2:DescribeKeyPairsto specify a key pair. If you delete the key pair later, future instance launches can fail. -
cluster_identifier(ClusterIdentifier) –The name or ID of the cluster of the compute node group.
-
compute_node_group_identifier(ComputeNodeGroupIdentifier) –The name or ID of the compute node group.
-
subnet_ids(Optional[StringList], default:None) –The list of subnet IDs where the compute node group provisions instances. The subnets must be in the same VPC as the cluster.
-
launch_template_mode(Optional[LaunchTemplateMode], default:None) –Specifies whether the compute node group uses a custom launch template or a launch template that PCS manages. Omit this value to keep the current mode.
Valid values:
-
CUSTOM– Use a custom launch template. To switch fromMANAGED, also providecustomLaunchTemplate. If the compute node group already usesCUSTOMand you omitcustomLaunchTemplate, the existing launch template is unchanged. -
MANAGED– Use a launch template created and managed by PCS. OmitcustomLaunchTemplate. Switching to this mode removes the custom launch template association but doesn't delete the launch template.
When switching to
MANAGED, the compute node group must haveamiIdandsecurityGroupIdsconfigured. You can set these values in the same request. -
-
custom_launch_template(Optional[CustomLaunchTemplate], default:None) –The custom Amazon EC2 launch template to associate with the compute node group. To set or change the custom launch template, specify
idandversion. If you provide this value and omitlaunchTemplateMode, the compute node group must already useCUSTOMmode. To switch fromMANAGEDtoCUSTOM, specifylaunchTemplateModeasCUSTOMand provide this value. If the compute node group already usesCUSTOM, omit this value while also omittinglaunchTemplateMode, or while specifyingCUSTOM, to keep the existing custom launch template. For more information, see Migrating a compute node group from a custom launch template in the PCS User Guide. -
purchase_option(Optional[PurchaseOption], default:None) –Specifies how EC2 instances are purchased on your behalf. PCS supports On-Demand Instances, Spot Instances, Interruptible Capacity Reservations, On-Demand Capacity Reservations, and Amazon EC2 Capacity Blocks for ML. For more information, see Amazon EC2 billing and purchasing options in the Amazon Elastic Compute Cloud User Guide. For more information about PCS support for Capacity Blocks, see Using Amazon EC2 Capacity Blocks for ML with PCS in the PCS User Guide. For more information about PCS support for interruptible capacity reservations, see Using I-ODCRs with PCS in the PCS User Guide. Choose On-Demand if you plan to use an On-Demand Capacity Reservation (ODCR). For more information, see Using ODCRs with PCS. If you don't provide this option, it defaults to On-Demand.
-
scaling_configuration(Optional[ScalingConfigurationRequest], default:None) –Specifies the boundaries of the compute node group auto scaling.
-
iam_instance_profile_arn(Optional[InstanceProfileArn], default:None) –The Amazon Resource Name (ARN) of the IAM instance profile used to pass an IAM role when launching EC2 instances. The role contained in your instance profile must have the
pcs:RegisterComputeNodeGroupInstancepermission and the role name must start withAWSPCSor must have the path/aws-pcs/. For more information, see IAM instance profiles for PCS in the PCS User Guide. -
slurm_configuration(Optional[UpdateComputeNodeGroupSlurmConfigurationRequest], default:None) –Additional options related to the Slurm scheduler.
-
node_lifecycle_actions(Optional[UpdateNodeLifecycleActionsRequest], default:None) –The lifecycle actions to run on compute nodes in the compute node group. Use lifecycle actions to run custom scripts at defined stages of a compute node's lifecycle, such as when a compute node finishes bootstrapping or becomes ready to accept jobs.
-
instance_health_checks(Optional[UpdateInstanceHealthChecksRequest], default:None) –The instance health check settings for the compute node group. Instance health checks detect faults on instances in the compute node group and respond with the repair action that you choose. You can configure health monitoring, deep health checks, or both. You can't specify an empty object (
{}). Instance health checks require Slurm version 26.05 or later.The settings that you specify replace all of the current instance health check settings of the compute node group. Include every setting that you want to keep. If you omit this member, the current settings don't change. If you omit
healthMonitoringordeepHealthChecks, that check is turned off. You can also turn off a check: sethealthMonitoring.modeordeepHealthChecks.onStart.profiletoNONEand omit itsrepairAction. When you change these settings, PCS drains and replaces the instances in the compute node group. -
client_token(Optional[SBClientToken], default:None) –A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect. If you don't specify a client token, the CLI and SDK automatically generate one for you.
Raises:
-
AccessDeniedException–You don't have permission to perform the action.
Examples
-
The launch template instance profile doesn't pass
iam:PassRoleverification. -
There is a mismatch between the account ID and cluster ID.
-
The cluster ID doesn't exist.
-
The EC2 instance isn't present.
-
-
ConflictException–Your request has conflicting operations. This can occur if you're trying to perform more than 1 operation on the same resource at the same time.
Examples
-
A cluster with the same name already exists.
-
A cluster isn't in
ACTIVEstatus. -
A cluster to delete is in an unstable state. For example, because it still has
ACTIVEnode groups or queues. -
A queue already exists in a cluster.
-
-
InternalServerException–PCS can't process your request right now. Try again later.
-
ResourceNotFoundException–The requested resource can't be found. The cluster, node group, or queue you're attempting to get, update, list, or delete doesn't exist.
Examples
-
ServiceQuotaExceededException–You exceeded your service quota. Service quotas, also referred to as limits, are the maximum number of service resources or operations for your Amazon Web Services account. To learn how to increase your service quota, see Requesting a quota increase in the Service Quotas User Guide
Examples
-
The max number of clusters or queues has been reached for the account.
-
The max number of compute node groups has been reached for the associated cluster.
-
The total of
maxInstancesacross all compute node groups has been reached for associated cluster.
-
-
ThrottlingException–Your request exceeded a request rate quota. Check the resource's request rate quota and try again.
-
ValidationException–The request isn't valid.
Examples
-
Your request contains malformed JSON or unsupported characters.
-
The scheduler version isn't supported.
-
There are networking related errors, such as network validation failure.
-
AMI type is
CUSTOMand the launch template doesn't define the AMI ID, or the AMI type is AL2 and the launch template defines the AMI.
-
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_pcs/_services/pcs.py
897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 | |