Remote Julia Process in Juno

I am trying to set up a remote Julia process in Juno, so I can use a powerful research server instead of a cruddy laptop.

First, I tried to follow the FAQ for Juno. I opened a terminal, SSHed into the server, launched Julia and ran “using Atom; using Juno; Juno.connect([…])”. This seemed like it was working, except then when I tried to run code using ctrl-enter it just sent it to the local version of Julia. So it didn’t actually work.

Second, I tried to use ftp-remote-edit. I configured the server, and connected to it such that I could see my user directory. However, then when I hit ctrl-enter, I get

Remote Julia session could not be started.

We tried to launch Julia from  `julia`  but the process failed with  `127` .

Please make sure your settings are correct.

Also on the local repl I see the following error message:
/bin/sh: 1: julia: not found

Any tips for getting this to work? The ideal workflow would be to automatically launch the remote Julia process when I run my code, but I’ll settle for getting it to work at all at this point.

Thanks

You need to make sure the following setting is correct for the remote machine you’re trying to run Julia on:
image

If you do want to use julia then make sure it’s symlinked and not aliased in your .bashrc or whatever, because, as the error message tells you, we don’t load bash before starting Julia.

2 Likes

Thanks @pfitzseb , it was indeed aliased in .bashrc, so this fixed that.

Code I run locally now proceeds on the remote server, which is great. However, I can’t seem to figure out how to make include statements work for local files- it seems to expect the files are in the home directory of the remote server, yet they are actually local in the same directory as the file I am trying to run. It looks like it is trying to merge local and remote paths. Specifically when it runs include("FMReg.jl") I get:

ERROR: LoadError: could not open file FMReg.jl
Stacktrace:
 [1] include at ./boot.jl:326 [inlined]
 [2] include_relative(::Module, ::String) at ./loading.jl:1038
 [3] include at ./sysimg.jl:29 [inlined]
 [4] include(::String) at ./C:\Users\[...]\Dropbox\Projects\Finometrics\src\Finometrics.jl:1
 [5] top-level scope at none:0
in expression starting at C:\Users\[...]\Dropbox\Projects\Finometrics\src\Finometrics.jl:157

I assume I’m missing something obvious here…

Uh, I’m not sure I understand what you’re trying to do – do you have

  1. a file locally that you’re trying to run on the server, but include looks on the remote instead of local files, or
  2. a remote file into which you can’t include other remote files?

Regardless of the above, note that include is always relative to the path of the current file’s directory (which you can get with @__DIR__), and not relative to pwd().

Sure, I guess I wasn’t clear. I have two local files in the same directory. That is, both the file I am running and the file I am trying to include are local. The Julia instance is remote.

So if I understand correctly what you are saying, wouldn’t include then work relative to the path of the local (“current”) file’s directory? When I run print either pwd() or @__DIR__ from the local file I get /home/.../ as opposed to the local directory.

Right, that’s not a supported use case – the remote Julia session can’t access your local file system, so include etc doesn’t work. Is there any reason not to work with files on the remote file system? That should be fairly painless with ftp-remote-edit.

That sounds wrong. I’m getting
image
in a local file with a remote session

1 Like

I wrote a small function to include remote files
https://github.com/ChrisRackauckas/ParallelDataTransfer.jl/blob/3038cb871d514618d8a8cc5cac4c14dc686cc7ab/src/ParallelDataTransfer.jl#L80
Maybe it could be of some use here

1 Like

Ah, I see. I’m mainly doing it this way so that I can use Git with the atom installation on the local machine. But if it can’t be done, it can’t be done. Since the code is “statically” injected into the main file, I thought it would be possible.

When I run the following in the local file:

println("$(@__DIR__)")
println("$(pwd())")

On the repl I see:

/home/.../
/home/...

which is consistent with the remote directory but not the local directory.

@baggepinnen Thanks. I’m trying to avoid spinning up any local processes at all, but if I understand the method correctly this will work well in the scenario with both local and remote processes.

It might be possible to implement, but it’s definitely not working right now. Feel free to open feature requests/issues here.

1 Like

Done! Thanks for clearing all this up.

This almost works for me. I got a different error:

We tried to launch Julia from ~/julia-1.4.1/bin/julia but the process failed with 1`

Exit code 1 is a generic as it gets: 1 Catchall for general errors

Any idea on how to debug this?

Ok, found the problem my Julia options included a:

-J sys_plots.so

That was not on the remote. Is there a way to set this up separately?