Closed Moelf closed 1 year ago
as an example and for posterity:
julia> using ClusterManagers, Distributed
julia> addprocs(HTCManager(1); exeflags = `-e 'include("/home/jiling/.julia-htc/init.jl")'`)
content of init.jl
:
using Sockets
import Sockets: getipaddr
function getipaddr(addr_type::Type{T}) where T<:IPAddr
addrs = getipaddrs(addr_type)
if length(addrs) == 0
error("No networking interface available")
end
# Prefer the first IPv4 address, non private
i = something(findfirst(ip -> ip isa IPv4 && !startswith(string(ip), "192.168")
, addrs), 1)
return addrs[i]
end
last time I think @tanmaykm looked at Condor related stuff
I'm OK to merge this and add it to a release with #183
Bug fix:
listenany
doesn't guarantee the port number, so we should use theportnum
returnedisnull
doesn't existImprovement:
--worker = <cookie>
, we manually callstart_worker(<cookie>)
such that user can use-e "..."
to pre-execute stuff. In my case, I want to patchSockets.getipaddr()
such that it skips internal private IP range.This is possible because Julia stacks multiple
-e
command line optionsThis PR doesn't have impact on any other backend and is backward compatible for Condor