question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can we stop keyboard interrupt in colab from breaking SSH?

See original GitHub issue

Is your feature request related to a problem? Please describe.

First off, thank you so much for the fix to the recent changes that broke ngrok. You made it very easy to get it working again with cloudflared.

When I interrupt a cell in colab it also interrupts the SSH connection and causes VSCode Remote to disconnect from Colab. This then means I have to go run launch_ssh_cloudflared(password) again, wait for it to load, copy the new cloudflared url and reconnect to colab again, then navigate back to my working folder, entering the password twice.

Describe the solution you’d like

The ability to interrupt cells in colab without breaking the SSH connection.

Describe alternatives you’ve considered -Trying to get ngrok working again so I could use a static TCP address that makes reconnecting faster

  • Running the process in the background by putting the cloudflared command in a script called ssh.py and running !nohup python3 start_ssh.py &, then reading the cloudflared URL out of ssh_details via regex from nohup.out.

Additional context I’m happy to help with this or PR myself if I get a solution, I’m just not sure where to go from here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
rbraccocommented, Dec 21, 2020

Awesome, thanks again for your guidance and this awesome library. It has enabled me to do stuff in Colab I never thought would be possible.

0reactions
WassimBenzarticommented, Dec 18, 2020

Okay, so oddly this is an known feature request on Github. I tried to make my own fork and tested all the different ways to do it.

I believe there are two ways to do this:

1. Forked repository verification

  1. Create a branch on your forked repo and add a pull request to your master branch
  2. The action will be ran on your forked repo (and of course add the secret NROK_TOKEN to your repo)
  3. Finally, maintainers will check the action on the forked repo before merging

2. Staging branch

  1. Create a staging branch on colab-ssh original repository
  2. Accept all the pull requests incoming from forks on that branch

To speed up the process, I will be using the second method and merge your changes directly to the staging branch.

Congratulation, you are one of the few colab-ssh contributors 🎆 🥳

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can we stop keyboard interrupt in colab from breaking SSH?
Running the process in the background by putting the cloudflared command in a script called ssh.py and running !nohup python3 start_ssh.py & ,...
Read more >
How can I prevent Google Colab from disconnecting?
The trick is to configure a macro program to click on the Ram/Disk Colab Toolbar Button twice with a short interval between the...
Read more >
KeyboardInterrupt interrupts my code on its own #9671
I am using VSCode with Jupyter to train my ML models using Pytorch. Since 11.04.2022 the training loop for my model sometimes (it...
Read more >
10 tricks for a better Google Colab experience
Stop Colab from disconnecting; Display dataframes as interactive tables; Use TensorBoard with Colab; Change display mode. 1. SAVE TIME WITH ...
Read more >
Configuring Colab Like a Pro Template - Colaboratory
Run code below · Copy the codes output (example below) into your vscode remote config Ctrl-Shift-P->Remote SSH Connect to Host->Configure SSH Hosts ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found