-
Notifications
You must be signed in to change notification settings - Fork 315
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
Investigate into code sharing opportunities with remote SSH #6137
Comments
Just for my understanding, this is to add the possibility to make a remote container environment be Remote-ssh aware and nothing else? |
We added support to Remote-Containers to connect to an SSH server and with this task we want to better understand if and what parts of the code could be shared between Remote-SSH and Remote-Containers extensions. |
We have a server connection process running with a timeout to kill itself. Every active window every so often pings things process to extend its timeout and stay alive. When a new window is reloaded to connect to a remote host it looks at the current set of processes running and sees if its remote host and VS Code version matches on of the existing connections to use that connection instead. |
@chrmarti To help make more overlap between the SSH connections in Containers and SSH. What if we made SSH an extension dependency of Containers and have the SSH extension handle doing the SSH connection? We could expose an API for the Containers extension. That way all the connectivity remains the same for all SSH experiences in VS Code? |
It would make sense to me to just share the Remote-SSH resolver with the Containers extension. Is there any reason to duplicate that logic in the Containers extension? Here are some things that we can help with
One way to share this functionality would be to basically expose our whole resolver as extension API.
Does that mean it is always copied over via scp? |
@chrmarti I am not following how port forwarding works with ssh in remote-containers. We have two methods
or with dynamic port forwarding, the default
It seems like you aren't using either of these and are doing something with your own node server but I don't understand how it works if ssh isn't involved, can you explain? |
I'm using a single ssh connection to:
This approach avoids much of the ssh details by using only a basic ssh connection. A lot of the code already existed either for setting up or connecting to the container or from using WSL as a simple indirection.
I also want to look into reusing the slightly different approach of Remote-Containers with Windows (it's very close to working with Mac), but reusing Remote-SSH's local server might still make sense, also if I get that working.
Reusing the local server would make a lot of sense. Does that avoid the need for entering the password after a window reload?
It sends the bits through the single ssh connection (see above, no scp involved). This is also a bit for historical reasons (made the most sense for containers) and I can look into downloading remotely if that makes sense in the future.
I would like to avoid an explicit dependency in the package.json since Remote-SSH isn't needed unless we are using an SSH server. Remote-Containers could check at runtime if Remote-SSH is installed and use its API (if that is possible for a resolver before resolving has finished) or the local server directly. |
Someone mentioned Git credential forwarding does not work in Remote-SSH (and I didn't see it in code, although I would expect VS Code's Git-Askpass support to kick in too), maybe something that can be reused from Remote-Containers: #6168 |
This would avoid the need to enter password on reload yes.
This makes sense as well. The details of the local server are saved on your machine. (How we find already running local server on new windows https://github.com/microsoft/vscode-remote-ssh/blob/51d2a9264fd300a26ad7666c61785d594f3bb861/open-ssh-remote/src/local-server.ts#L91). We could expose a bit more an API to work with Containers? |
That would be great. I just checked if Remote-Containers can get at the object returned from Remote-SSH's activate function when the Remote-Containers resolver is still running and the extension object's |
@roblourens @tanhakabir I have collected a few notes from a Remote-Containers perspective. Feel free to add your own. A first conclusion is that it would be interesting to understand if Remote-Containers can reuse the connection from Remote-SSH's local server. I also see a lot of in-depth knowledge about OpenSSH and its features, maybe there is something Remote-Containers would benefit from too.
Remote-SSH knowledge in Remote-Containers:
remote.SSH.path
remote.SSH.configFile
SSH knowledge in Remote-Containers:
ssh
CLI with the connection information originating from the Remote-SSH URI.Notes from looking at the Remote-SSH code:
The text was updated successfully, but these errors were encountered: