Re: Review Request 36425: Enabling IP Discovery script

2015-07-24 Thread Benjamin Hindman

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review92972
---

Ship it!


I took care of these minor issues and also added a comment to replace update 
'os::shell' as per discussion on 
https://issues.apache.org/jira/browse/MESOS-3142.


docs/configuration.md (line 91)


Still would like to call this 'ip_discovery_command', to signify that we're 
executing a command which may or may not be a script. If we wanted this to be a 
path to a script we should have made the flag type be Path.



src/master/main.cpp (line 21)


Not needed any more! (No more popen.)


- Benjamin Hindman


On July 22, 2015, 7:39 a.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 22, 2015, 7:39 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will conflict with the --ip flag, so if both set, we will fail
> with an appropriate error message.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md babbd2f67b32d4f317cfdf8bb87f8725917b0aca 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> also tested against a couple of simple scripts that emulate the three 
> possible cases: a valid IP; a bogus one; an error exit code.
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-22 Thread Benjamin Mahler
https://issues.apache.org/jira/browse/MESOS-2902 says this will be done in
a module instead?

Do we still need this review?

On Wed, Jul 22, 2015 at 3:31 AM, Mesos ReviewBot 
wrote:

>
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/#review92572
> ---
>
>
> Patch looks great!
>
> Reviews applied: [36424, 36425]
>
> All tests passed.
>
> - Mesos ReviewBot
>
>
> On July 22, 2015, 7:39 a.m., Marco Massenzio wrote:
> >
> > ---
> > This is an automatically generated e-mail. To reply, visit:
> > https://reviews.apache.org/r/36425/
> > ---
> >
> > (Updated July 22, 2015, 7:39 a.m.)
> >
> >
> > Review request for mesos, Benjamin Hindman and Cody Maloney.
> >
> >
> > Bugs: MESOS-2902
> > https://issues.apache.org/jira/browse/MESOS-2902
> >
> >
> > Repository: mesos
> >
> >
> > Description
> > ---
> >
> > Jira: MESOS-2902
> >
> > It is sometimes useful to enable an external script to
> > configure the IP address the Mesos Master will bind to
> > on the server, where it's not desirable to set the
> > --ip flag and/or a "wrapper" script is not a viable option.
> >
> > This patch adds a --ip_discovery_script to point to a local
> > script that will emit as its only output the IP address that
> > the Master will bind to: only spaces and newlines are allowed;
> > further, as we cannot use the `libprocess` sub-processing
> > facilities, we cannot timeout the script, should this block
> > for long times (or even forever).
> >
> > This will conflict with the --ip flag, so if both set, we will fail
> > with an appropriate error message.
> >
> >
> > Diffs
> > -
> >
> >   docs/configuration.md babbd2f67b32d4f317cfdf8bb87f8725917b0aca
> >   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1
> >
> > Diff: https://reviews.apache.org/r/36425/diff/
> >
> >
> > Testing
> > ---
> >
> > make check
> >
> > also tested against a couple of simple scripts that emulate the three
> possible cases: a valid IP; a bogus one; an error exit code.
> >
> >
> > Thanks,
> >
> > Marco Massenzio
> >
> >
>
>


Re: Review Request 36425: Enabling IP Discovery script

2015-07-22 Thread Mesos ReviewBot

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review92572
---


Patch looks great!

Reviews applied: [36424, 36425]

All tests passed.

- Mesos ReviewBot


On July 22, 2015, 7:39 a.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 22, 2015, 7:39 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will conflict with the --ip flag, so if both set, we will fail
> with an appropriate error message.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md babbd2f67b32d4f317cfdf8bb87f8725917b0aca 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> also tested against a couple of simple scripts that emulate the three 
> possible cases: a valid IP; a bogus one; an error exit code.
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-22 Thread Marco Massenzio

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/
---

(Updated July 22, 2015, 7:39 a.m.)


Review request for mesos, Benjamin Hindman and Cody Maloney.


Changes
---

Updated to configuration doc


Bugs: MESOS-2902
https://issues.apache.org/jira/browse/MESOS-2902


Repository: mesos


Description
---

Jira: MESOS-2902

It is sometimes useful to enable an external script to
configure the IP address the Mesos Master will bind to
on the server, where it's not desirable to set the
--ip flag and/or a "wrapper" script is not a viable option.

This patch adds a --ip_discovery_script to point to a local
script that will emit as its only output the IP address that
the Master will bind to: only spaces and newlines are allowed;
further, as we cannot use the `libprocess` sub-processing
facilities, we cannot timeout the script, should this block
for long times (or even forever).

This will conflict with the --ip flag, so if both set, we will fail
with an appropriate error message.


Diffs (updated)
-

  docs/configuration.md babbd2f67b32d4f317cfdf8bb87f8725917b0aca 
  src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 

Diff: https://reviews.apache.org/r/36425/diff/


Testing
---

make check

also tested against a couple of simple scripts that emulate the three possible 
cases: a valid IP; a bogus one; an error exit code.


Thanks,

Marco Massenzio



Re: Review Request 36425: Enabling IP Discovery script

2015-07-22 Thread Marco Massenzio

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/
---

(Updated July 22, 2015, 7:33 a.m.)


Review request for mesos, Benjamin Hindman and Cody Maloney.


Bugs: MESOS-2902
https://issues.apache.org/jira/browse/MESOS-2902


Repository: mesos


Description (updated)
---

Jira: MESOS-2902

It is sometimes useful to enable an external script to
configure the IP address the Mesos Master will bind to
on the server, where it's not desirable to set the
--ip flag and/or a "wrapper" script is not a viable option.

This patch adds a --ip_discovery_script to point to a local
script that will emit as its only output the IP address that
the Master will bind to: only spaces and newlines are allowed;
further, as we cannot use the `libprocess` sub-processing
facilities, we cannot timeout the script, should this block
for long times (or even forever).

This will conflict with the --ip flag, so if both set, we will fail
with an appropriate error message.


Diffs
-

  docs/configuration.md babbd2f67b32d4f317cfdf8bb87f8725917b0aca 
  src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 

Diff: https://reviews.apache.org/r/36425/diff/


Testing (updated)
---

make check

also tested against a couple of simple scripts that emulate the three possible 
cases: a valid IP; a bogus one; an error exit code.


Thanks,

Marco Massenzio



Re: Review Request 36425: Enabling IP Discovery script

2015-07-21 Thread Mesos ReviewBot

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review92445
---


Patch looks great!

Reviews applied: [36424, 36425]

All tests passed.

- Mesos ReviewBot


On July 21, 2015, 4:47 p.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 21, 2015, 4:47 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will override the --ip flag, which, even if set, will be
> ignored.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md babbd2f67b32d4f317cfdf8bb87f8725917b0aca 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-21 Thread Marco Massenzio

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/
---

(Updated July 21, 2015, 4:47 p.m.)


Review request for mesos, Benjamin Hindman and Cody Maloney.


Changes
---

Addressed Ben's comments.


Bugs: MESOS-2902
https://issues.apache.org/jira/browse/MESOS-2902


Repository: mesos


Description
---

Jira: MESOS-2902

It is sometimes useful to enable an external script to
configure the IP address the Mesos Master will bind to
on the server, where it's not desirable to set the
--ip flag and/or a "wrapper" script is not a viable option.

This patch adds a --ip_discovery_script to point to a local
script that will emit as its only output the IP address that
the Master will bind to: only spaces and newlines are allowed;
further, as we cannot use the `libprocess` sub-processing
facilities, we cannot timeout the script, should this block
for long times (or even forever).

This will override the --ip flag, which, even if set, will be
ignored.


Diffs (updated)
-

  docs/configuration.md babbd2f67b32d4f317cfdf8bb87f8725917b0aca 
  src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 

Diff: https://reviews.apache.org/r/36425/diff/


Testing
---

make check


Thanks,

Marco Massenzio



Re: Review Request 36425: Enabling IP Discovery script

2015-07-21 Thread Marco Massenzio


> On July 19, 2015, 8:09 p.m., Benjamin Hindman wrote:
> > src/master/main.cpp, line 139
> > 
> >
> > We've tried to name our flags the same as how you'd see them on the 
> > command line, so s/ipDiscoveryScript/ip_discovery_script/ here please.
> > 
> > Also, what about s/script/command/ here? Since we might not be 
> > executing a script here and it's more inline with the fact that we'll be 
> > executing this via the shell (i.e., it's a shell command, as opposed to say 
> > doing s/script/executable/ which might imply we're going to fork/exec).

I'd actually asked about this to Nik - so long as we're clear that we're 
breaking the style guide here, I guess it's ok.
There's also no good reason for it (apart from "tradition"? or "consistency"?) 
as we could have the default "snake_to_camelCase" convention for flags.

http://despair.com/collections/demotivators/products/consistency


> On July 19, 2015, 8:09 p.m., Benjamin Hindman wrote:
> > src/master/main.cpp, lines 181-209
> > 
> >
> > Apologies for not giving you this feedback sooner, but we already have 
> > a wrapper for `popen` with `os::shell`. It's used a handful of places in 
> > the code instead of `popen`:
> > 
> > ostringstream out;
> > 
> > Try status = os::shell(&out, ip_discovery_script.get());
> > 
> > if (status.isError()) {
> >   EXIT(EXIT_FAILURE) << ...;
> > } else if (WIFSIGNALED(status.get())) {
> >   EXIT(EXIT_FAILURE) << ... << strsignal(WTERMSIG(status.get()));
> > } else if (WEXITSTATUS(status.get()) != EXIT_SUCCESS) {
> >   EXIT(EXIT_FAILURE) << ... << stringify
> >   (WEXITSTATUS(status.get()));
> > }
> > 
> > const string ipAddress = strings::trim(out.get());
> > 
> > LOG(INFO) << ...;
> > 
> > os::setenv("LIBPROCESS_IP", ipAddress);

LoL - no one seemed to know about it :) I asked in the 'core' slack and was 
pointed to at least five different ways of doing this.
Thanks!


> On July 19, 2015, 8:09 p.m., Benjamin Hindman wrote:
> > src/master/main.cpp, line 184
> > 
> >
> > What is process::executeCommand? Did you mean process::subprocess here?

it's the method I'm introducing in the patch immediately before this: 
https://reviews.apache.org/r/36424/


- Marco


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review92219
---


On July 13, 2015, 9:35 p.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 13, 2015, 9:35 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will override the --ip flag, which, even if set, will be
> ignored.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-19 Thread Benjamin Hindman

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review92219
---



src/master/main.cpp (line 139)


We've tried to name our flags the same as how you'd see them on the command 
line, so s/ipDiscoveryScript/ip_discovery_script/ here please.

Also, what about s/script/command/ here? Since we might not be executing a 
script here and it's more inline with the fact that we'll be executing this via 
the shell (i.e., it's a shell command, as opposed to say doing 
s/script/executable/ which might imply we're going to fork/exec).



src/master/main.cpp (line 144)


Rather than overriding the setting any reason not to error out to be more 
friendly to an operator? Seems like this would save someone some time debugging 
in the future and would be as simple as:

if (ip.isSome() && ip_discovery_script.isSome()) {
  // Print nice error message and maybe usage and exit.
}



src/master/main.cpp (lines 181 - 209)


Apologies for not giving you this feedback sooner, but we already have a 
wrapper for `popen` with `os::shell`. It's used a handful of places in the code 
instead of `popen`:

ostringstream out;

Try status = os::shell(&out, ip_discovery_script.get());

if (status.isError()) {
  EXIT(EXIT_FAILURE) << ...;
} else if (WIFSIGNALED(status.get())) {
  EXIT(EXIT_FAILURE) << ... << strsignal(WTERMSIG(status.get()));
} else if (WEXITSTATUS(status.get()) != EXIT_SUCCESS) {
  EXIT(EXIT_FAILURE) << ... << stringify
  (WEXITSTATUS(status.get()));
}

const string ipAddress = strings::trim(out.get());

LOG(INFO) << ...;

os::setenv("LIBPROCESS_IP", ipAddress);



src/master/main.cpp (line 184)


What is process::executeCommand? Did you mean process::subprocess here?



src/master/main.cpp (line 208)


We've tried to consistently wrap things like IPs in single quotes in string 
messages.


- Benjamin Hindman


On July 13, 2015, 9:35 p.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 13, 2015, 9:35 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will override the --ip flag, which, even if set, will be
> ignored.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-13 Thread Mesos ReviewBot

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review91550
---


Patch looks great!

Reviews applied: [36424, 36425]

All tests passed.

- Mesos ReviewBot


On July 13, 2015, 9:35 p.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 13, 2015, 9:35 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will override the --ip flag, which, even if set, will be
> ignored.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-13 Thread Cody Maloney


> On July 13, 2015, 9:12 p.m., Cody Maloney wrote:
> > Generally looks reasonable to me. I haven't integration tested yet inside 
> > DCOS, will work on that before too long.
> 
> Marco Massenzio wrote:
> > reasonable
> 
> not exactly a ringing endorsement :) but I guess I'll take it...
> care to give me a Ship it?

Ship It comes post integration test. I still dislike the fopen() api a lot, but 
that one isn't your fault.


- Cody


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review91518
---


On July 13, 2015, 9:35 p.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 13, 2015, 9:35 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will override the --ip flag, which, even if set, will be
> ignored.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-13 Thread Marco Massenzio

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/
---

(Updated July 13, 2015, 9:35 p.m.)


Review request for mesos, Benjamin Hindman and Cody Maloney.


Changes
---

Updated help string for the flag.


Bugs: MESOS-2902
https://issues.apache.org/jira/browse/MESOS-2902


Repository: mesos


Description
---

Jira: MESOS-2902

It is sometimes useful to enable an external script to
configure the IP address the Mesos Master will bind to
on the server, where it's not desirable to set the
--ip flag and/or a "wrapper" script is not a viable option.

This patch adds a --ip_discovery_script to point to a local
script that will emit as its only output the IP address that
the Master will bind to: only spaces and newlines are allowed;
further, as we cannot use the `libprocess` sub-processing
facilities, we cannot timeout the script, should this block
for long times (or even forever).

This will override the --ip flag, which, even if set, will be
ignored.


Diffs (updated)
-

  docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
  src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 

Diff: https://reviews.apache.org/r/36425/diff/


Testing
---

make check


Thanks,

Marco Massenzio



Re: Review Request 36425: Enabling IP Discovery script

2015-07-13 Thread Marco Massenzio


> On July 13, 2015, 9:12 p.m., Cody Maloney wrote:
> > Generally looks reasonable to me. I haven't integration tested yet inside 
> > DCOS, will work on that before too long.

> reasonable

not exactly a ringing endorsement :) but I guess I'll take it...
care to give me a Ship it?


> On July 13, 2015, 9:12 p.m., Cody Maloney wrote:
> > docs/configuration.md, line 101
> > 
> >
> > nit: I don't like string here

You're right.
Changed to (both in the .md doc and the flag help string):
```
  "Optional IP discovery binary: if set, it is expected to emit\n"
  "the IP address which Master will try to bind to.\n"
  "Overrides the setting in --ip."
```


- Marco


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review91518
---


On July 13, 2015, 7:25 p.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 13, 2015, 7:25 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will override the --ip flag, which, even if set, will be
> ignored.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-13 Thread Cody Maloney

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review91518
---


Generally looks reasonable to me. I haven't integration tested yet inside DCOS, 
will work on that before too long.


docs/configuration.md (line 101)


nit: I don't like string here


- Cody Maloney


On July 13, 2015, 7:25 p.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 13, 2015, 7:25 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will override the --ip flag, which, even if set, will be
> ignored.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-13 Thread Cody Maloney


> On July 13, 2015, 6:14 p.m., Anand Mazumdar wrote:
> > src/master/main.cpp, line 211
> > 
> >
> > Can we remove the reference here ? 
> > 
> > strings::trim(...) returns a temporary that would be destroyed at the 
> > end of the line leaving you with a dangling reference.

Not actually a dangling reference since the C++ spec actually specifies the 
value lives as long as  the reference in this case. But it is against the style 
guide. See http://mesos.apache.org/documentation/latest/mesos-c++-style-guide/ 
section "Capture by Reference"


- Cody


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review91496
---


On July 13, 2015, 7:25 p.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 13, 2015, 7:25 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will override the --ip flag, which, even if set, will be
> ignored.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-13 Thread Mesos ReviewBot

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review91513
---


Patch looks great!

Reviews applied: [36424, 36425]

All tests passed.

- Mesos ReviewBot


On July 13, 2015, 7:25 p.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 13, 2015, 7:25 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will override the --ip flag, which, even if set, will be
> ignored.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-13 Thread Marco Massenzio

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/
---

(Updated July 13, 2015, 7:25 p.m.)


Review request for mesos, Benjamin Hindman and Cody Maloney.


Bugs: MESOS-2902
https://issues.apache.org/jira/browse/MESOS-2902


Repository: mesos


Description
---

Jira: MESOS-2902

It is sometimes useful to enable an external script to
configure the IP address the Mesos Master will bind to
on the server, where it's not desirable to set the
--ip flag and/or a "wrapper" script is not a viable option.

This patch adds a --ip_discovery_script to point to a local
script that will emit as its only output the IP address that
the Master will bind to: only spaces and newlines are allowed;
further, as we cannot use the `libprocess` sub-processing
facilities, we cannot timeout the script, should this block
for long times (or even forever).

This will override the --ip flag, which, even if set, will be
ignored.


Diffs (updated)
-

  docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
  src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 

Diff: https://reviews.apache.org/r/36425/diff/


Testing
---

make check


Thanks,

Marco Massenzio



Re: Review Request 36425: Enabling IP Discovery script

2015-07-13 Thread Marco Massenzio


> On July 13, 2015, 6:14 p.m., Anand Mazumdar wrote:
> > a few fly-by general comments.

thanks!


> On July 13, 2015, 6:14 p.m., Anand Mazumdar wrote:
> > src/master/main.cpp, line 205
> > 
> >
> > Can we align this similar to the one you have already done a few lines 
> > before ?

because of the way this gets indented (which was, in fact, my initial approach) 
it looks really horrible (also, it does the `jagged` look we so dread :) )
This way is much more pleasing on the eye, whilst not impacting at all on 
readability (IMO).


> On July 13, 2015, 6:14 p.m., Anand Mazumdar wrote:
> > src/master/main.cpp, line 209
> > 
> >
> > Can we use our already existing abstraction stringify(...) here or did 
> > it not work here ?

mah - this is the "standard" way of doing it (I think our `stringify` was 
necessary prior to C++11 and `std::to_string()`, but I may be wrong here).
anyways - changed to stringify().


- Marco


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review91496
---


On July 13, 2015, 4:35 p.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 13, 2015, 4:35 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will override the --ip flag, which, even if set, will be
> ignored.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-13 Thread Marco Massenzio


> On July 13, 2015, 5:46 p.m., Cody Maloney wrote:
> > src/master/main.cpp, line 35
> > 
> >
> > unused include

how did you find out?
(I really miss IntelliJ highlighting that for me in Java...)


> On July 13, 2015, 5:46 p.m., Cody Maloney wrote:
> > src/master/main.cpp, line 148
> > 
> >
> > Supersedes -> Overrides like you did in the docs?

yes - fixed.


> On July 13, 2015, 5:46 p.m., Cody Maloney wrote:
> > src/master/main.cpp, line 211
> > 
> >
> > Could you add a basic "Can we change this discoveredIp -> an actual IP 
> > address" check here?  The error message when LIBPROCESS_IP ends up 
> > incorrect inside libprocess is going to not say very cleanly where that 
> > value came from, and I suspect when doing iteration it will be fairly 
> > common for people to write IP scripts which give incorrect / invalid output.

This is what happens when you give a non-parseable IP:
```
$ ./bin/mesos-master.sh --ip_discovery_script=~/discovery-ip.py --work_dir=/tmp
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0713 12:12:52.721210 1955922688 main.cpp:185] Discovering Master server IP 
using ~/discovery-ip.py
I0713 12:12:52.741296 1955922688 main.cpp:211] Setting IP for Mesos Master to: 
[10.0.77.243/24]
F0713 12:12:52.741581 1955922688 process.cpp:861] Parsing 
LIBPROCESS_IP=10.0.77.243/24 failed: Failed to parse the IP
*** Check failure stack trace: ***
Abort trap: 6
```
and, if things go catastophically off the rails:
```
$ ./bin/mesos-master.sh --ip_discovery_script=~/discovery-ip.py --work_dir=/tmp
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0713 12:15:07.231408 1955922688 main.cpp:185] Discovering Master server IP 
using ~/discovery-ip.py
I0713 12:15:07.251881 1955922688 main.cpp:211] Setting IP for Mesos Master to: 
[mesos-master.rack-101.az12.comcast.wp.com]
F0713 12:15:07.252142 1955922688 process.cpp:861] Parsing 
LIBPROCESS_IP=mesos-master.rack-101.az12.comcast.wp.com failed: Failed to parse 
the IP
*** Check failure stack trace: ***
Abort trap: 6
```
Looks pretty clear to me what went on?


- Marco


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review91492
---


On July 13, 2015, 4:35 p.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 13, 2015, 4:35 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will override the --ip flag, which, even if set, will be
> ignored.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-13 Thread Anand Mazumdar

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review91496
---


a few fly-by general comments.


src/master/main.cpp (line 93)


We can get rid of this , I don' think this is being used ?



src/master/main.cpp (line 191)


s/fopen/popen



src/master/main.cpp (line 205)


Can we align this similar to the one you have already done a few lines 
before ?



src/master/main.cpp (line 209)


Can we use our already existing abstraction stringify(...) here or did it 
not work here ?



src/master/main.cpp (line 211)


Can we remove the reference here ? 

strings::trim(...) returns a temporary that would be destroyed at the end 
of the line leaving you with a dangling reference.


- Anand Mazumdar


On July 13, 2015, 4:35 p.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 13, 2015, 4:35 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will override the --ip flag, which, even if set, will be
> ignored.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-13 Thread Cody Maloney

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review91492
---



docs/configuration.md (line 92)


Default isn't quite correct here. More accurate is `Mesos will do a lookup 
of the machine's hostname to try and figure out what IP address to use`



src/master/main.cpp (line 22)


Please use  or use the  variants consistently



src/master/main.cpp (line 35)


unused include



src/master/main.cpp (line 39)


unused include



src/master/main.cpp (line 148)


Supersedes -> Overrides like you did in the docs?



src/master/main.cpp (line 211)


Could you add a basic "Can we change this discoveredIp -> an actual IP 
address" check here?  The error message when LIBPROCESS_IP ends up incorrect 
inside libprocess is going to not say very cleanly where that value came from, 
and I suspect when doing iteration it will be fairly common for people to write 
IP scripts which give incorrect / invalid output.


- Cody Maloney


On July 13, 2015, 4:35 p.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 13, 2015, 4:35 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will override the --ip flag, which, even if set, will be
> ignored.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-13 Thread Mesos ReviewBot

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/#review91489
---


Patch looks great!

Reviews applied: [36424, 36425]

All tests passed.

- Mesos ReviewBot


On July 13, 2015, 4:35 p.m., Marco Massenzio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/36425/
> ---
> 
> (Updated July 13, 2015, 4:35 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Cody Maloney.
> 
> 
> Bugs: MESOS-2902
> https://issues.apache.org/jira/browse/MESOS-2902
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Jira: MESOS-2902
> 
> It is sometimes useful to enable an external script to
> configure the IP address the Mesos Master will bind to
> on the server, where it's not desirable to set the
> --ip flag and/or a "wrapper" script is not a viable option.
> 
> This patch adds a --ip_discovery_script to point to a local
> script that will emit as its only output the IP address that
> the Master will bind to: only spaces and newlines are allowed;
> further, as we cannot use the `libprocess` sub-processing
> facilities, we cannot timeout the script, should this block
> for long times (or even forever).
> 
> This will override the --ip flag, which, even if set, will be
> ignored.
> 
> 
> Diffs
> -
> 
>   docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
>   src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 
> 
> Diff: https://reviews.apache.org/r/36425/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> 
> Thanks,
> 
> Marco Massenzio
> 
>



Re: Review Request 36425: Enabling IP Discovery script

2015-07-13 Thread Marco Massenzio

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/36425/
---

(Updated July 13, 2015, 4:35 p.m.)


Review request for mesos, Benjamin Hindman and Cody Maloney.


Bugs: MESOS-2902
https://issues.apache.org/jira/browse/MESOS-2902


Repository: mesos


Description
---

Jira: MESOS-2902

It is sometimes useful to enable an external script to
configure the IP address the Mesos Master will bind to
on the server, where it's not desirable to set the
--ip flag and/or a "wrapper" script is not a viable option.

This patch adds a --ip_discovery_script to point to a local
script that will emit as its only output the IP address that
the Master will bind to: only spaces and newlines are allowed;
further, as we cannot use the `libprocess` sub-processing
facilities, we cannot timeout the script, should this block
for long times (or even forever).

This will override the --ip flag, which, even if set, will be
ignored.


Diffs (updated)
-

  docs/configuration.md feee5594c88112f77ce382cb3dd8628653f92d01 
  src/master/main.cpp fd4de4d0d9c3e9617408022d10b5e161bdc911e1 

Diff: https://reviews.apache.org/r/36425/diff/


Testing
---

make check


Thanks,

Marco Massenzio