Skip to content

Commit 8da52aa

Browse files
author
Andrei Neagu
committed
revert accidental port
1 parent 5fea107 commit 8da52aa

File tree

1 file changed

+4
-5
lines changed
  • scripts/maintenance/computational-clusters/autoscaled_monitor

1 file changed

+4
-5
lines changed

scripts/maintenance/computational-clusters/autoscaled_monitor/core.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
import parse
1111
import rich
1212
import typer
13-
from common_library.pydantic_type_adapters import ByteSizeAdapter
1413
from mypy_boto3_ec2.service_resource import Instance, ServiceResourceInstancesCollection
1514
from mypy_boto3_ec2.type_defs import TagTypeDef
16-
from pydantic import ByteSize, ValidationError
15+
from pydantic import ByteSize, TypeAdapter, ValidationError
1716
from rich.progress import track
1817
from rich.style import Style
1918
from rich.table import Column, Table
@@ -144,7 +143,7 @@ def _print_dynamic_instances(
144143
f"Up: {utils.timedelta_formatting(time_now - instance.ec2_instance.launch_time, color_code=True)}",
145144
f"ExtIP: {instance.ec2_instance.public_ip_address}",
146145
f"IntIP: {instance.ec2_instance.private_ip_address}",
147-
f"/mnt/docker(free): {utils.color_encode_with_threshold(instance.disk_space.human_readable(), instance.disk_space, ByteSizeAdapter.validate_python('15Gib'))}",
146+
f"/mnt/docker(free): {utils.color_encode_with_threshold(instance.disk_space.human_readable(), instance.disk_space, TypeAdapter(ByteSize).validate_python('15Gib'))}",
148147
]
149148
),
150149
service_table,
@@ -193,7 +192,7 @@ def _print_computational_clusters(
193192
f"UserID: {cluster.primary.user_id}",
194193
f"WalletID: {cluster.primary.wallet_id}",
195194
f"Heartbeat: {utils.timedelta_formatting(time_now - cluster.primary.last_heartbeat) if cluster.primary.last_heartbeat else 'n/a'}",
196-
f"/mnt/docker(free): {utils.color_encode_with_threshold(cluster.primary.disk_space.human_readable(), cluster.primary.disk_space, ByteSizeAdapter.validate_python('15Gib'))}",
195+
f"/mnt/docker(free): {utils.color_encode_with_threshold(cluster.primary.disk_space.human_readable(), cluster.primary.disk_space, TypeAdapter(ByteSize).validate_python('15Gib'))}",
197196
]
198197
),
199198
"\n".join(
@@ -236,7 +235,7 @@ def _print_computational_clusters(
236235
f"ExtIP: {worker.ec2_instance.public_ip_address}",
237236
f"IntIP: {worker.ec2_instance.private_ip_address}",
238237
f"DaskWorkerIP: {worker.dask_ip}",
239-
f"/mnt/docker(free): {utils.color_encode_with_threshold(worker.disk_space.human_readable(), worker.disk_space, ByteSizeAdapter.validate_python('15Gib'))}",
238+
f"/mnt/docker(free): {utils.color_encode_with_threshold(worker.disk_space.human_readable(), worker.disk_space, TypeAdapter(ByteSize).validate_python('15Gib'))}",
240239
"",
241240
]
242241
),

0 commit comments

Comments
 (0)