Is there a way to use VSCode Remote-SSH extension on Jean-Zay?
cedricrommel opened this issue · 15 comments
I could not make it work with the Remote-SSH
feature. From what I understand SSH from Jean Zay going to the outside is very restricted, which might explain why this is not working. Can anyone confirm that and do you know of a way of making it work without ssh?
Hi,
You cannot use the Remote-SSH
feature from VSCode on Jean Zay because of some security restrictions.
Although it's not officially supported on Jean Zay, you can use SSHFS instead: https://code.visualstudio.com/docs/remote/troubleshooting#_using-sshfs-to-access-files-on-your-remote-host.
VSCode is a very popular editor / developing environment these days and it would be great to be able to have such a workflow. I am wondering whether such a request has been mentioned to the Jean Zay security team to have their feeling on it. Yes I know things like this (due to hard security constraints) may take some time before being considered/accepted/possible.
According to the VSCode doc you only need outbound HTTPS connectivity and all the rest goes via SSH. They don't seem to explictly mention SSH port forwarding (which is disabled on Jean Zay) but maybe this is needed.
Also of interest @cedricrommel, where you getting some kind of meaningful error from VSCode or it just did not work?
Also in practice the most convenient workflow people have found is a combination of inotify + rsync
see #25. This way you edit your code locally with your favorite setup and the updates gets pushed automatically to Jean Zay on modification.
sshfs is an option (also mentioned in the issue) but from user feed-back sometimes it is very slow which makes the editing experience too painful to be a workable solution. If you have a difference experience, this would be more than welcome.
@lesteve : It would require to have port forwarding enabled and it's not something we can do.
I have never heard anybody complaining about sshfs being too slow to edit code files.
OK so you seem to confirm VSCode needs SSH port forwarding so yeah I can understand this is not easy to change ...
I have never heard anybody complaining about sshfs being too slow to edit code files.
OK interesting, because in my experience I have always experienced this (different local setups, different computing centres, different time periods in my life, etc...) and have got similar feed-back from some users.
Maybe it is because we use project-wide functionalities very regularly in our developing environment while editing a single fine is probably (more or less) OK. For example I very regularly (emacs setup with helm if you want to know) grep all the files for some pattern in my project and keep typing the pattern with instant updates of the matches. This is something I can not code without I am afraid. Having it not update quasi-instantly kills productivity in my experience. In my experience there is some caching going on with sshfs
so sometimes it works well enough but the few times that the interface hangs too long is too painful as far as I am concerned.
Also as a general point is that using sshfs
makes you depend on Jean Zay quirks (login node restart, maybe CPU time limit after some time not sure) and as a user I'd rather not do that if I don't really have to. This is also why for me, using inotify + rsync
seems a good compromise (for editing files).
I have never tested inotify + rsync
but it's always good to have alternative.
Regarding sshfs
, I can confirm that there is some caching and I have never reach the CPU time limit even after a few days.
For completeness (and potentially help other people that bump into this problem), here is the output I was getting (
[14:38:23.938] Starting forwarding server. localPort 45273 -> socksPort 36405 -> remotePort 46373
[14:38:23.940] Forwarding server listening on 45273
[14:38:23.941] Waiting for ssh tunnel to be ready
[14:38:23.947] [Forwarding server 45273] Got connection 0
[14:38:23.953] Tunneled 46373 to local port 45273
[14:38:23.954] Resolved "ssh-remote+jean-zay" to "127.0.0.1:45273"
[14:38:23.975] ------
[14:38:23.977] Failed to set up socket for dynamic port forward to remote port 46373: Socket closed. Is the remote port correct?
[14:38:24.028] [Forwarding server 45273] Got connection 1
[14:38:24.042] Failed to set up socket for dynamic port forward to remote port 46373: Socket closed. Is the remote port correct?
So it does look like indeed the root of the problem is the SSH port forwarding restriction on Jean-Zay.
It seems like nothing will be changed about the port forwarding in future, right? There are two issues following this, where sshfs is no workaround: Using git and jupyter notebooks. I would be happy about any solution or workaround (with VS Code)
Have you seen that you can run a Code-Server instance from our JupyterHub?
No I have not, but that's great! Thank you
It seems like nothing will be changed about the port forwarding in future, right?
That would be my guess.
Have you seen that you can run a Code-Server instance from our JupyterHub?
Interested to know more, can you elaborate or share a link to your documentation?
Do you mean having a VSCode tab inside a browser by going through the Jean-Zay JupyterHub? If so this is not as nice as using a Desktop VSCode (shortcuts tend to not be reliable inside a browser in my experience) but still could be useful for some people.
Do you mean having a VSCode tab inside a browser by going through the Jean-Zay JupyterHub?
Yes, either by selecting "VSCode" as "Frontend" when starting a new instance from our JupyterHub or by starting a JupyterLab instance and then starting "Code Server" from the "Applications" section.
Interested to know more, can you elaborate or share a link to your documentation?
It is mentioned here
If so this is not as nice as using a Desktop VSCode
I agree about Desktop VSCode being preferable...But still a nice improvement!
There are a lot of extensions missing (e.g. copilot, live share etc.)
Given that VSCode Remote-SSH doesn't work, I wonder if anyone tried the newer Remote Tunnels extension? Ref. https://code.visualstudio.com/docs/remote/tunnels. Could someone tell if this works with Jean Zay or not?
(I cannot try myself since in the process of getting an account at Jean Zay)