Skip to content

Commit

Permalink
Small logging refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
irfansharif committed Jan 23, 2025
1 parent 23666e4 commit 23fdb65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions modal/cli/programs/run_jupyter.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ def run_jupyter(q: Queue):
with forward(8888) as tunnel:
url = tunnel.url + "/?token=" + token
threading.Thread(target=wait_for_port, args=(url, q)).start()
print("\nJupyter on Modal, opening in browser...")
print(f" -> {url}\n")
subprocess.run(
[
"jupyter",
Expand All @@ -89,7 +91,5 @@ def main():
run_jupyter.spawn(q)
url = q.get()
time.sleep(1) # Give Jupyter a chance to start up
print("\nJupyter on Modal, opening in browser...")
print(f" -> {url}\n")
webbrowser.open(url)
assert q.get() == "done"
6 changes: 3 additions & 3 deletions modal/cli/programs/vscode.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ def run_vscode(q: Queue):
token = secrets.token_urlsafe(13)
with forward(8080) as tunnel:
url = tunnel.url
print("\nVS Code on Modal, opening in browser...")
print(f" -> {url}")
print(f" -> password: {token}\n")
threading.Thread(target=wait_for_port, args=((url, token), q)).start()
subprocess.run(
["/code-server.sh", "--bind-addr", "0.0.0.0:8080", "."],
Expand All @@ -103,8 +106,5 @@ def main():
run_vscode.spawn(q)
url, token = q.get()
time.sleep(1) # Give VS Code a chance to start up
print("\nVS Code on Modal, opening in browser...")
print(f" -> {url}")
print(f" -> password: {token}\n")
webbrowser.open(url)
assert q.get() == "done"

0 comments on commit 23fdb65

Please sign in to comment.