[Jobs] Show pool health in the wait spinner for pool-targeted launches#9520
Open
lloyd-brown wants to merge 2 commits intomasterfrom
Open
[Jobs] Show pool health in the wait spinner for pool-targeted launches#9520lloyd-brown wants to merge 2 commits intomasterfrom
lloyd-brown wants to merge 2 commits intomasterfrom
Conversation
Pool jobs that can't dispatch (e.g. no idle replicas) sit in PENDING showing only the generic "Waiting for task to start" spinner — the user has no signal whether the pool is healthy or just busy. Add a one-line pool-health summary to the spinner that updates each tick, so the user can immediately tell "0/3 ready (3 provisioning)" from "3/3 ready" (a legitimate queue) without needing to run sky jobs pool status separately. All FAILED_* replica statuses (FAILED, FAILED_CLEANUP, FAILED_INITIAL_DELAY, FAILED_PROBING, FAILED_PROVISION, UNKNOWN) collapse into a single "failed" count to keep the line readable for large/chaotic pools. Any error querying replicas falls back silently to the original spinner message. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds a pool health summary to the job waiting spinner in sky/jobs/utils.py, providing users with visibility into worker statuses (e.g., ready, failed, provisioning) for pending jobs. Feedback suggests refactoring the _get_pool_health_summary function to use a single-pass iteration and collections.Counter for better efficiency and deterministic output.
…mary Address Gemini review on PR #9520: - Fold the ready count and other-status counts into a single pass. - Use collections.Counter (more idiomatic). - Sort the non-ready breakdown by count descending (alphabetical tiebreaker) so the spinner output is deterministic and the dominant state appears first — the alphabetical sort suggested in review would put 'failed' first in many cases, misleading the reader on where the bulk of replicas actually are. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
|
According to the scenario you described, should we show how many pool replica is occupied by other jobs as well? |
Collaborator
Author
Ah yes I like that, will work on adding that! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
sky jobs launch --pool <pool>can't dispatch immediately (e.g. no idle replicas), the job sits in PENDING showing only the generic "Waiting for task to start" spinner. The user has no signal whether the pool is fundamentally broken (zero READY workers) or just busy with someone else's work — they have to runsky jobs pool statusin another terminal to find out.This PR adds a one-line pool-health summary to that spinner, refreshed each tick, so the situation is visible inline:
_get_pool_health_summaryinsky/jobs/utils.pyqueriesserve_state.get_replica_infosand produces strings likePool 'foo': 5/11 ready (3 provisioning, 2 starting, 1 failed).FAILED_*replica statuses (FAILED,FAILED_CLEANUP,FAILED_INITIAL_DELAY,FAILED_PROBING,FAILED_PROVISION,UNKNOWN) collapse to a singlefailedcount viaReplicaStatus.failed_statuses()so the line stays readable for large/chaotic pools.{pool_str}field is added to_JOB_WAITING_STATUS_MESSAGE. Whenpoolis unset (non-pool launches), it stays empty, so non-pool behavior is unchanged.Test plan
Renderings across pool scales (verified via
unittest.mock.patch.object(serve_state, 'get_replica_infos', ...)):Pool 'demo-pool': 0 workersPool 'demo-pool': 3/3 readyPool 'demo-pool': 1/3 ready (2 provisioning)Pool 'demo-pool': 0/3 ready (3 failed)Pool 'demo-pool': 5/11 ready (3 provisioning, 2 starting, 1 failed)Pool 'demo-pool': 30/50 ready (10 provisioning, 5 starting, 3 not_ready, 2 failed)Pool 'demo-pool': 80/200 ready (50 provisioning, 30 starting, 10 not_ready, 10 pending, 5 shutting_down, 15 failed)End-to-end manual test:
sky jobs launch --pool <healthy-pool> -- echo hi— confirm spinner showsPool '<name>': N/N readywhile waiting, transitions to streaming logs after dispatch.sky jobs launch --pool <pool-with-no-ready-workers> -- echo hi— confirm spinner shows0/N ready (...)instead of leaving the user in the dark.sky jobs launch -- echo hi(no--pool) — confirm spinner is byte-identical to pre-change output (no pool line).format.shclean (10.00/10 pylint, mypy, yapf, isort, black all pass).🤖 Generated with Claude Code