Skip to content

Conversation

peterschmidt85
Copy link
Contributor

@peterschmidt85 peterschmidt85 commented May 31, 2025

Fixes #2655

  • In the Status column (both CLI and UI), show a human-readable status explaining the termination reason from the last job submission (Example Failed -> Exited (137); Failed -> No offers, etc)
  • Correct the status color in UI (e.g. for Aborted or No offers, use Yellow)
  • In the Error column (both CLI and UI), show a human-readable status only in case the Status information is not enough (e.g. do not show anything in case of No offers or Exited (137).
  • Merge the Reservation column into the Instance type column
  • Reflect the Status changes in the output of dstack apply in case the run has failed due to No offers or Exited (X)

@peterschmidt85 peterschmidt85 linked an issue May 31, 2025 that may be closed by this pull request
@peterschmidt85 peterschmidt85 marked this pull request as ready for review June 2, 2025 15:34
@peterschmidt85 peterschmidt85 requested a review from olgenn June 2, 2025 15:34
@peterschmidt85 peterschmidt85 requested a review from r4victor June 3, 2025 07:02
Comment on lines 353 to 377
def _get_error(termination_reason: Optional[JobTerminationReason]) -> Optional[str]:
if termination_reason == JobTerminationReason.INSTANCE_UNREACHABLE:
return "instance unreachable"
elif termination_reason == JobTerminationReason.WAITING_INSTANCE_LIMIT_EXCEEDED:
return "waiting instance limit exceeded"
elif termination_reason == JobTerminationReason.VOLUME_ERROR:
return "waiting runner limit exceeded"
elif termination_reason == JobTerminationReason.GATEWAY_ERROR:
return "gateway error"
elif termination_reason == JobTerminationReason.SCALED_DOWN:
return "scaled down"
elif termination_reason == JobTerminationReason.INACTIVITY_DURATION_EXCEEDED:
return "inactivity duration exceeded"
elif termination_reason == JobTerminationReason.TERMINATED_DUE_TO_UTILIZATION_POLICY:
return "utilization policy"
elif termination_reason == JobTerminationReason.PORTS_BINDING_FAILED:
return "ports binding failed"
elif termination_reason == JobTerminationReason.CREATING_CONTAINER_ERROR:
return "runner error"
elif termination_reason == JobTerminationReason.EXECUTOR_ERROR:
return "executor error"
elif termination_reason == JobTerminationReason.MAX_DURATION_EXCEEDED:
return "max duration exceeded"
else:
return None
Copy link
Collaborator

@r4victor r4victor Jun 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe define a mapping instead of a big if? Also I think we'll forget to update this when adding new termination reasons unless there is a test that checks all reasons are mapped.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, also added tests

@peterschmidt85 peterschmidt85 merged commit 8988c9d into master Jun 3, 2025
20 checks passed
@peterschmidt85 peterschmidt85 deleted the 2655-ux-improve-the-output-of-dstack-ps branch June 3, 2025 10:43
@@ -171,7 +166,12 @@ def apply_configuration(
# We can attach to run multiple times if it goes from running to pending (retried).
while True:
with MultiItemStatus(f"Launching [code]{run.name}[/]...", console=console) as live:
while not _is_ready_to_attach(run):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaks fix #2720

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UX]: Improve the output of dstack ps
3 participants