Skip to content
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

Is there a way to use VSCode Remote-SSH extension on Jean-Zay? #67

Open
cedricrommel opened this issue Apr 16, 2021 · 15 comments
Open

Is there a way to use VSCode Remote-SSH extension on Jean-Zay? #67

cedricrommel opened this issue Apr 16, 2021 · 15 comments

Comments

@cedricrommel
Copy link

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?

@RemiLacroix-IDRIS
Copy link
Contributor

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.

@lesteve
Copy link
Member

lesteve commented Apr 20, 2021

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?

@lesteve
Copy link
Member

lesteve commented Apr 20, 2021

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.

@RemiLacroix-IDRIS
Copy link
Contributor

@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.

@lesteve
Copy link
Member

lesteve commented Apr 20, 2021

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).

@RemiLacroix-IDRIS
Copy link
Contributor

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.

@lesteve
Copy link
Member

lesteve commented Jul 26, 2021

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?

image

So it does look like indeed the root of the problem is the SSH port forwarding restriction on Jean-Zay.

@lesteve lesteve changed the title Is there a way to pair VSCode with Jean-Zay? Is there a way to use VSCode Remote-SSH extension on Jean-Zay? Sep 8, 2021
@vopikamm
Copy link

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)

@RemiLacroix-IDRIS
Copy link
Contributor

Have you seen that you can run a Code-Server instance from our JupyterHub?

@vopikamm
Copy link

No I have not, but that's great! Thank you

@lesteve
Copy link
Member

lesteve commented Nov 27, 2023

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.

@RemiLacroix-IDRIS
Copy link
Contributor

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.

@vopikamm
Copy link

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!

@Butanium
Copy link

Butanium commented Feb 2, 2024

There are a lot of extensions missing (e.g. copilot, live share etc.)

@3f6a
Copy link

3f6a commented Aug 17, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants