Skip to content

Commit 98ca8ce

Browse files
committed
migration
1 parent 8194598 commit 98ca8ce

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

services/autoscaling/src/simcore_service_autoscaling/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@
3636
BUFFER_MACHINE_TAG_KEY: TypeAdapter(AWSTagValue).validate_python("false")
3737
}
3838
PRE_PULLED_IMAGES_RE: Final[re.Pattern] = re.compile(
39-
rf"{PRE_PULLED_IMAGES_EC2_TAG_KEY}_\((\d+)\)"
39+
rf"{PRE_PULLED_IMAGES_EC2_TAG_KEY}_(\((\d+)\)|\d+)"
4040
)

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async def _scheduler_client(
5959
require_encryption=True,
6060
)
6161
async with distributed.Client(
62-
url,
62+
f"{url}",
6363
asynchronous=True,
6464
timeout=f"{_DASK_SCHEDULER_CONNECT_TIMEOUT_S}",
6565
security=security,
@@ -173,9 +173,9 @@ def _list_tasks(
173173
}
174174

175175
async with _scheduler_client(scheduler_url, authentication) as client:
176-
list_of_tasks: dict[dask.typing.Key, DaskTaskResources] = (
177-
await _wrap_client_async_routine(client.run_on_scheduler(_list_tasks))
178-
)
176+
list_of_tasks: dict[
177+
dask.typing.Key, DaskTaskResources
178+
] = await _wrap_client_async_routine(client.run_on_scheduler(_list_tasks))
179179
_logger.debug("found unrunnable tasks: %s", list_of_tasks)
180180
return [
181181
DaskTask(
@@ -207,10 +207,10 @@ def _list_processing_tasks(
207207
return worker_to_processing_tasks
208208

209209
async with _scheduler_client(scheduler_url, authentication) as client:
210-
worker_to_tasks: dict[str, list[tuple[dask.typing.Key, DaskTaskResources]]] = (
211-
await _wrap_client_async_routine(
212-
client.run_on_scheduler(_list_processing_tasks)
213-
)
210+
worker_to_tasks: dict[
211+
str, list[tuple[dask.typing.Key, DaskTaskResources]]
212+
] = await _wrap_client_async_routine(
213+
client.run_on_scheduler(_list_processing_tasks)
214214
)
215215
_logger.debug("found processing tasks: %s", worker_to_tasks)
216216
tasks_per_worker = defaultdict(list)
@@ -276,12 +276,12 @@ def _list_processing_tasks_on_worker(
276276
_logger.debug("looking for processing tasksfor %s", f"{worker_url=}")
277277

278278
# now get the used resources
279-
worker_processing_tasks: list[tuple[dask.typing.Key, DaskTaskResources]] = (
280-
await _wrap_client_async_routine(
281-
client.run_on_scheduler(
282-
_list_processing_tasks_on_worker, worker_url=worker_url
283-
),
284-
)
279+
worker_processing_tasks: list[
280+
tuple[dask.typing.Key, DaskTaskResources]
281+
] = await _wrap_client_async_routine(
282+
client.run_on_scheduler(
283+
_list_processing_tasks_on_worker, worker_url=worker_url
284+
),
285285
)
286286

287287
total_resources_used: collections.Counter[str] = collections.Counter()

services/autoscaling/src/simcore_service_autoscaling/utils/buffer_machines_pool_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def dump_pre_pulled_images_as_tags(images: Iterable[DockerGenericTag]) -> EC2Tag
5656
]
5757
return {
5858
TypeAdapter(AWSTagKey)
59-
.validate_python(f"{PRE_PULLED_IMAGES_EC2_TAG_KEY}_({i})"): TypeAdapter(
59+
.validate_python(f"{PRE_PULLED_IMAGES_EC2_TAG_KEY}_{i}"): TypeAdapter(
6060
AWSTagValue
6161
)
6262
.validate_python(c)

services/autoscaling/tests/unit/test_utils_buffer_machines_pool_core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ def test_is_buffer_machine(tags: EC2Tags, expected_is_buffer: bool):
144144
"registry.pytest.com/simcore/services/dynamic/sym-server-8-0-0-dy:3.2.34",
145145
],
146146
{
147-
f"{PRE_PULLED_IMAGES_EC2_TAG_KEY}_(0)": '["itisfoundation/dynamic-sidecar:latest","itisfoundation/agent:latest","registry.pytest.com/simcore/services/dynamic/ti-postpro:2.0.34","registry.pytest.com/simcore/services/dynamic/ti-simu:1.0.12","registry.pytest.com/simcore/services/dynamic/ti-pers:1.0.',
148-
f"{PRE_PULLED_IMAGES_EC2_TAG_KEY}_(1)": '19","registry.pytest.com/simcore/services/dynamic/sim4life-postpro:2.0.106","registry.pytest.com/simcore/services/dynamic/s4l-core-postpro:2.0.106","registry.pytest.com/simcore/services/dynamic/s4l-core-stream:2.0.106","registry.pytest.com/simcore/services',
149-
f"{PRE_PULLED_IMAGES_EC2_TAG_KEY}_(2)": '/dynamic/sym-server-8-0-0-dy:2.0.106","registry.pytest.com/simcore/services/dynamic/sim4life-8-0-0-modeling:3.2.34","registry.pytest.com/simcore/services/dynamic/s4l-core-8-0-0-modeling:3.2.34","registry.pytest.com/simcore/services/dynamic/s4l-stream-8-0-0',
150-
f"{PRE_PULLED_IMAGES_EC2_TAG_KEY}_(3)": '-dy:3.2.34","registry.pytest.com/simcore/services/dynamic/sym-server-8-0-0-dy:3.2.34"]',
147+
f"{PRE_PULLED_IMAGES_EC2_TAG_KEY}_0": '["itisfoundation/dynamic-sidecar:latest","itisfoundation/agent:latest","registry.pytest.com/simcore/services/dynamic/ti-postpro:2.0.34","registry.pytest.com/simcore/services/dynamic/ti-simu:1.0.12","registry.pytest.com/simcore/services/dynamic/ti-pers:1.0.',
148+
f"{PRE_PULLED_IMAGES_EC2_TAG_KEY}_1": '19","registry.pytest.com/simcore/services/dynamic/sim4life-postpro:2.0.106","registry.pytest.com/simcore/services/dynamic/s4l-core-postpro:2.0.106","registry.pytest.com/simcore/services/dynamic/s4l-core-stream:2.0.106","registry.pytest.com/simcore/services',
149+
f"{PRE_PULLED_IMAGES_EC2_TAG_KEY}_2": '/dynamic/sym-server-8-0-0-dy:2.0.106","registry.pytest.com/simcore/services/dynamic/sim4life-8-0-0-modeling:3.2.34","registry.pytest.com/simcore/services/dynamic/s4l-core-8-0-0-modeling:3.2.34","registry.pytest.com/simcore/services/dynamic/s4l-stream-8-0-0',
150+
f"{PRE_PULLED_IMAGES_EC2_TAG_KEY}_3": '-dy:3.2.34","registry.pytest.com/simcore/services/dynamic/sym-server-8-0-0-dy:3.2.34"]',
151151
},
152152
id="many images that get chunked to AWS Tag max length",
153153
),

0 commit comments

Comments
 (0)