Skip to content

Commit

Permalink
Change dstack fleet STATUS for block instances (#2280)
Browse files Browse the repository at this point in the history
idle      →   0/8 busy
3/8 idle  →   5/8 busy
busy      →   8/8 busy
  • Loading branch information
un-def authored Feb 10, 2025
1 parent 39f6321 commit 56c2bc5
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/dstack/_internal/cli/utils/fleet.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,8 @@ def get_fleets_table(
status = instance.status.value
total_blocks = instance.total_blocks
busy_blocks = instance.busy_blocks
if (
total_blocks is not None
and total_blocks > 1
and total_blocks > busy_blocks
and instance.status == InstanceStatus.BUSY
):
# 1/4 BUSY => 3/4 IDLE
idle_blocks = total_blocks - busy_blocks
status = f"{idle_blocks}/{total_blocks} {InstanceStatus.IDLE.value}"
if total_blocks is not None and total_blocks > 1:
status = f"{busy_blocks}/{total_blocks} {InstanceStatus.BUSY.value}"
if (
instance.status in [InstanceStatus.IDLE, InstanceStatus.BUSY]
and instance.unreachable
Expand Down

0 comments on commit 56c2bc5

Please sign in to comment.