-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Update ElasticManager constructor auto IP config #190
Conversation
As I said in the issue, I'm definitely in favor of this. Presumably anyone in a restrictive with enough environment that they can't update Julia also isn't going to be updating this package to take advantage of this change. If there are no objections, I'll merge at the end of the week (please feel free to bump if/when I forget) |
Just realized that I should also have updated the |
Done. |
btw regarding the interface issue, I think Julia needs to fix this: |
@Moelf Does that affect whether or not to merge this, or just an upstream fix that would make this unnecessary? |
this PR uses |
I'm trying to understand the linked issue, but it doesn't seem like I'm running any systems/configurations susceptible to it. The prior solution was a |
I don't mind merging this PR |
@kescobo I'm good with moving forward on the merge if no one else objects. |
Ref discussion at #189
This PR updates the
ElasticManager
constructor to enable support for automatic IP address detection on Windows (and potentially other platforms that aren't macOS or Linux). Prior to this change, a customget_private_ip()
function is used to detect the platform and execute systemcmd
s to look for the machine's IP address. These changes obsolete that function in favor of a call toSockets.getipaddr()
, a utility that was not available until the v1.2 release of Julia.It's possible for
Sockets.getipaddr()
to throw an error if no network interfaces are detected, so I've implemented atry-catch
to generate a helpful error message, suggesting the IP address be specified manually. This message is largely derived from the priorget_private_ip()
error message.I tested this modified branch on an up-to-date Windows 11 machine and verified that it correctly resolved the local IP address with
addr=:auto
, where the prior version would simply throw an error that the feature is only supported on Mac/Linux. I've also tested it on an up-to-date Mac Mini M1 and it also correctly identified the local IP address and seems to work fine.Pros:
ElasticManager
s automatic IP address option in Windows and possibly other platforms that Julia supports.cmd
s and parsing the returns.Cons:
compat
minimum for ClusterManagers.jl to be bumped from1
to at least1.2
.