Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Fix the NoOp for rich status #2678

Merged
merged 4 commits into from
Oct 9, 2023
Merged

[Core] Fix the NoOp for rich status #2678

merged 4 commits into from
Oct 9, 2023

Conversation

Michaelvll
Copy link
Collaborator

@Michaelvll Michaelvll commented Oct 8, 2023

Fixes #2665

Previously, when NoOp is returned, with rich_utils.safe_status() as status:, the status is actually the return value of __enter__ (None for the NoOp), causing failure if status is used later.

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: pytest tests/test_smoke.py
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: bash tests/backward_comaptibility_tests.sh

@Michaelvll Michaelvll changed the title [Core] Fix the NoOp for rich status [Core/Dependency] Fix the NoOp for rich status and pandas dependency Oct 8, 2023
@Michaelvll Michaelvll changed the title [Core/Dependency] Fix the NoOp for rich status and pandas dependency [Core] Fix the NoOp for rich status Oct 8, 2023
Copy link
Collaborator

@concretevitamin concretevitamin left a comment

Choose a reason for hiding this comment

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

Thanks @Michaelvll, LGTM.

@@ -15,7 +15,7 @@ class _NoOpConsoleStatus:
"""An empty class for multi-threaded console.status."""

def __enter__(self):
pass
return self
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q: which call path into this caused the original issue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The ones like this:

with rich_utils.safe_status(
'[bold cyan]Launching - Waiting for SSH access[/]') as status:

The status will be None, when the provisioner is called with sky_logging.is_silent(), which is used for sky spot queue:

skypilot/sky/cli.py

Lines 1620 to 1623 in f2cf032

with sky_logging.silent():
# Make the call silent
spot_jobs = core.spot_queue(refresh=refresh,
skip_finished=skip_finished)

Copy link
Collaborator

Choose a reason for hiding this comment

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

SG

@Michaelvll Michaelvll merged commit 371f00e into master Oct 9, 2023
18 checks passed
@Michaelvll Michaelvll deleted the fix-status-update branch October 9, 2023 05:16
jc9123 pushed a commit to jc9123/skypilot that referenced this pull request Oct 11, 2023
* Fix the NoOp for rich status

* fix shell completion installation

* pin pandas

* revert dependency
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.

spot queue -r failed to restart spot controller but start works
2 participants