VSCode - how to connect Github and Colab via colab-ssh

Cloud instances like Google Colab, etc. offer free or very cheap options for storage, GPU computing, ready-to-use containers, and a Jupyter notebook/lab IDE for . Overall, there are many options here.

Nevertheless: I personally also like IDEs like VSCode to develop small projects myself. Given that VSCode provides ssh remote access to machines and (in addition to that) Docker containers, I’m wondering what are the best options here to make this happen?

Question: are there other options besides Colab-ssh - maybe better ones?

Background: want to set up a remote Google Colab computer using Vs Code. You work on the Jupyter notebook within Colab, which is hosted in the local computer’s browser.

The connection of Colab & Vs Code and GitHub, it allows us to:

  • bring the local repository to Colab
  • Run Jupyter Notebook in Colab using port forwarding

We have access to the Jupyter notebook hosted by Google Colab, its GPUs (the only condition here is internet speed) and the other resources. One can also access these resources with the local Vs Code editor (which has the advantage that we can navigate the repositories containing multiple folders and interdependent code files).

The advantage - so it’s like we’re working on the local machine with Vs Code’s navigation features, GUI, etc., while in reality we’re accessing Colab’s machines. I think this is very, very useful. There are more advantages - because beyond what has just been said, there is also the ability to upload the local files to GitHub - and clone them to the Colab machine. The advantage for working: The files can be developed or edited in Colab. The connection of Colab & Vs Code and GitHub, it enables us a lot - on the whole, then also that at the end of the day you can save all the work on GitHub by simply pushing the updated repository back on GitHub. It’s all very convenient.

I am concerned here with the concrete implementation:

I found out about the solution with Colab-ssh: GitHub - WassimBenzarti/colab-ssh: Connect to Google Colab using SSH

GitHub - WassimBenzarti/colab-ssh: Connect to Google Colab using SSH

Colab-ssh is a light-weight library that allows you to connect to a remote Jupyter Notebook using an SSH Tunnel and optionally via VSCode. Open Google Colab and run this code in one of the code cells

# Install colab_ssh on google colab

!pip install colab_ssh --upgrade

from colab_ssh import launch_ssh_cloudflared, init_git_cloudflared


# Optional: if you want to clone a Github or Gitlab repository




Make sure you replace <PUT_YOUR_PASSWORD_HERE> with a password of your choice and <PUT_YOUR_REPOSITORY_URL_HERE> with the link to your Github/Gitlab
repository (if you use the git integration).

The output of this snippet will look similar to the following screenshot: launch_ssh_cloudflared output
warning If it’s the first time you launch colab-ssh on your machine, it’s important to follow the instructions in the “Client machine configuration” section. To show the steps that you need to do, just click “Client machine configuration”. Don’t worry, you don’t have to repeat these steps again for each notebook.

grey_question Things doesn’t work ? or looking for a way to connect using Ngrok ? Check the colab-ssh ngrok documentation[/quote]

GitHub - WassimBenzarti/colab-ssh: Connect to Google Colab using SSH

a Methode without the usage of ssh

Is it possible to connect vscode (on a local machine) with Google Colab (the free service) runtime?
vgl. [url]https://stackoverflow.com/questions/59508225/is-it-possible-to-connect-vscode-on-a-local-machine-with-google-colab-the-fre[/url]

# Install jupyterlab and ngrok

!pip install jupyterlab==2.2.9 pyngrok -q

# Run jupyterlab in background

!nohup jupyter lab --ip= &

# Make jupyterlab accessible via ngrok

from pyngrok import ngrok


It will then show a JupyterLab URL

http://f1fe6fb39df6.ngrok.io # for example

You can click it to run JupyterLab now. Or use the URL with VSCode for remote Jupyter kernel.

You can also use my lib

rary to make it short.

!pip install kora -q

from kora import jupyter


see [url]https://stackoverflow.com/questions/59508225/is-it-possible-to-connect-vscode-on-a-local-machine-with-google-colab-the-fre[/url]

update: found several methods - described here:

How to Connect to VSCode to Colab

Is it possible to connect vscode (on a local machine) with Google Colab (the free service) runtime?

How to Use Google Colab with VS Code

Colab + Vs Code + GitHub + Jupyter (Perfect for Deep Learning)

VSCode on Google Colab

How To use Google Colab with VS Code