Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

[Question] Can ra-multiplex server running on remote machine, and client running on my local machine? #68

Closed
eval-exec opened this issue Jul 21, 2024 · 4 comments
Labels
question Further information is needed

Comments

@eval-exec
Copy link

Hello, I noticed that rust-analyzer is using too much CPU on my local laptop, which has relatively low specs. My remote server has much better hardware. Is it possible to run the ra-multiplex server on the remote server and have the ra-multiplex client run on my local laptop? Thank you!

@pr2502
Copy link
Owner

pr2502 commented Jul 25, 2024

Theoretically yes, you can port-forward the TCP socket through SSH for example. But I haven't tried it and I expect trouble around file synchronization between the language server and the editor. If you want to try it you probably also want the filesystem to be shared between your computer and the remote server and you'll have to match the absolute paths of the project.

Simpler option is, if you use a terminal editor, is to just run the whole editor remotely through SSH.

@pr2502 pr2502 added the question Further information is needed label Jul 25, 2024
@Tweoss
Copy link

Tweoss commented Aug 30, 2024

@eval-exec
This is a bit late, but I hope it is helpful. I've tried this approach out since I use a terminal editor (helix) and preferred running it locally for low latency and running the LSP on the server.

You can indeed forward the TCP socket through SSH with the -L 27631:127.0.0.1:27631 option. As @pr2502 mentioned, you need to match the absolute paths. In my case, I symlinked the real project on the server to match my paths locally: ln -s /home/fc/project /Users/fc/repos/project. You would also need to ensure the files on the server stay up to date: it appears rust-analyzer sometimes needs the files on disk. I achieved this with watchman running rsync to the server on every local file save.

You can also set SSH connections to be reused for faster rsync's:

host *
  ControlMaster auto
  ControlPath ~/.ssh/ssh_mux_%h_%p_%r

With this, the sync's were low latency enough for rust-analyzer to not complain. I tried virtual file systems (sshfs, catfs) previously but they were too slow for just listing files in helix.

@eval-exec
Copy link
Author

You can also set SSH connections to be reused for faster rsync's:

host *
  ControlMaster auto
  ControlPath ~/.ssh/ssh_mux_%h_%p_%r

Thank you, it helped me a lot.

@eval-exec
Copy link
Author

eval-exec commented Aug 30, 2024

I want to create a Docker container to run on a remote server. In the Docker container, I need the container's absolute paths to mirror the paths on my local machine.

For example:
On my laptop: /home/eval-exec/work/project
On the server: /home/server/work/project
I want to mount the Docker container's path like -v /home/server/work/project:/home/eval-exec/work/project.

When I launch ra-multiplex in the Docker container, it should see the same paths inside the container as on my laptop.

@pr2502, if you’re interested, I’d like to submit a Dockerfile PR for ra-multiplex.

Repository owner locked and limited conversation to collaborators Oct 19, 2024
@pr2502 pr2502 converted this issue into discussion #81 Oct 19, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Further information is needed
Projects
None yet
Development

No branches or pull requests

3 participants