mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 09:12:56 +08:00
Allow multiple web UIs to be open at the same time. (#784)
* Allow multiple web UIs to be open at the same time. * Changed formatting.
This commit is contained in:
committed by
Robert Nishihara
parent
37dafa4d14
commit
a2852f2329
@@ -472,6 +472,14 @@ def start_ui(redis_address, stdout_file=None, stderr_file=None, cleanup=True):
|
||||
new_notebook_directory = os.path.dirname(new_notebook_filepath)
|
||||
shutil.copy(notebook_filepath, new_notebook_filepath)
|
||||
port = 8888
|
||||
while True:
|
||||
try:
|
||||
port_test_socket = socket.socket()
|
||||
port_test_socket.bind(("127.0.0.1", port))
|
||||
port_test_socket.close()
|
||||
break
|
||||
except OSError:
|
||||
port += 1
|
||||
new_env = os.environ.copy()
|
||||
new_env["REDIS_ADDRESS"] = redis_address
|
||||
command = ["jupyter", "notebook", "--no-browser",
|
||||
|
||||
Reference in New Issue
Block a user