Re: Review Request 45435: Modified scheduler library to properly handle SSL connections.

2016-03-29 Thread Anand Mazumdar

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

(Updated March 30, 2016, 2:03 a.m.)


Review request for mesos, Joseph Wu and Vinod Kone.


Changes
---

Review comments from Joseph


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


Repository: mesos


Description
---

This fixes the scheduler library to properly set the scheme
as `https` if SSL is enabled. If not, default to `http` as
is the case now. Would follow up with a similar change for the 
executor library.


Diffs (updated)
-

  src/scheduler/scheduler.cpp 13972449363b633f21ddec7649b1b170703c773a 

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


Testing
---

make check

Used the command scheduler to verify requests are made via HTTPS. Adding tests 
for this would be handled as part of MESOS-3753.

GLOG_v=1 SSL_CERT_FILE=/home/faceoff/work/mesos-priv/build/cert.pem 
SSL_KEY_FILE=/home/faceoff/work/mesos-priv/build/key.pem SSL_ENABLED=1 
./src/mesos-execute --command="sleep 1" --master=127.0.1.1:5050 --name=task1
Enter PEM pass phrase:
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0329 10:33:02.122915 28647 process.cpp:986] libprocess is initialized on 
127.0.1.1:46244 for 8 cpus
I0329 10:33:02.125663 28663 logging.cpp:195] Logging to STDERR
I0329 10:33:02.125758 28663 scheduler.cpp:172] Version: 0.29.0
I0329 10:33:02.131425 28667 scheduler.cpp:449] New master detected at 
master@127.0.1.1:5050
I0329 10:33:02.168808 28664 scheduler.cpp:338] Connected with the master at 
https://127.0.1.1:5050/master/api/v1/scheduler
I0329 10:33:02.170920 28669 scheduler.cpp:231] Sending SUBSCRIBE call to 
https://127.0.1.1:5050/master/api/v1/scheduler
I0329 10:33:02.225026 28670 scheduler.cpp:640] Enqueuing event SUBSCRIBED 
received from https://127.0.1.1:5050/master/api/v1/scheduler
Subscribed with ID 'c4347d67-05d4-4458-994d-043c25189236-0001
I0329 10:33:02.225764 28663 scheduler.cpp:640] Enqueuing event HEARTBEAT 
received from https://127.0.1.1:5050/master/api/v1/scheduler
I0329 10:33:02.226172 28665 scheduler.cpp:640] Enqueuing event OFFERS received 
from https://127.0.1.1:5050/master/api/v1/scheduler
I0329 10:33:02.226687 28664 resources.cpp:574] Parsing resources as JSON 
failed: cpus:1;mem:128
Trying semicolon-delimited string format instead
task task1 submitted to agent fac82f38-c437-4058-b3e1-ce664070611b-S0
I0329 10:33:02.227926 28670 scheduler.cpp:231] Sending ACCEPT call to 
https://127.0.1.1:5050/master/api/v1/scheduler
I0329 10:33:02.362051 28667 scheduler.cpp:640] Enqueuing event UPDATE received 
from https://127.0.1.1:5050/master/api/v1/scheduler
Received status update TASK_RUNNING for task task1
I0329 10:33:02.362877 28663 scheduler.cpp:231] Sending ACKNOWLEDGE call to 
https://127.0.1.1:5050/master/api/v1/scheduler
I0329 10:33:03.378164 28669 scheduler.cpp:640] Enqueuing event UPDATE received 
from https://127.0.1.1:5050/master/api/v1/scheduler
Received status update TASK_FINISHED for task task1
I0329 10:33:03.379533 28663 scheduler.cpp:231] Sending ACKNOWLEDGE call to 
https://127.0.1.1:5050/master/api/v1/scheduler


Thanks,

Anand Mazumdar



Re: Review Request 45435: Modified scheduler library to properly handle SSL connections.

2016-03-29 Thread Anand Mazumdar


> On March 30, 2016, 12:23 a.m., Joseph Wu wrote:
> > src/scheduler/scheduler.cpp, line 437
> > 
> >
> > This flag is a `bool`, so we accept two forms:
> > "1" and "true".
> > 
> > See: 
> > https://github.com/apache/mesos/blob/master/3rdparty/libprocess/3rdparty/stout/include/stout/flags/parse.hpp#L54
> > 
> > ---
> > 
> > Also, you can compare an Option without checking `.isSome()`.

Fixed.

Also, we can't use an `Option` to directly compare here. Since "1" is basically 
a `const char[2]` and not a `std::string`. Makes sense?


- Anand


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


On March 30, 2016, 2:03 a.m., Anand Mazumdar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45435/
> ---
> 
> (Updated March 30, 2016, 2:03 a.m.)
> 
> 
> Review request for mesos, Joseph Wu and Vinod Kone.
> 
> 
> Bugs: MESOS-3976
> https://issues.apache.org/jira/browse/MESOS-3976
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> This fixes the scheduler library to properly set the scheme
> as `https` if SSL is enabled. If not, default to `http` as
> is the case now. Would follow up with a similar change for the 
> executor library.
> 
> 
> Diffs
> -
> 
>   src/scheduler/scheduler.cpp 13972449363b633f21ddec7649b1b170703c773a 
> 
> Diff: https://reviews.apache.org/r/45435/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> Used the command scheduler to verify requests are made via HTTPS. Adding 
> tests for this would be handled as part of MESOS-3753.
> 
> GLOG_v=1 SSL_CERT_FILE=/home/faceoff/work/mesos-priv/build/cert.pem 
> SSL_KEY_FILE=/home/faceoff/work/mesos-priv/build/key.pem SSL_ENABLED=1 
> ./src/mesos-execute --command="sleep 1" --master=127.0.1.1:5050 --name=task1
> Enter PEM pass phrase:
> WARNING: Logging before InitGoogleLogging() is written to STDERR
> I0329 10:33:02.122915 28647 process.cpp:986] libprocess is initialized on 
> 127.0.1.1:46244 for 8 cpus
> I0329 10:33:02.125663 28663 logging.cpp:195] Logging to STDERR
> I0329 10:33:02.125758 28663 scheduler.cpp:172] Version: 0.29.0
> I0329 10:33:02.131425 28667 scheduler.cpp:449] New master detected at 
> master@127.0.1.1:5050
> I0329 10:33:02.168808 28664 scheduler.cpp:338] Connected with the master at 
> https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:02.170920 28669 scheduler.cpp:231] Sending SUBSCRIBE call to 
> https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:02.225026 28670 scheduler.cpp:640] Enqueuing event SUBSCRIBED 
> received from https://127.0.1.1:5050/master/api/v1/scheduler
> Subscribed with ID 'c4347d67-05d4-4458-994d-043c25189236-0001
> I0329 10:33:02.225764 28663 scheduler.cpp:640] Enqueuing event HEARTBEAT 
> received from https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:02.226172 28665 scheduler.cpp:640] Enqueuing event OFFERS 
> received from https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:02.226687 28664 resources.cpp:574] Parsing resources as JSON 
> failed: cpus:1;mem:128
> Trying semicolon-delimited string format instead
> task task1 submitted to agent fac82f38-c437-4058-b3e1-ce664070611b-S0
> I0329 10:33:02.227926 28670 scheduler.cpp:231] Sending ACCEPT call to 
> https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:02.362051 28667 scheduler.cpp:640] Enqueuing event UPDATE 
> received from https://127.0.1.1:5050/master/api/v1/scheduler
> Received status update TASK_RUNNING for task task1
> I0329 10:33:02.362877 28663 scheduler.cpp:231] Sending ACKNOWLEDGE call to 
> https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:03.378164 28669 scheduler.cpp:640] Enqueuing event UPDATE 
> received from https://127.0.1.1:5050/master/api/v1/scheduler
> Received status update TASK_FINISHED for task task1
> I0329 10:33:03.379533 28663 scheduler.cpp:231] Sending ACKNOWLEDGE call to 
> https://127.0.1.1:5050/master/api/v1/scheduler
> 
> 
> Thanks,
> 
> Anand Mazumdar
> 
>



Re: Review Request 45435: Modified scheduler library to properly handle SSL connections.

2016-03-29 Thread Joseph Wu

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


Fix it, then Ship it!




The approach LGTM.


src/scheduler/scheduler.cpp (line 437)


This flag is a `bool`, so we accept two forms:
"1" and "true".

See: 
https://github.com/apache/mesos/blob/master/3rdparty/libprocess/3rdparty/stout/include/stout/flags/parse.hpp#L54

---

Also, you can compare an Option without checking `.isSome()`.


- Joseph Wu


On March 29, 2016, 10:35 a.m., Anand Mazumdar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45435/
> ---
> 
> (Updated March 29, 2016, 10:35 a.m.)
> 
> 
> Review request for mesos, Joseph Wu and Vinod Kone.
> 
> 
> Bugs: MESOS-3976
> https://issues.apache.org/jira/browse/MESOS-3976
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> This fixes the scheduler library to properly set the scheme
> as `https` if SSL is enabled. If not, default to `http` as
> is the case now. Would follow up with a similar change for the 
> executor library.
> 
> 
> Diffs
> -
> 
>   src/scheduler/scheduler.cpp 13972449363b633f21ddec7649b1b170703c773a 
> 
> Diff: https://reviews.apache.org/r/45435/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> Used the command scheduler to verify requests are made via HTTPS. Adding 
> tests for this would be handled as part of MESOS-3753.
> 
> GLOG_v=1 SSL_CERT_FILE=/home/faceoff/work/mesos-priv/build/cert.pem 
> SSL_KEY_FILE=/home/faceoff/work/mesos-priv/build/key.pem SSL_ENABLED=1 
> ./src/mesos-execute --command="sleep 1" --master=127.0.1.1:5050 --name=task1
> Enter PEM pass phrase:
> WARNING: Logging before InitGoogleLogging() is written to STDERR
> I0329 10:33:02.122915 28647 process.cpp:986] libprocess is initialized on 
> 127.0.1.1:46244 for 8 cpus
> I0329 10:33:02.125663 28663 logging.cpp:195] Logging to STDERR
> I0329 10:33:02.125758 28663 scheduler.cpp:172] Version: 0.29.0
> I0329 10:33:02.131425 28667 scheduler.cpp:449] New master detected at 
> master@127.0.1.1:5050
> I0329 10:33:02.168808 28664 scheduler.cpp:338] Connected with the master at 
> https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:02.170920 28669 scheduler.cpp:231] Sending SUBSCRIBE call to 
> https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:02.225026 28670 scheduler.cpp:640] Enqueuing event SUBSCRIBED 
> received from https://127.0.1.1:5050/master/api/v1/scheduler
> Subscribed with ID 'c4347d67-05d4-4458-994d-043c25189236-0001
> I0329 10:33:02.225764 28663 scheduler.cpp:640] Enqueuing event HEARTBEAT 
> received from https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:02.226172 28665 scheduler.cpp:640] Enqueuing event OFFERS 
> received from https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:02.226687 28664 resources.cpp:574] Parsing resources as JSON 
> failed: cpus:1;mem:128
> Trying semicolon-delimited string format instead
> task task1 submitted to agent fac82f38-c437-4058-b3e1-ce664070611b-S0
> I0329 10:33:02.227926 28670 scheduler.cpp:231] Sending ACCEPT call to 
> https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:02.362051 28667 scheduler.cpp:640] Enqueuing event UPDATE 
> received from https://127.0.1.1:5050/master/api/v1/scheduler
> Received status update TASK_RUNNING for task task1
> I0329 10:33:02.362877 28663 scheduler.cpp:231] Sending ACKNOWLEDGE call to 
> https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:03.378164 28669 scheduler.cpp:640] Enqueuing event UPDATE 
> received from https://127.0.1.1:5050/master/api/v1/scheduler
> Received status update TASK_FINISHED for task task1
> I0329 10:33:03.379533 28663 scheduler.cpp:231] Sending ACKNOWLEDGE call to 
> https://127.0.1.1:5050/master/api/v1/scheduler
> 
> 
> Thanks,
> 
> Anand Mazumdar
> 
>



Re: Review Request 45435: Modified scheduler library to properly handle SSL connections.

2016-03-29 Thread Vinod Kone

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


Ship it!




LGTM. I'll let Joseph Wu take a look and ship it as well.

- Vinod Kone


On March 29, 2016, 5:35 p.m., Anand Mazumdar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45435/
> ---
> 
> (Updated March 29, 2016, 5:35 p.m.)
> 
> 
> Review request for mesos, Joseph Wu and Vinod Kone.
> 
> 
> Bugs: MESOS-3976
> https://issues.apache.org/jira/browse/MESOS-3976
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> This fixes the scheduler library to properly set the scheme
> as `https` if SSL is enabled. If not, default to `http` as
> is the case now. Would follow up with a similar change for the 
> executor library.
> 
> 
> Diffs
> -
> 
>   src/scheduler/scheduler.cpp 13972449363b633f21ddec7649b1b170703c773a 
> 
> Diff: https://reviews.apache.org/r/45435/diff/
> 
> 
> Testing
> ---
> 
> make check
> 
> Used the command scheduler to verify requests are made via HTTPS. Adding 
> tests for this would be handled as part of MESOS-3753.
> 
> GLOG_v=1 SSL_CERT_FILE=/home/faceoff/work/mesos-priv/build/cert.pem 
> SSL_KEY_FILE=/home/faceoff/work/mesos-priv/build/key.pem SSL_ENABLED=1 
> ./src/mesos-execute --command="sleep 1" --master=127.0.1.1:5050 --name=task1
> Enter PEM pass phrase:
> WARNING: Logging before InitGoogleLogging() is written to STDERR
> I0329 10:33:02.122915 28647 process.cpp:986] libprocess is initialized on 
> 127.0.1.1:46244 for 8 cpus
> I0329 10:33:02.125663 28663 logging.cpp:195] Logging to STDERR
> I0329 10:33:02.125758 28663 scheduler.cpp:172] Version: 0.29.0
> I0329 10:33:02.131425 28667 scheduler.cpp:449] New master detected at 
> master@127.0.1.1:5050
> I0329 10:33:02.168808 28664 scheduler.cpp:338] Connected with the master at 
> https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:02.170920 28669 scheduler.cpp:231] Sending SUBSCRIBE call to 
> https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:02.225026 28670 scheduler.cpp:640] Enqueuing event SUBSCRIBED 
> received from https://127.0.1.1:5050/master/api/v1/scheduler
> Subscribed with ID 'c4347d67-05d4-4458-994d-043c25189236-0001
> I0329 10:33:02.225764 28663 scheduler.cpp:640] Enqueuing event HEARTBEAT 
> received from https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:02.226172 28665 scheduler.cpp:640] Enqueuing event OFFERS 
> received from https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:02.226687 28664 resources.cpp:574] Parsing resources as JSON 
> failed: cpus:1;mem:128
> Trying semicolon-delimited string format instead
> task task1 submitted to agent fac82f38-c437-4058-b3e1-ce664070611b-S0
> I0329 10:33:02.227926 28670 scheduler.cpp:231] Sending ACCEPT call to 
> https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:02.362051 28667 scheduler.cpp:640] Enqueuing event UPDATE 
> received from https://127.0.1.1:5050/master/api/v1/scheduler
> Received status update TASK_RUNNING for task task1
> I0329 10:33:02.362877 28663 scheduler.cpp:231] Sending ACKNOWLEDGE call to 
> https://127.0.1.1:5050/master/api/v1/scheduler
> I0329 10:33:03.378164 28669 scheduler.cpp:640] Enqueuing event UPDATE 
> received from https://127.0.1.1:5050/master/api/v1/scheduler
> Received status update TASK_FINISHED for task task1
> I0329 10:33:03.379533 28663 scheduler.cpp:231] Sending ACKNOWLEDGE call to 
> https://127.0.1.1:5050/master/api/v1/scheduler
> 
> 
> Thanks,
> 
> Anand Mazumdar
> 
>