-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support SSH remote development feature #12618
Conversation
13b48d5
to
a6229dc
Compare
ec81137
to
a8b2eeb
Compare
@kkistm I've updated the project readme. It explains the whole remote connection lifecycle in detail 👍 |
b42eaf9
to
3b6466e
Compare
packages/core/src/node/remote/app-native-dependency-contribution.ts
Outdated
Show resolved
Hide resolved
I think it's reasonable for a first iteration. Among others, there are a couple flavour of |
Using the Electron example, I got the exception below, a few seconds after using Then I retried, and it worked. So maybe this is intermittent. I think I'll clear the remote folder and see if I can reproduce.
|
I noticed, after killing the Electron window connected to the remote, that the remote Theia app still seems to be running on the remote. Still there after I exit the local Electron example app. ~/.theia-example-electron-1.40.0-remote$ ps aux | grep theia
marc 3315576 0.0 0.0 9500 3132 ? Ss 11:23 0:00 bash -c cd "/home/marc/.theia-example-electron-1.40.0-remote";/home/marc/.theia-example-electron-1.40.0-remote/node-v16.14.0-linux-x64/bin/node "/home/marc/.theia-example-electron-1.40.0-remote/lib/backend/main.js" "--port=0" "--remote"
marc 3315577 0.4 0.3 11526472 103572 ? Sl 11:23 0:01 /home/marc/.theia-example-electron-1.40.0-remote/node-v16.14.0-linux-x64/bin/node /home/marc/.theia-example-electron-1.40.0-remote/lib/backend/main.js --port=0 --remote
marc 3315594 0.4 0.1 1119744 58820 ? Sl 11:23 0:01 /home/marc/.theia-example-electron-1.40.0-remote/node-v16.14.0-linux-x64/bin/node /home/marc/.theia-example-electron-1.40.0-remote/lib/backend/ipc-bootstrap --nsfwOptions={}
marc 3315673 0.0 0.1 594208 48564 ? Sl 11:23 0:00 /home/marc/.theia-example-electron-1.40.0-remote/node-v16.14.0-linux-x64/bin/node /home/marc/.theia-example-electron-1.40.0-remote/lib/backend/ipc-bootstrap
marc 3316134 0.0 0.0 8908 2400 pts/8 S+ 11:28 0:00 grep --color=auto theia If I reconnect, a new remote app is started, that also remains running on the remote. |
I have noticed that I can't start a new terminal. I think I see the terminal widget but it disappears very fast. There's a warning each time I try: "ColorManager.ts:222 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently" |
@marcdumais-work Thanks for looking into this! I was aware of the issue that the server continues running on the remote, but the others are new to me. Due to vacation, I'll come back to this in 2 weeks. |
@msujew One potential source of issues is that I used a slightly older desktop machine, as the remote to connect-to. Both older hardware ( Such incompatibilities would not be necessarily a defect in the context of this PR (could be documented as a known limitation). A follow-up could e.g. setup in CI the necessary to build more varied OS-specific native dependencies archive packages, and in a case like mine, I could then use the eventual |
Another relatively easy strategy could be used, taking advantage of general better backward compatibility vs forward. i.e. software built on OS version e.g. So, in our case, that would mean targeting the older supported OS version, when we generate the native dependencies archive packages, as much as possible, if we do not do it already. So, ATM, we would use Ubuntu 20.04 instead of a newer version (assuming we do support that version). Update: I see that we already use Ubuntu 20.04, so the problem may lie elsewhere. |
@marcdumais-work The issue was that I used |
@msujew I see, thanks for the info. When you have time, could the package be deleted and re-created using the newer code? Or maybe it already has? Alternatively, I tried to use Gitpod as remote machine, like you mentioned doing, but could not immediately figure how to do that. |
I've already done that. I've tested it with an ubuntu-20.04 machine, which worked as expected. Something doesn't work for you?
Gitpod offers to connect to any running workspace via SSH. You just need to register a key and then open the dashboard and select |
9a77ece
to
d3ca2df
Compare
@marcdumais-work I've fixed the headless server issue. Processes are now terminated when the ssh connection closes. I believe I was also able to fix the tar issue you were experiencing. It's due incompatible sftp servers on the target machine. See also here. Using Please let me know whether that works better for you :) |
b1a960b
to
352aad1
Compare
We need the local backend for 3 reasons:
We shouldn't clash, all potentially clashable resources are:
The only clash could happen if two distinct Theia apps use the same name and version. Then the remote extension would incorrectly assume that the remote system already has a remote backend available to start up. However, I think this is quite unlikely.
The local backend listening on |
packages/remote/src/electron-node/setup/remote-node-setup-service.ts
Outdated
Show resolved
Hide resolved
98bc3e3
to
12fc0b4
Compare
@msujew I'd add "make it work with ARM" to the follow-ups. Otherwise, we'll have a lot of disgruntled mac users ;-) |
@msujew when I connect to my Windows localhost, I get an error after entering my password: "Could not open SSH connection to remote. Failed to create directory: 'New-Item' is not recognized as an internal or external command, operable program or batch file." |
Yep, good idea :)
Ah, thanks. Seems like the SSH connection didn't connect to |
I've tested that I can connect from a windows host to windows/linux and from a linux host to windows/linux. Works well withing the constraints detailed in the description. Plugins that are installed on the local machine (as opposed to built-in) are picked up by the remote back-end. That is something we might want to look up when solving the "transport local plugins" problem. |
What it does
Closes #12390
This change adds the functionality to connect to remote backends using SSH. It adds infrastructure to support other types of connections as well (i.e. WSL or Devcontainers), but implements the functionality only for SSH connections.
Note that this change supports only the Electron version of Theia.
How to test
Requires an SSH capable system to which the connection can be established. Note that due to #12782, this requires a fairly updated system with
glibc >= 2.33
(on Linux at least). Also due to a limitation on GitHub actions, it requires a x64 machine. I've simply used a Gitpod workspace.SSH: Connect to Host...
command (or click on the remote status bar entry in the bottom left of the application). Enter the remote system address.Follow-Ups
Review checklist
Reminder for reviewers