Skip to content

Commit 52a6abe

Browse files
authored
🎨Autoscaling: warm buffers: create at minimum 1 machine at a time instead of asking directly for the required number (#8262)
1 parent 35e7048 commit 52a6abe

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

services/autoscaling/src/simcore_service_autoscaling/modules/cluster_scaling/_warm_buffer_machines_pool_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ async def _add_remove_buffer_instances(
314314
subnet_id=app_settings.AUTOSCALING_EC2_INSTANCES.EC2_INSTANCES_SUBNET_ID,
315315
iam_instance_profile=app_settings.AUTOSCALING_EC2_INSTANCES.EC2_INSTANCES_ATTACHED_IAM_PROFILE,
316316
),
317-
min_number_of_instances=num_to_start,
317+
min_number_of_instances=1, # NOTE: we want at least 1
318318
number_of_instances=num_to_start,
319319
max_total_number_of_instances=app_settings.AUTOSCALING_EC2_INSTANCES.EC2_INSTANCES_MAX_INSTANCES,
320320
)

services/autoscaling/tests/unit/test_modules_cluster_scaling_warm_buffer_machine_core.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ async def _assert_wait_for_ssm_command_to_finish() -> None:
268268

269269

270270
async def test_monitor_buffer_machines(
271+
patch_ec2_client_launch_instances_min_number_of_instances: None,
271272
minimal_configuration: None,
272273
ec2_client: EC2Client,
273274
buffer_count: int,
@@ -374,6 +375,7 @@ async def test_monitor_buffer_machines_terminates_supernumerary_instances(
374375

375376

376377
async def test_monitor_buffer_machines_terminates_instances_with_incorrect_pre_pulled_images(
378+
patch_ec2_client_launch_instances_min_number_of_instances: None,
377379
minimal_configuration: None,
378380
ec2_client: EC2Client,
379381
buffer_count: int,
@@ -457,6 +459,7 @@ def unneeded_instance_type(
457459
],
458460
)
459461
async def test_monitor_buffer_machines_terminates_unneeded_pool(
462+
patch_ec2_client_launch_instances_min_number_of_instances: None,
460463
minimal_configuration: None,
461464
ec2_client: EC2Client,
462465
buffer_count: int,

0 commit comments

Comments
 (0)