Skip to content

Commit 76fd6ba

Browse files
authored
[CLI] Add CreateFleet instance info retrieval timeout configurable via DevSettings (#7425)
* Add DevSettings/Timeouts ComputeInstanceInfoTimeout to cluster config schema Expose the CreateFleet post-launch DescribeInstances retry timeout (consumed by the node package to tolerate EC2 API eventual consistency) as a dev setting under DevSettings/Timeouts/ComputeInstanceInfoTimeout, defaulting to 90s.
1 parent 25cdadf commit 76fd6ba

5 files changed

Lines changed: 19 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ CHANGELOG
2424
which used to cause cluster update failure on clusters with login nodes.
2525
- Fail `pcluster build-image` early when the downloaded cookbook version does not match the ParallelCluster CLI version.
2626
- Fix login nodes not mounting `/opt/parallelcluster/shared` when EFS is used as the internal shared storage type.
27+
- Fix an issue where compute nodes are incorrectly replaced when launching a large number of nodes due to eventual consistency.
2728

2829
**DEPRECATIONS**
2930
- Amazon Linux 2 is no longer supported.

cli/src/pcluster/config/cluster_config.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
)
3737
from pcluster.constants import (
3838
CIDR_ALL_IPS,
39+
COMPUTE_INSTANCE_INFO_TIMEOUT,
3940
CW_ALARMS_ENABLED_DEFAULT,
4041
CW_DASHBOARD_ENABLED_DEFAULT,
4142
CW_LOGS_ENABLED_DEFAULT,
@@ -1189,14 +1190,22 @@ def __init__(self, tags: List[Tag] = None, owner: str = None, name_prefix: str =
11891190
class Timeouts(Resource):
11901191
"""Represent the configuration for node boostrap timeout."""
11911192

1192-
def __init__(self, head_node_bootstrap_timeout: int = None, compute_node_bootstrap_timeout: int = None):
1193+
def __init__(
1194+
self,
1195+
head_node_bootstrap_timeout: int = None,
1196+
compute_node_bootstrap_timeout: int = None,
1197+
compute_instance_info_timeout: int = None,
1198+
):
11931199
super().__init__()
11941200
self.head_node_bootstrap_timeout = Resource.init_param(
11951201
head_node_bootstrap_timeout, default=NODE_BOOTSTRAP_TIMEOUT
11961202
)
11971203
self.compute_node_bootstrap_timeout = Resource.init_param(
11981204
compute_node_bootstrap_timeout, default=NODE_BOOTSTRAP_TIMEOUT
11991205
)
1206+
self.compute_instance_info_timeout = Resource.init_param(
1207+
compute_instance_info_timeout, default=COMPUTE_INSTANCE_INFO_TIMEOUT
1208+
)
12001209

12011210

12021211
class CapacityReservationTarget(Resource):

cli/src/pcluster/constants.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@
236236

237237
NODE_BOOTSTRAP_TIMEOUT = 2100
238238

239+
# Default time budget (seconds) for retrieving EC2 instance info after a CreateFleet launch,
240+
# to tolerate EC2 API eventual consistency.
241+
COMPUTE_INSTANCE_INFO_TIMEOUT = 90
242+
239243
# DirectoryService
240244
DIRECTORY_SERVICE_RESERVED_SETTINGS = {"id_provider": "ldap"}
241245

cli/src/pcluster/schemas/cluster_schema.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,9 @@ class TimeoutsSchema(BaseSchema):
11031103
compute_node_bootstrap_timeout = fields.Int(
11041104
validate=validate.Range(min=1), metadata={"update_policy": UpdatePolicy.SUPPORTED}
11051105
)
1106+
compute_instance_info_timeout = fields.Int(
1107+
validate=validate.Range(min=1), metadata={"update_policy": UpdatePolicy.SUPPORTED}
1108+
)
11061109

11071110
@post_load()
11081111
def make_resource(self, data, **kwargs):

cli/tests/pcluster/example_configs/slurm.full.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ DevSettings:
329329
Timeouts:
330330
HeadNodeBootstrapTimeout: 1201 # Default 1800 (seconds)
331331
ComputeNodeBootstrapTimeout: 1001 # Default 1800 (seconds)
332+
ComputeInstanceInfoTimeout: 95 # Default 90 (seconds)
332333
ComputeStartupTimeMetricEnabled: false
333334
DeploymentSettings:
334335
DisableSudoAccessForDefaultUser: True

0 commit comments

Comments
 (0)