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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sky/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import subprocess
import sys
import textwrap
import time
import typing
from typing import Any, Dict, List, Optional, Tuple, Union
import webbrowser
Expand Down Expand Up @@ -3718,7 +3719,7 @@ def spot_dashboard(port: Optional[int]):
click.secho('Checking if spot controller is up...', fg='yellow')
hint = (
'Dashboard is not available if spot controller is not up. Run a spot '
'job first, or use `sky start` to bring up an existing controller.')
'job first.')
_, handle = spot_lib.is_spot_controller_up(stopped_message=hint,
non_existent_message=hint)
if handle is None:
Expand All @@ -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(3) # Added delay for ssh_command to initialize.
webbrowser.open(f'http://localhost:{free_port}')
MaoZiming marked this conversation as resolved.
Show resolved Hide resolved
click.secho(
f'Dashboard is now available at: http://127.0.0.1:{free_port}',
Expand Down