Skip to content

Commit fedc582

Browse files
authored
🐛Autoscaling in computational clusters could not start without SSM parameters (ITISFoundation#6229)
1 parent 40d1ecb commit fedc582

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

services/autoscaling/src/simcore_service_autoscaling/modules/auto_scaling_core.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,13 @@ async def _make_pending_buffer_ec2s_join_cluster(
200200
app: FastAPI,
201201
cluster: Cluster,
202202
) -> Cluster:
203-
# started buffer instance shall be asked to join the cluster once they are running
204-
ssm_client = get_ssm_client(app)
205-
206203
if buffer_ec2s_pending := [
207204
i.ec2_instance
208205
for i in cluster.pending_ec2s
209206
if is_buffer_machine(i.ec2_instance.tags)
210207
]:
208+
# started buffer instance shall be asked to join the cluster once they are running
209+
ssm_client = get_ssm_client(app)
211210
buffer_ec2_connection_state = await limited_gather(
212211
*[
213212
ssm_client.is_instance_connected_to_ssm_server(i.id)

services/autoscaling/tests/unit/test_modules_auto_scaling_computational.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,32 @@ async def test_cluster_scaling_with_no_tasks_does_nothing(
202202
)
203203

204204

205+
@pytest.mark.acceptance_test(
206+
"Ensure this does not happen https://github.com/ITISFoundation/osparc-simcore/issues/6227"
207+
)
208+
async def test_cluster_scaling_with_disabled_ssm_does_not_block_autoscaling(
209+
minimal_configuration: None,
210+
disabled_ssm: None,
211+
app_settings: ApplicationSettings,
212+
initialized_app: FastAPI,
213+
mock_launch_instances: mock.Mock,
214+
mock_terminate_instances: mock.Mock,
215+
mock_rabbitmq_post_message: mock.Mock,
216+
dask_spec_local_cluster: distributed.SpecCluster,
217+
):
218+
await auto_scale_cluster(
219+
app=initialized_app, auto_scaling_mode=ComputationalAutoscaling()
220+
)
221+
mock_launch_instances.assert_not_called()
222+
mock_terminate_instances.assert_not_called()
223+
_assert_rabbit_autoscaling_message_sent(
224+
mock_rabbitmq_post_message,
225+
app_settings,
226+
initialized_app,
227+
dask_spec_local_cluster.scheduler_address,
228+
)
229+
230+
205231
async def test_cluster_scaling_with_task_with_too_much_resources_starts_nothing(
206232
minimal_configuration: None,
207233
app_settings: ApplicationSettings,

0 commit comments

Comments
 (0)