Skip to content

Commit 4d4269d

Browse files
committed
Add a project argument to addprocs(::SSHManager)
This is necessary since DistributedNext isn't in the default sysimage like Distributed is.
1 parent 1c5a325 commit 4d4269d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/managers.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ addprocs([
7878
7979
**Keyword arguments**:
8080
81+
* `project`: the Julia project to activate on the remote node. This *must* have
82+
`DistributedNext` installed to work. Defaults to the currently active project
83+
on the local node.
84+
8185
* `tunnel`: if `true` then SSH tunneling will be used to connect to the worker from the
8286
master process. Default is `false`.
8387
@@ -171,7 +175,8 @@ default_addprocs_params(::SSHManager) =
171175
:env => [],
172176
:tunnel => false,
173177
:multiplex => false,
174-
:max_parallel => 10))
178+
:max_parallel => 10,
179+
:project => Base.current_project()))
175180

176181
function launch(manager::SSHManager, params::Dict, launched::Array, launch_ntfy::Condition)
177182
# Launch one worker on each unique host in parallel. Additional workers are launched later.
@@ -238,8 +243,11 @@ function launch_on_machine(manager::SSHManager, machine::AbstractString, cnt, pa
238243
tunnel = params[:tunnel]
239244
multiplex = params[:multiplex]
240245
cmdline_cookie = params[:cmdline_cookie]
246+
project = params[:project]
241247
env = Dict{String,String}(params[:env])
242248

249+
exeflags = `--project=$project $exeflags`
250+
243251
# machine could be of the format [user@]host[:port] bind_addr[:bind_port]
244252
# machine format string is split on whitespace
245253
machine_bind = split(machine)

0 commit comments

Comments
 (0)