@@ -204,8 +204,7 @@ def minimal_configuration(
204
204
disable_dynamic_service_background_task : None ,
205
205
disable_buffers_pool_background_task : None ,
206
206
mocked_redis_server : None ,
207
- ) -> None :
208
- ...
207
+ ) -> None : ...
209
208
210
209
211
210
def _assert_rabbit_autoscaling_message_sent (
@@ -626,11 +625,11 @@ async def _assert_wait_for_ec2_instances_running() -> list[InstanceTypeDef]:
626
625
)
627
626
# update our fake node
628
627
fake_attached_node .spec .labels [_OSPARC_SERVICE_READY_LABEL_KEY ] = "true"
629
- fake_attached_node .spec .labels [
630
- _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
631
- ] = mock_docker_tag_node . call_args_list [ 2 ][ 1 ][ "tags" ][
632
- _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
633
- ]
628
+ fake_attached_node .spec .labels [_OSPARC_SERVICES_READY_DATETIME_LABEL_KEY ] = (
629
+ mock_docker_tag_node . call_args_list [ 2 ][ 1 ][ "tags" ][
630
+ _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
631
+ ]
632
+ )
634
633
# check the activate time is later than attach time
635
634
assert arrow .get (
636
635
mock_docker_tag_node .call_args_list [1 ][1 ]["tags" ][
@@ -661,11 +660,11 @@ async def _assert_wait_for_ec2_instances_running() -> list[InstanceTypeDef]:
661
660
available = True ,
662
661
)
663
662
# update our fake node
664
- fake_attached_node .spec .labels [
665
- _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
666
- ] = mock_docker_tag_node . call_args_list [ 1 ][ 1 ][ "tags" ][
667
- _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
668
- ]
663
+ fake_attached_node .spec .labels [_OSPARC_SERVICES_READY_DATETIME_LABEL_KEY ] = (
664
+ mock_docker_tag_node . call_args_list [ 1 ][ 1 ][ "tags" ][
665
+ _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
666
+ ]
667
+ )
669
668
mock_docker_tag_node .reset_mock ()
670
669
mock_docker_set_node_availability .assert_not_called ()
671
670
@@ -852,9 +851,9 @@ async def _assert_wait_for_ec2_instances_running() -> list[InstanceTypeDef]:
852
851
if not with_drain_nodes_labelled :
853
852
fake_attached_node .spec .availability = Availability .drain
854
853
fake_attached_node .spec .labels [_OSPARC_SERVICE_READY_LABEL_KEY ] = "false"
855
- fake_attached_node .spec .labels [
856
- _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
857
- ] = datetime . datetime . now ( tz = datetime . UTC ). isoformat ( )
854
+ fake_attached_node .spec .labels [_OSPARC_SERVICES_READY_DATETIME_LABEL_KEY ] = (
855
+ datetime . datetime . now ( tz = datetime . UTC ). isoformat ()
856
+ )
858
857
859
858
# the node will not be terminated before the timeout triggers
860
859
assert app_settings .AUTOSCALING_EC2_INSTANCES
@@ -1150,7 +1149,7 @@ async def test_cluster_scaling_up_and_down_against_aws(
1150
1149
cpus = 5 , ram = TypeAdapter (ByteSize ).validate_python ("36Gib" )
1151
1150
),
1152
1151
num_services = 10 ,
1153
- expected_instance_type = "g3 .4xlarge" , # 1 GPU, 16 CPUs, 122GiB
1152
+ expected_instance_type = "r5n .4xlarge" , # 1 GPU, 16 CPUs, 128GiB
1154
1153
expected_num_instances = 4 ,
1155
1154
),
1156
1155
id = "sim4life-light" ,
@@ -1238,12 +1237,12 @@ async def test_cluster_scaling_up_starts_multiple_instances(
1238
1237
[
1239
1238
pytest .param (
1240
1239
_ScaleUpParams (
1241
- imposed_instance_type = "g3.4xlarge " , # 1 GPU, 16 CPUs, 122GiB
1240
+ imposed_instance_type = "g4dn.2xlarge " , # 1 GPU, 8 CPUs, 32GiB
1242
1241
service_resources = Resources (
1243
- cpus = 16 , ram = TypeAdapter (ByteSize ).validate_python ("30Gib " )
1242
+ cpus = 8 , ram = TypeAdapter (ByteSize ).validate_python ("15Gib " )
1244
1243
),
1245
1244
num_services = 12 ,
1246
- expected_instance_type = "g3.4xlarge " , # 1 GPU, 16 CPUs, 122GiB
1245
+ expected_instance_type = "g4dn.2xlarge " , # 1 GPU, 8 CPUs, 32GiB
1247
1246
expected_num_instances = 10 ,
1248
1247
),
1249
1248
_ScaleUpParams (
@@ -2300,9 +2299,9 @@ async def test_warm_buffers_only_replace_hot_buffer_if_service_is_started_issue7
2300
2299
# simulate one of the hot buffer is not drained anymore and took the pending service
2301
2300
random_fake_node = random .choice (fake_hot_buffer_nodes ) # noqa: S311
2302
2301
random_fake_node .spec .labels [_OSPARC_SERVICE_READY_LABEL_KEY ] = "true"
2303
- random_fake_node .spec .labels [
2304
- _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
2305
- ] = arrow . utcnow (). isoformat ( )
2302
+ random_fake_node .spec .labels [_OSPARC_SERVICES_READY_DATETIME_LABEL_KEY ] = (
2303
+ arrow . utcnow (). isoformat ()
2304
+ )
2306
2305
random_fake_node .spec .availability = Availability .active
2307
2306
# simulate the fact that the warm buffer that just started is not yet visible
2308
2307
mock_find_node_with_name_returns_fake_node .return_value = None
0 commit comments