SwissDataScienceCenter / amalthea

A kubernetes operator for spawning and exposing jupyter servers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Native sessions for vs-code

olevski opened this issue · comments

There should be a way for Amalthea to create vs-code native sessions. Similarly to how we have #149 for Rstudio.

However in this case several question are very much open:

  • what is required to do this - is there a container image or something similar that amalthea can use or do we have to make this from scratch?
  • how will the session be accessed - over http or ssh?
  • how will authentication work
  • how to connect your local vscode (desktop) program to the one running in amalthea

More useful stuff from Rok playing with gitopod:

but yeah, it seems possible to set up ssh the way you suggested and using certificates w/ oauth - this is the config file they set up
Host davhau-machnix-1uhxc0by1ts
HostName 127.0.0.1
User gitpod
Port 59890
IdentityFile /var/folders/99/jng0jljd13db0h4jwbwtx4mh0000gn/T/gitpod_e8aa7536-1de7-403f-b9d2-450a285ca2f1_id_rsa
IdentitiesOnly yes
so locally they spin up an ssh session presumably to proxy to the remote server - I see this running:
rok              76202   0.0  0.1 409254400  21216   ??  Ss    3:27PM   0:00.11 /var/folders/99/jng0jljd13db0h4jwbwtx4mh0000gn/T/gitpod-local-companion-76011-LIBNQ2F5af7m
rok              76023   0.0  0.0 409085984   5488   ??  S     3:26PM   0:00.08 ssh -v -T -D 59850 -o ConnectTimeout=15 -F /var/folders/99/jng0jljd13db0h4jwbwtx4mh0000gn/T/gitpod_ssh_config-725-TiqFIs38bYmL davhau-machnix-1uhxc0by1ts
rok              76018   0.0  0.2 447054288  55056   ??  Ss    3:26PM   0:00.43 /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Users/rok/.vscode/extensions/ms-vscode-remote.remote-ssh-0.80.0/out/localServer.js {"serverId":1,"ipcHandlePath":"/var/folders/99/jng0jljd13db0h4jwbwtx4mh0000gn/T/vscode-ssh-askpass-1d9fd347a8387a44dd7a276915a723b39e24dfff.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","59850","-o","ConnectTimeout=15","-F","/var/folders/99/jng0jljd13db0h4jwbwtx4mh0000gn/T/gitpod_ssh_config-725-TiqFIs38bYmL","davhau-machnix-1uhxc0by1ts"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/rok/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-190185ec-da15b6fd3ef856477bf6f4fb29ba1b7af717770d-0.80.0/data.json"}
rok              75432   0.0  0.1 409257616  24736   ??  Ss    3:26PM   0:00.47 /var/folders/99/jng0jljd13db0h4jwbwtx4mh0000gn/T/gitpod-local-companion-725-KqaW48Z0sJ6r

If we use the gitopod code server then we are missing the vs code extension that gitopod provides that can be used to connect to a gitopod openvscode-server. This way we do not even have to use the browser to access the vscode sessions but we can connect to them directly from the local vscode instance.

More insights from Rok:

I wonder if their vscode extension is open source - because that’s the missing piece

well, and setting up ssh via oauth in the first place

but I’ve found some good examples of that that don’t seem crazy hard

Here is the vscode extension used to access a vscode server from a local vscode installation: https://github.com/gitpod-io/openvscode-server/tree/gp-code/main/extensions/gitpod/src

Hi,

Seeing this as well as #149, are you exploring a path that would make Renku go in a direction similar to https://www.eclipse.org/che/ ?