From a8796c32d2577a3c59841146ea5e648002f095ce Mon Sep 17 00:00:00 2001 From: Nick Robinson Date: Fri, 24 Jan 2025 09:54:51 +0000 Subject: [PATCH 1/2] Export `remotecall_eval` --- docs/src/_changelog.md | 3 +++ docs/src/index.md | 1 + src/DistributedNext.jl | 1 + 3 files changed, 5 insertions(+) diff --git a/docs/src/_changelog.md b/docs/src/_changelog.md index 3ef0590..cfb877e 100644 --- a/docs/src/_changelog.md +++ b/docs/src/_changelog.md @@ -23,6 +23,9 @@ This documents notable changes in DistributedNext.jl. The format is based on - [`other_workers()`](@ref) and [`other_procs()`](@ref) were implemented and exported ([#18]). +### Changed +- [`remotecall_eval`](@ref) is now exported ([#23]). + ## [v1.0.0] - 2024-12-02 ### Fixed diff --git a/docs/src/index.md b/docs/src/index.md index 41fba38..64af89d 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -23,6 +23,7 @@ DistributedNext.fetch(::RemoteChannel) DistributedNext.remotecall(::Any, ::Integer, ::Any...) DistributedNext.remotecall_wait(::Any, ::Integer, ::Any...) DistributedNext.remotecall_fetch(::Any, ::Integer, ::Any...) +DistributedNext.remotecall_eval DistributedNext.remote_do(::Any, ::Integer, ::Any...) DistributedNext.put!(::RemoteChannel, ::Any...) DistributedNext.put!(::DistributedNext.Future, ::Any) diff --git a/src/DistributedNext.jl b/src/DistributedNext.jl index a9cb4cf..113679b 100644 --- a/src/DistributedNext.jl +++ b/src/DistributedNext.jl @@ -51,6 +51,7 @@ export other_procs, remote, remotecall, + remotecall_eval, remotecall_fetch, remotecall_wait, remote_do, From 6ac243dd317489f57fe6cec283c4fd202cbf97aa Mon Sep 17 00:00:00 2001 From: JamesWrigley Date: Fri, 24 Jan 2025 17:56:36 +0100 Subject: [PATCH 2/2] Ensure that free ports are used in the SSHManager tests --- test/sshmanager.jl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/test/sshmanager.jl b/test/sshmanager.jl index 956dd87..861cce0 100644 --- a/test/sshmanager.jl +++ b/test/sshmanager.jl @@ -1,6 +1,6 @@ using Test using DistributedNext -import Sockets: getipaddr +import Sockets: getipaddr, listenany import LibSSH as ssh import LibSSH.Demo: DemoServer @@ -26,8 +26,11 @@ function test_n_remove_pids(new_pids) end @testset "SSHManager" begin - DemoServer(2222; auth_methods=[ssh.AuthMethod_None], allow_auth_none=true, verbose=false, timeout=3600) do - sshflags = `-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR -p 2222 ` + ssh_port, server = listenany(2222) + close(server) + + DemoServer(Int(ssh_port); auth_methods=[ssh.AuthMethod_None], allow_auth_none=true, verbose=false, timeout=3600) do + sshflags = `-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR -p $(ssh_port)` #Issue #9951 hosts=[] localhost_aliases = ["localhost", string(getipaddr()), "127.0.0.1"] @@ -66,7 +69,7 @@ end print("\nssh addprocs with tunnel (SSH multiplexing)\n") new_pids = addprocs_with_testenv([("localhost", num_workers)]; tunnel=true, multiplex=true, sshflags=sshflags) @test length(new_pids) == num_workers - controlpath = joinpath(ssh_dir, "julia-$(ENV["USER"])@localhost:2222") + controlpath = joinpath(ssh_dir, "julia-$(ENV["USER"])@localhost:$(ssh_port)") @test issocket(controlpath) test_n_remove_pids(new_pids) @test :ok == timedwait(()->!issocket(controlpath), 10.0; pollint=0.5) @@ -82,9 +85,11 @@ end h1 = "localhost" user = ENV["USER"] h2 = "$user@$h1" - h3 = "$h2:2222" + h3 = "$h2:$(ssh_port)" h4 = "$h3 $(string(getipaddr()))" - h5 = "$h4:9300" + (bind_port, server) = listenany(9300) + close(server) + h5 = "$h4:$(bind_port)" new_pids = addprocs_with_testenv([h1, h2, h3, h4, h5]; sshflags=sshflags) @test length(new_pids) == 5