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

[Spot/UX]: Spot dashboard Added delay for ssh_command to initialize #2136

Merged
merged 3 commits into from
Jun 27, 2023

Conversation

MaoZiming
Copy link
Collaborator

@MaoZiming MaoZiming commented Jun 27, 2023

Issue: #2123

User feedback

Small UX feedback: when I run sky spot dashboard, very often the page that opens first shows some error, and after a few seconds it automatically refreshes and loads. Slightly confusing user experience.

Added a delay between ssh command and webbrowser.open.

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

Copy link
Member

@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 @MaoZiming! Works like a charm.

sky/cli.py Outdated
@@ -3736,6 +3737,7 @@ def spot_dashboard(port: Optional[int]):

with subprocess.Popen(ssh_command, shell=True,
start_new_session=True) as ssh_process:
time.sleep(5) # Added delay for ssh_command to initialize.
Copy link
Member

Choose a reason for hiding this comment

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

Does 2s or 1s work? 5s feels a bit long.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Reduced to 3s.
It takes around 2+s on my computer.
Or maybe we can simply remove webbrowser.open and let user click the link in the prompt.

sky/cli.py Outdated Show resolved Hide resolved
sky/cli.py Show resolved Hide resolved
Copy link
Member

@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.

LGTM, merging.

@concretevitamin concretevitamin merged commit a9a9ab1 into master Jun 27, 2023
@concretevitamin concretevitamin deleted the spot-dashboard-fail-to-load-fix branch June 27, 2023 03:58
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 dashboard/UI] Page failed to display in the first few seconds after opening
2 participants