Note: worked in 2020, may no longer work exactly as described.
Idea: conveniently work with github repo and notebook on colab.
- Sign up for ngrok
- Install colab_ssh in colab notebook
- Start tunnel
- Provide ngrok token from https://dashboard.ngrok.com/auth/your-authtoken
- Can this be hidden? We could put it into google drive and fetch it from there.
- Take note of config printed to notebook
- Provide ngrok token from https://dashboard.ngrok.com/auth/your-authtoken
- Connect vscode
- Option 1: run vscode on colab, connect via browser
- Setup
-
connect from local machine
ssh -A -L 9999:localhost:9999 root@2.tcp.ngrok.io -p 10865 apt install tmux tmux git config --global user.name my_name git config --global user.name my_email code-server --bind-addr 127.0.0.1:9999 --auth none
-
Go to http://localhost:9999 in browser
-
- Settings made persistent by saving them in google drive
- Setup
- Option 2: run vscode locally, connect via remote extension
- Setup
-
Put the this into
~/.ssh/config
(replace with values shown in colab)Host google_colab_ssh ForwardAgent yes HostName 2.tcp.ngrok.io User root Port 10865
-
Install vscode locally
-
Install remote ssh extenstion
-
Command + P connect to host
-
Select
google_colab_ssh
-
- Are settings persistent?
- Where are extensions installed?
- Seems they are also installed on remote.
- Probably in
/root/.vscode-server
- Probably in
- How to save in drive?
- Symlink like with other solution
- Seems they are also installed on remote.
- Setup
- Option 1: run vscode on colab, connect via browser
- in vscode
- Install python extension
- Current (August 4, 2020) version is broken (at least for vscode remote server with browser), so downgrade to 2020.5.86806
- Install git lens
- Repo level config
- Configure black as formatter
- Turn on save on formatting
- Python path
- flake8 as linter
- Install python extension