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 it possible to call a remote julia REPL via TRAMP? #61

Open
aramirezreyes opened this issue Jun 4, 2019 · 13 comments
Open

Is it possible to call a remote julia REPL via TRAMP? #61

aramirezreyes opened this issue Jun 4, 2019 · 13 comments

Comments

@aramirezreyes
Copy link

Hi!

I'm not sure if this is supported but I think it is not.
I would like to have the option to call a remote julia via TRAMP (or not), something like:

(setq julia-repl-executable-records
      '((default "julia")                  ; in the executable path
        (master "/ssh:remotehost:~/bin/julia"))) ; in the remote host.

Is this possible? Super hard to implement?

@aramirezreyes aramirezreyes changed the title Is it possible to call a remote executable via TRAMP? Is it possible to call a remote julia REPL via TRAMP? Jun 12, 2019
@gdkrmr
Copy link

gdkrmr commented Aug 2, 2019

ess has a really cool functionality called ess-remote which basically turns any process buffer into an ess session. I.e. you can start your R process however you like (via ssh or some other complex setup) and call remote-ess on the buffer.

@wraith1995
Copy link
Contributor

@aramirezreyes I tried this and it doesn't work. However, looking at something like tramp-termp.el,, I get the sense that it might not be that hard to implement. I might want this feature someday so I might take a stab at it if no one else does.

@atteson
Copy link

atteson commented Mar 24, 2020

I'd love to see this. Motivated by your tramp-term comment, I've experimented with the following:

(make-term "test" "ssh" nil "user@host" "julia")

which brings up a responsive julia process but there are issues:

  1. julia doesn't seem to provide input prompts, even when passed the interactive option. This happens running from a directly not within emacs as well.
  2. The colors don't appear. Again, this persists even if I pass the color option to julia.

@tpapp
Copy link
Owner

tpapp commented Mar 24, 2020

Sorry I somehow missed this issue. I will look into it, it should be possible via ssh.

@atteson
Copy link

atteson commented Mar 24, 2020

The solution, thanks to tkluck on another thread I posted about fixing the issue for ssh, is to use the "-t" option. This works well:

(make-term "test" "ssh" nil "-t" "user@hostname" "julia")

I'm going to wrap that in some simple clothes use it for now.

@arjunv27
Copy link

Running in a docker container with:

(make-term "julia" "docker" nil "exec" "-it" "ijulia" "julia")

@tpapp
Copy link
Owner

tpapp commented Jun 7, 2020

I find that specifying an executable as

ssh -t host /path/to/julia

works fine.

I am leaving this issue open so that I don't forget adding it to the README.

@dwinkler1
Copy link

I think I am misunderstanding the last comment. Assume valid user me at remote host myhost. I am doing the following:

(use-package julia-repl
:ensure t
:init (require 'julia-repl)
:config
 ; for remote repl:
 ; ssh -t host /path/to/julia

 (setq julia-repl-executable-records
 '(
 (default "julia")                  ; in the executable path
 (remote "ssh -t me@myhost /usr/bin/julia")))
)

now I open a julia file, select remote via C-c C-v and try to execute a line and get the following error:

Process julia-remote exited abnormally with code 127
..: 1: [: ssh: unexpected operator
..: 1: exec: ssh -t me@myhost /usr/bin/julia: not found

And the *Warnings* buffer shows this:

Warning (emacs): could not capture basedir for Julia executable ssh -t me@myhost /usr/bin/julia

Just pasting the ssh command in a terminal works. Any ideas what I am doing wrong?

@dwinkler1
Copy link

I hacked something together that works for me at least. Maybe it is helpful to others:

(defun remotejl ()
(interactive)
(make-term "julia-ssh" "ssh" nil "-t" "me@myhost" "julia")
(funcall-interactively 'julia-repl-prompt-set-inferior-buffer-name-suffix '(ssh))
)

@solna86
Copy link

solna86 commented Jul 29, 2023

I am leaving this issue open so that I don't forget adding it to the README.

It would be nice to document this workflow on the README, @tpapp.

Perhaps it would also be possible to let users start an ansi-term or a vterm, ssh to a remote machine, start julia (all manually), and then turn this into a julia-repl?

@tpapp
Copy link
Owner

tpapp commented Jul 30, 2023

PRs to the docs (README) are welcome.

@solna86
Copy link

solna86 commented Jul 30, 2023

PRs to the docs (README) are welcome.

I have not been able to get this working smoothly, but if anyone can lend me a hand, I am happy to summarize everything as a PR for the README.

@Sbozzolo
Copy link

Sbozzolo commented Oct 25, 2023

A quick workaround for the vterm backend: (setq vterm-tramp-shells '(("ssh" "julia"))).

A better solution would be to extend the julia-repl--make-buffer to locally bind vterm-tramp-shell to the correct value for the correct TRAMP method.

(One would also have to strip the paths from the ssh:XXX part when activating envs, sending paths)

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

9 participants