VSColab

SSH into Colab Notebooks and use VSCode for remote development


Keywords
VSColab, Colab, VS
License
MIT
Install
pip install VSColab==0.1.4

Documentation

VSColab

Use Google Colab GPU's and TPU's via an ssh connection locally in your device.

license python version

Installation:

Installation is easy!

$ pip install VSColab

Using this package we can ssh into the Google Colab instance and also perform remote developement using VSCode.

What's New in 0.1.4:

  • GetSSH() function automates the process of getting the Tunnel URL.

Getting Started:

  • Install the package
  • Use the Connect() function to create an Ngrok tunnel, by passing a password string as a parameter.
  • Then Enter the Authentication Key (which can be obtained from:https://dashboard.ngrok.com/auth/your-authtoken) and press Enter.
  • To get the ssh command, run the GetSSH() function.
  • Use the VSconfig() function to get the contents for the VSCode Config file, by passing the Tunnel URL (which can be obtained from the GetSSH() function).
  • To kill the tunnel, use the Kill() function.

Colab starter notebook:

Open In Colab

Remote development with VSCode:

  • First create a tunnel using the Connect() function.
  • Use the VSconfig() function to get the contents for the VSCode Config file, by passing the Tunnel URL (which can be obtained from the GetSSH() function).
  • Then install the remote-ssh plugin in VSCode, and click the button at the bottom left corner.
  • Then select the Open Configuration Files.. option and enter the copied text there.
  • Then select the Connect to Host.. option and Enter the password when asked.
  • Viola!! A fully functional Development environment powered by the GPU's and TPU's of Google Colab

Note:

If the command $ nvidia-smi doesn't work in the ssh session, simply type :

export LD_PRELOAD=/usr/lib64-nvidia/libnvidia-ml.so

Then press Enter.