Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2016-01-13 Thread Klaus Ma

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


ping @mcypark :).

- Klaus Ma


On Dec. 13, 2015, 11:28 p.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37168/
> ---
> 
> (Updated Dec. 13, 2015, 11:28 p.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-3063
> https://issues.apache.org/jira/browse/MESOS-3063
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Provide example for dynamic reservation features.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 9762f85 
>   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
>   src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
>   src/tests/examples_tests.cpp 5211f54 
> 
> Diff: https://reviews.apache.org/r/37168/diff/
> 
> 
> Testing
> ---
> 
> make
> make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-12-14 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [37168]

Passed command: export OS=ubuntu:14.04;export CONFIGURATION="--verbose";export 
COMPILER=gcc; ./support/docker_build.sh

- Mesos ReviewBot


On Dec. 13, 2015, 3:28 p.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37168/
> ---
> 
> (Updated Dec. 13, 2015, 3:28 p.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-3063
> https://issues.apache.org/jira/browse/MESOS-3063
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Provide example for dynamic reservation features.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 9762f85 
>   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
>   src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
>   src/tests/examples_tests.cpp 5211f54 
> 
> Diff: https://reviews.apache.org/r/37168/diff/
> 
> 
> Testing
> ---
> 
> make
> make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-12-13 Thread Klaus Ma

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

(Updated Dec. 13, 2015, 11:28 p.m.)


Review request for mesos and Michael Park.


Changes
---

Rebase the code; @mcypark, please help to review when you have time.


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


Repository: mesos


Description
---

Provide example for dynamic reservation features.


Diffs (updated)
-

  src/Makefile.am 9762f85 
  src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
  src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
  src/tests/examples_tests.cpp 5211f54 

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


Testing
---

make
make check


Thanks,

Klaus Ma



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-11-09 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [37168]

All tests passed.

- Mesos ReviewBot


On Nov. 9, 2015, 8:10 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37168/
> ---
> 
> (Updated Nov. 9, 2015, 8:10 a.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-3063
> https://issues.apache.org/jira/browse/MESOS-3063
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Provide example for dynamic reservation features.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am c479aca 
>   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
>   src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
>   src/tests/examples_tests.cpp 3f56b30 
> 
> Diff: https://reviews.apache.org/r/37168/diff/
> 
> 
> Testing
> ---
> 
> make
> make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-11-09 Thread Klaus Ma


> On Oct. 6, 2015, 7:12 a.m., Michael Park wrote:
> > src/examples/dynamic_reservation_framework.cpp, lines 120-123
> > 
> >
> > `reserveResources` returns an error when there are not enough resources 
> > available. While this is a necessary condition, it's not sufficient to 
> > assume that the reservation succeeded. We need to wait until the reserved 
> > resources are actually offered back to us before we can assume that the 
> > resources have been reserved.

I used to add `RESERVING` state to show the case that the framework did not get 
the reserved resources; but it seems not necessary: the `RESERVING` state will 
transfer to `RESERVED` and dispatch task, the code logic of `RESERVING` & 
`RESERVED` are same. Should we add `RESERVING` state to make it more readable 
or change the term to `RESERVE`?


> On Oct. 6, 2015, 7:12 a.m., Michael Park wrote:
> > src/examples/dynamic_reservation_framework.cpp, lines 126-131
> > 
> >
> > Based on how this reads, it looks like we always launch tasks on the 
> > offer if the agent's state is `RESERVED`. In reality, we only launch tasks 
> > if the agent is in a reserved state and there has not been a task launched 
> > on this agent yet. I think we should capture that by having something like:
> > 
> > ```
> > case State::RESERVED:
> >   if (/* no task have been launched on this agent yet &&
> >  the offer has suffcient resources to launch a task */) {
> > launchTask(driver, offer);
> >   }
> >   break;

Agree; for the condition `no task have been launched on this agent yet`, it's 
guantee by state of slave; and also check whether reserved resources contains 
task resource.


> On Oct. 6, 2015, 7:12 a.m., Michael Park wrote:
> > src/examples/dynamic_reservation_framework.cpp, lines 149-151
> > 
> >
> > Generally, having the same state be the initial state as well as the 
> > termination state and trying to differentiate between them is a bad idea. 
> > For example, we're assuming `states.empty()` is the termination state 
> > condition here but it's also the condition of the initial state. How do we 
> > know that we're not here because `offers` happened to be empty? Keeping the 
> > initial state and the termination state distinct will make the code easier 
> > to reason about and less error-prone.

Address by adding `tasksFinished == totalTasks`: when all tasks are done & 
states is empty, stop the driver.


> On Oct. 6, 2015, 7:12 a.m., Michael Park wrote:
> > src/examples/dynamic_reservation_framework.cpp, lines 243-244
> > 
> >
> > It looks weird to see `resources_.flatten(role, reservationInfo)` but 
> > `TASK_RESOURCES.flatten(role)`, what's the reason for that?
> > 
> > Also, `find` has funky behavior where it'll match resources that aren't 
> > exactly the thing that you specify to `find`. Is this funkiness accounted 
> > for? or do we just want to reserve `task_resources` if 
> > `resources.contains(task_resoures) == true`?

Update to check `resources.contains(task_resoures)`.


> On Oct. 6, 2015, 7:12 a.m., Michael Park wrote:
> > src/examples/dynamic_reservation_framework.cpp, lines 213-214
> > 
> >
> > This loop launches as many tasks as possible as long as they fit in the 
> > offered resources. I thought we only want to launch 1 task per agent and 
> > therefore 1 task per offer. I guess that behavior could be satisfied by 
> > making sure we only reserve 1 "task resources" worth of resources per 
> > agent, but we should capture that postcondition in here as a precondition.

Update to only dispatch 1 task to the reserved resources; and use 
`reserved.contains(taskResources)` to check whether got reserved resources by 
this framework.


> On Oct. 6, 2015, 7:12 a.m., Michael Park wrote:
> > src/examples/dynamic_reservation_framework.cpp, line 338
> > 
> >
> > This logic is typically inlined in all other example frameworks. Any 
> > particular reason as to why this is factored out to a function? and why is 
> > it all caps?

OK :). Moved to `main()`


> On Oct. 6, 2015, 7:12 a.m., Michael Park wrote:
> > src/tests/flags.hpp, lines 155-158
> > 
> >
> > I think we don't need this since we have:
> > 
> > ```
> > os::setenv("MESOS_ROLES", flags.role.get());
> > ```
> > 
> > This seems to be how other example frameworks such as 
> > `persistent_volume_framework.cpp` have gotten away without this explicit 
> > `roles` flag.


Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-11-09 Thread Klaus Ma

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

(Updated Nov. 9, 2015, 4:10 p.m.)


Review request for mesos and Michael Park.


Changes
---

Address comments


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


Repository: mesos


Description
---

Provide example for dynamic reservation features.


Diffs (updated)
-

  src/Makefile.am c479aca 
  src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
  src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
  src/tests/examples_tests.cpp 3f56b30 

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


Testing
---

make
make check


Thanks,

Klaus Ma



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-11-08 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [37168]

All tests passed.

- Mesos ReviewBot


On Nov. 9, 2015, 5:29 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37168/
> ---
> 
> (Updated Nov. 9, 2015, 5:29 a.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-3063
> https://issues.apache.org/jira/browse/MESOS-3063
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Provide example for dynamic reservation features.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am c479aca 
>   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
>   src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
>   src/tests/examples_tests.cpp 3f56b30 
>   src/tests/flags.hpp 984cd4a 
>   src/tests/script.cpp d2280c2 
> 
> Diff: https://reviews.apache.org/r/37168/diff/
> 
> 
> Testing
> ---
> 
> make
> make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-11-08 Thread Klaus Ma

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

(Updated Nov. 9, 2015, 1:29 p.m.)


Review request for mesos and Michael Park.


Changes
---

Address comments


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


Repository: mesos


Description
---

Provide example for dynamic reservation features.


Diffs (updated)
-

  src/Makefile.am c479aca 
  src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
  src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
  src/tests/examples_tests.cpp 3f56b30 
  src/tests/flags.hpp 984cd4a 
  src/tests/script.cpp d2280c2 

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


Testing
---

make
make check


Thanks,

Klaus Ma



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-09-14 Thread Klaus Ma

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



src/Makefile.am (line 1463)


Done



src/examples/dynamic_reservation_framework.cpp (line 40)


Done



src/examples/dynamic_reservation_framework.cpp (line 49)


Done



src/examples/dynamic_reservation_framework.cpp (line 180)


Done



src/examples/dynamic_reservation_framework.cpp (line 183)


Done



src/examples/dynamic_reservation_framework.cpp (line 184)


Done



src/examples/dynamic_reservation_framework.cpp (line 281)


Done



src/examples/dynamic_reservation_framework.cpp (line 283)


Done


- Klaus Ma


On Sept. 6, 2015, 4:11 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37168/
> ---
> 
> (Updated Sept. 6, 2015, 4:11 a.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-3063
> https://issues.apache.org/jira/browse/MESOS-3063
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Provide example for dynamic reservation features.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 5fdca0f 
>   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
>   src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
>   src/tests/examples_tests.cpp 3f56b30 
>   src/tests/flags.hpp 06da36d 
>   src/tests/script.cpp bcc1fab 
> 
> Diff: https://reviews.apache.org/r/37168/diff/
> 
> 
> Testing
> ---
> 
> make
> make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-09-14 Thread Klaus Ma

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

(Updated Sept. 14, 2015, 1:48 p.m.)


Review request for mesos and Michael Park.


Changes
---

Address review comments


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


Repository: mesos


Description
---

Provide example for dynamic reservation features.


Diffs (updated)
-

  src/Makefile.am 8963cea 
  src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
  src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
  src/tests/examples_tests.cpp 3f56b30 
  src/tests/flags.hpp 06da36d 
  src/tests/script.cpp bcc1fab 

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


Testing
---

make
make check


Thanks,

Klaus Ma



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-09-14 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [37168]

All tests passed.

- Mesos ReviewBot


On Sept. 14, 2015, 1:48 p.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37168/
> ---
> 
> (Updated Sept. 14, 2015, 1:48 p.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-3063
> https://issues.apache.org/jira/browse/MESOS-3063
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Provide example for dynamic reservation features.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 8963cea 
>   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
>   src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
>   src/tests/examples_tests.cpp 3f56b30 
>   src/tests/flags.hpp 06da36d 
>   src/tests/script.cpp bcc1fab 
> 
> Diff: https://reviews.apache.org/r/37168/diff/
> 
> 
> Testing
> ---
> 
> make
> make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-09-12 Thread Michael Park

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


Some preliminary comments.


src/examples/dynamic_reservation_framework.cpp (line 40)


Remove newline.



src/examples/dynamic_reservation_framework.cpp (line 49)


Not used.



src/examples/dynamic_reservation_framework.cpp (lines 100 - 102)


Shouldn't we also make sure we only reserve `TASK_RESOURCES` amount of 
resources on only `totalTasks` number of agents?



src/examples/dynamic_reservation_framework.cpp (lines 111 - 112)


It seems like we should stay in the `START` state until we've reserved 
`TASK_RESOURCES` amount of resources for this agent before transitioning to the 
`RESERVED` state, right?

Looking at the `reserveResources` function, it doesn't even perform the 
`acceptOffers` if the offer resources doesn't contain sufficient resources. 
Shouldn't the `state = State::RESERVED` be dependent on the result of 
`reserveResources`?



src/examples/dynamic_reservation_framework.cpp (line 180)


`s/sid/slaveId/`



src/examples/dynamic_reservation_framework.cpp (line 183)


`s/executorID/executorId/`



src/examples/dynamic_reservation_framework.cpp (line 184)


`s/slaveID/slaveId/`



src/examples/dynamic_reservation_framework.cpp (line 228)


Why is this called `remaining`? I would think the "remaining" portion is 
`TASK_RESOURCES` - amount of already reserved resources?



src/examples/dynamic_reservation_framework.cpp (line 229)


We should be careful here, as `find` does not do exact match. It can return 
resources with a non-matching role, for example.



src/examples/dynamic_reservation_framework.cpp (line 242)


Why does this function perform side-effects? I think this function should 
look exactly the same as the one in `src/tests/mesos.hpp`.



src/examples/dynamic_reservation_framework.cpp (line 252)


It doesn't makes sense to print this here as this function doesn't actually 
reserve any resources.



src/examples/dynamic_reservation_framework.cpp (line 257)


Same comment as `RESERVE`.


- Michael Park


On Sept. 6, 2015, 4:11 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37168/
> ---
> 
> (Updated Sept. 6, 2015, 4:11 a.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-3063
> https://issues.apache.org/jira/browse/MESOS-3063
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Provide example for dynamic reservation features.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 5fdca0f 
>   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
>   src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
>   src/tests/examples_tests.cpp 3f56b30 
>   src/tests/flags.hpp 06da36d 
>   src/tests/script.cpp bcc1fab 
> 
> Diff: https://reviews.apache.org/r/37168/diff/
> 
> 
> Testing
> ---
> 
> make
> make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-09-08 Thread Klaus Ma

Hi Michael,

Do you have more comments about this example?

On 2015年09月06日 21:28, Klaus Ma wrote:
This is an automatically generated e-mail. To reply, visit: 
https://reviews.apache.org/r/37168/



On September 6th, 2015, 8:49 a.m. UTC, *Joerg Schad* wrote:

src/Makefile.am


(Diff revision 4)


1463

Any reason for this blank line here?

It's not necessary, will delete it.


On September 6th, 2015, 8:49 a.m. UTC, *Joerg Schad* wrote:

src/examples/dynamic_reservation_framework.cpp


(Diff revision 4)


281 

 START,   // The framework get the offer for the first time.

s/get/receives

OK :).


On September 6th, 2015, 8:49 a.m. UTC, *Joerg Schad* wrote:

src/examples/dynamic_reservation_framework.cpp


(Diff revision 4)


283 

 TASK_DONE,   // All tasks are done.

s/TASK_DONE/TASKS_DONE


Please correct me if I am wrong: TASK_DONE is a global state
across all slaves, while the other states can differ per
state, or? Maybe just extend the comment a bit explaining this.

Yes, TASK_DONE is a global state; when all task finished, framework 
will un-reserve all resources.



On September 6th, 2015, 8:49 a.m. UTC, *Joerg Schad* wrote:

src/tests/dynamic_reservation_framework_test.sh


(Diff revision 4)


30  

export MESOS_ROLES="test"

Do we need this here and below in script.cpp?

Yes, it's necessary because: 1. dynamic reservation is role based 2. 
can not use default role for dynamic reservation, neither * nor 
MESOS_DEFAULT_ROLE



- Klaus


On September 6th, 2015, 4:11 a.m. UTC, Klaus Ma wrote:

Review request for mesos and Michael Park.
By Klaus Ma.

/Updated Sept. 6, 2015, 4:11 a.m./

*Bugs: * MESOS-3063 
*Repository: * mesos


  Description

Provide example for dynamic reservation features.


  Testing

make make check


  Diffs

  * src/Makefile.am (5fdca0f)
  * src/examples/dynamic_reservation_framework.cpp (PRE-CREATION)
  * src/tests/dynamic_reservation_framework_test.sh (PRE-CREATION)
  * src/tests/examples_tests.cpp (3f56b30)
  * src/tests/flags.hpp (06da36d)
  * src/tests/script.cpp (bcc1fab)

View Diff 



--
Klaus Ma (马达), PMP® | http://www.cguru.net



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-09-06 Thread Joerg Schad

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



src/Makefile.am (line 1463)


Any reason for this blank line here?



src/examples/dynamic_reservation_framework.cpp (line 281)


s/get/receives



src/examples/dynamic_reservation_framework.cpp (line 283)


s/TASK_DONE/TASKS_DONE

Please correct me if I am wrong: TASK_DONE is a global state across all 
slaves, while the other states can differ per state, or? Maybe just extend the 
comment a bit explaining this.



src/tests/dynamic_reservation_framework_test.sh (line 30)


Do we need this here and below in script.cpp?


- Joerg Schad


On Sept. 6, 2015, 4:11 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37168/
> ---
> 
> (Updated Sept. 6, 2015, 4:11 a.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-3063
> https://issues.apache.org/jira/browse/MESOS-3063
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Provide example for dynamic reservation features.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 5fdca0f 
>   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
>   src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
>   src/tests/examples_tests.cpp 3f56b30 
>   src/tests/flags.hpp 06da36d 
>   src/tests/script.cpp bcc1fab 
> 
> Diff: https://reviews.apache.org/r/37168/diff/
> 
> 
> Testing
> ---
> 
> make
> make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-09-06 Thread Klaus Ma


> On Sept. 6, 2015, 8:49 a.m., Joerg Schad wrote:
> > src/examples/dynamic_reservation_framework.cpp, line 283
> > 
> >
> > s/TASK_DONE/TASKS_DONE
> > 
> > Please correct me if I am wrong: TASK_DONE is a global state across all 
> > slaves, while the other states can differ per state, or? Maybe just extend 
> > the comment a bit explaining this.

Yes, TASK_DONE is a global state; when all task finished, framework will 
un-reserve all resources.


> On Sept. 6, 2015, 8:49 a.m., Joerg Schad wrote:
> > src/tests/dynamic_reservation_framework_test.sh, line 30
> > 
> >
> > Do we need this here and below in script.cpp?

Yes, it's necessary because:
1. dynamic reservation is role based
2. can not use default role for dynamic reservation, neither * nor 
MESOS_DEFAULT_ROLE


> On Sept. 6, 2015, 8:49 a.m., Joerg Schad wrote:
> > src/Makefile.am, line 1463
> > 
> >
> > Any reason for this blank line here?

It's not necessary, will delete it.


> On Sept. 6, 2015, 8:49 a.m., Joerg Schad wrote:
> > src/examples/dynamic_reservation_framework.cpp, line 281
> > 
> >
> > s/get/receives

OK :).


- Klaus


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


On Sept. 6, 2015, 4:11 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37168/
> ---
> 
> (Updated Sept. 6, 2015, 4:11 a.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-3063
> https://issues.apache.org/jira/browse/MESOS-3063
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Provide example for dynamic reservation features.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 5fdca0f 
>   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
>   src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
>   src/tests/examples_tests.cpp 3f56b30 
>   src/tests/flags.hpp 06da36d 
>   src/tests/script.cpp bcc1fab 
> 
> Diff: https://reviews.apache.org/r/37168/diff/
> 
> 
> Testing
> ---
> 
> make
> make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-09-05 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [37168]

All tests passed.

- Mesos ReviewBot


On Sept. 6, 2015, 4:11 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37168/
> ---
> 
> (Updated Sept. 6, 2015, 4:11 a.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-3063
> https://issues.apache.org/jira/browse/MESOS-3063
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Provide example for dynamic reservation features.
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 5fdca0f 
>   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
>   src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
>   src/tests/examples_tests.cpp 3f56b30 
>   src/tests/flags.hpp 06da36d 
>   src/tests/script.cpp bcc1fab 
> 
> Diff: https://reviews.apache.org/r/37168/diff/
> 
> 
> Testing
> ---
> 
> make
> make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-09-05 Thread Klaus Ma

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

(Updated Sept. 6, 2015, 4:11 a.m.)


Review request for mesos and Michael Park.


Changes
---

Update the code diff to address commnets:
* Add comments to describe the example logic
* Use command executor instead of test_executor.cpp


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


Repository: mesos


Description
---

Provide example for dynamic reservation features.


Diffs (updated)
-

  src/Makefile.am 5fdca0f 
  src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
  src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
  src/tests/examples_tests.cpp 3f56b30 
  src/tests/flags.hpp 06da36d 
  src/tests/script.cpp bcc1fab 

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


Testing
---

make
make check


Thanks,

Klaus Ma



Re: Review Request 37168: MESOS-3063 (Add an example framework using dynamic reservation)

2015-09-04 Thread Klaus Ma

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

(Updated Sept. 5, 2015, 3:14 a.m.)


Review request for mesos and Michael Park.


Changes
---

Update summary & description


Summary (updated)
-

MESOS-3063 (Add an example framework using dynamic reservation)


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


Repository: mesos


Description (updated)
---

Provide example for dynamic reservation features.


Diffs
-

  src/Makefile.am 7b620ff 
  src/examples/dynamic_reservation_executor.cpp PRE-CREATION 
  src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
  src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
  src/tests/examples_tests.cpp 3f56b30 
  src/tests/flags.hpp 3644956 
  src/tests/script.cpp bcc1fab 

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


Testing
---

make
make check


Thanks,

Klaus Ma



Re: Review Request 37168: MESOS-3063

2015-09-02 Thread Joerg Schad

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


As this is an example framework (which will be used by people to start their 
own framework), would it make sense to add some more comments explaining 
especially the relevant bits here?

- Joerg Schad


On Aug. 28, 2015, 3:31 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37168/
> ---
> 
> (Updated Aug. 28, 2015, 3:31 a.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-3063
> https://issues.apache.org/jira/browse/MESOS-3063
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> MESOS-3063 (Add an example framework using dynamic reservation)
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 7b620ff 
>   src/examples/dynamic_reservation_executor.cpp PRE-CREATION 
>   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
>   src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
>   src/tests/examples_tests.cpp 3f56b30 
>   src/tests/flags.hpp 3644956 
>   src/tests/script.cpp bcc1fab 
> 
> Diff: https://reviews.apache.org/r/37168/diff/
> 
> 
> Testing
> ---
> 
> make
> make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 37168: MESOS-3063

2015-09-02 Thread Klaus Ma


> On Sept. 2, 2015, 7:30 a.m., Joerg Schad wrote:
> > As this is an example framework (which will be used by people to start 
> > their own framework), would it make sense to add some more comments 
> > explaining especially the relevant bits here?

Agree, let me add more comments for the detail :); that'll be helpful to our 
uers.


- Klaus


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


On Aug. 28, 2015, 3:31 a.m., Klaus Ma wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37168/
> ---
> 
> (Updated Aug. 28, 2015, 3:31 a.m.)
> 
> 
> Review request for mesos and Michael Park.
> 
> 
> Bugs: MESOS-3063
> https://issues.apache.org/jira/browse/MESOS-3063
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> MESOS-3063 (Add an example framework using dynamic reservation)
> 
> 
> Diffs
> -
> 
>   src/Makefile.am 7b620ff 
>   src/examples/dynamic_reservation_executor.cpp PRE-CREATION 
>   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
>   src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
>   src/tests/examples_tests.cpp 3f56b30 
>   src/tests/flags.hpp 3644956 
>   src/tests/script.cpp bcc1fab 
> 
> Diff: https://reviews.apache.org/r/37168/diff/
> 
> 
> Testing
> ---
> 
> make
> make check
> 
> 
> Thanks,
> 
> Klaus Ma
> 
>



Re: Review Request 37168: MESOS-3063

2015-08-26 Thread Klaus Ma

The tests failed because script.cpp can not find test script which has been 
updated; I'm working to check it, although the root cause is un-clear now.


[ RUN  ] ExamplesTest.DynamicReservationFramework
../../src/tests/script.cpp:66: Failure
Failed
Failed to locate script: No such file or directory
[  FAILED  ] ExamplesTest.DynamicReservationFramework (0 ms)



On 2015年08月27日 12:19, Mesos ReviewBot wrote:

[ RUN  ] ExamplesTest.DynamicReservationFramework
../../src/tests/script.cpp:66: Failure
Failed
Failed to locate script: No such file or directory
[  FAILED  ] ExamplesTest.DynamicReservationFramework (0 ms)


--
Klaus Ma (马达) | PMP | kl...@cguru.net



Re: Review Request 37168: MESOS-3063

2015-08-26 Thread Klaus Ma

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

(Updated 八月 27, 2015, 3:33 a.m.)


Review request for mesos.


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


Repository: mesos


Description
---

MESOS-3063 (Add an example framework using dynamic reservation)


Diffs (updated)
-

  src/Makefile.am 7b620ff 
  src/examples/dynamic_reservation_executor.cpp PRE-CREATION 
  src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
  src/tests/dynamic_reservation_framework_test.sh PRE-CREATION 
  src/tests/examples_tests.cpp 3f56b30 
  src/tests/flags.hpp 3644956 
  src/tests/script.cpp bcc1fab 

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


Testing (updated)
---

make
make check


Thanks,

Klaus Ma



Re: Review Request 37168: MESOS-3063

2015-08-13 Thread Klaus Ma


 On 八月 13, 2015, 2:56 a.m., haosdent huang wrote:
  src/examples/dynamic_reservation_framework.cpp, line 343
  https://reviews.apache.org/r/37168/diff/1/?file=1033410#file1033410line343
 
  Does we need add 
  ```
  logging::initialize(argv[0], flags, true);
  ```
  here?

logging is an internal tools. In this example, i'm trying to avoid using 
internal classes; so user can build this example from installed Mesos, which is 
better practice for the user :).


 On 八月 13, 2015, 2:56 a.m., haosdent huang wrote:
  src/examples/dynamic_reservation_framework.cpp, line 278
  https://reviews.apache.org/r/37168/diff/1/?file=1033410#file1033410line278
 
  Could we change the style here to make it looks better? :-)

sure, I copied this from other example; anyway, I'll check the style :).


- Klaus


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


On 八月 6, 2015, 8:03 a.m., Klaus Ma wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/37168/
 ---
 
 (Updated 八月 6, 2015, 8:03 a.m.)
 
 
 Review request for mesos.
 
 
 Bugs: MESOS-3063
 https://issues.apache.org/jira/browse/MESOS-3063
 
 
 Repository: mesos
 
 
 Description
 ---
 
 MESOS-3063 (Add an example framework using dynamic reservation)
 
 
 Diffs
 -
 
   src/examples/dynamic_reservation_executor.cpp PRE-CREATION 
   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
 
 Diff: https://reviews.apache.org/r/37168/diff/
 
 
 Testing
 ---
 
  Test Steps
 
 Build the example and run in local Mesos cluster
 
  Example Output
 
 I0806 15:19:33.955976 17033 sched.cpp:640] Framework registered with 
 20150805-204038-16842879-5050-14289-0015
 Registered!
 Received offer 20150805-204038-16842879-5050-14289-O161 with mem(*):2862; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):4
 Reserve resources cpus(test, dynamic-reservation-framework-cpp):1; 
 mem(test, dynamic-reservation-framework-cpp):128
 Received offer 20150805-204038-16842879-5050-14289-O162 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-  
 reservation-framework-cpp):128
 Launching task 0 using offer 20150805-204038-16842879-5050-14289-O162
 Task 0 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O163 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 1 using offer 20150805-204038-16842879-5050-14289-O163
 Task 1 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O164 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 2 using offer 20150805-204038-16842879-5050-14289-O164
 Task 2 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O165 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 3 using offer 20150805-204038-16842879-5050-14289-O165
 Task 3 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O166 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 4 using offer 20150805-204038-16842879-5050-14289-O166
 Task 4 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O167 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Unreserve resources cpus(test, dynamic-reservation-framework-cpp):1; 
 mem(test, dynamic-reservation-framework-cpp):128
 Received offer 20150805-204038-16842879-5050-14289-O168 with mem(*):2862; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):4
 I0806 15:19:49.515024 17031 sched.cpp:1748] Asked to stop the driver
 I0806 15:19:49.515115 17031 sched.cpp:1032] Stopping framework 
 '20150805-204038-16842879-5050-14289-0015'
 I0806 15:19:49.515630 17027 sched.cpp:1748] Asked to stop the driver
 2015-08-06 
 15:19:49,516:17027(0x7f23f610d700):ZOO_INFO@zookeeper_close@2505: Closing 
 zookeeper sessionId=0x34da910aab20058 to [9.111.159.76:2181]
 
 
 Thanks,
 
 Klaus Ma
 




Re: Review Request 37168: MESOS-3063

2015-08-12 Thread haosdent huang


 On Aug. 13, 2015, 2:56 a.m., haosdent huang wrote:
 

Hi, @klaus1982 Thanks you for you nice example. I think you need add your 
Shepherd as reviewer in this patch.


- haosdent


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


On Aug. 6, 2015, 8:03 a.m., Klaus Ma wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/37168/
 ---
 
 (Updated Aug. 6, 2015, 8:03 a.m.)
 
 
 Review request for mesos.
 
 
 Bugs: MESOS-3063
 https://issues.apache.org/jira/browse/MESOS-3063
 
 
 Repository: mesos
 
 
 Description
 ---
 
 MESOS-3063 (Add an example framework using dynamic reservation)
 
 
 Diffs
 -
 
   src/examples/dynamic_reservation_executor.cpp PRE-CREATION 
   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
 
 Diff: https://reviews.apache.org/r/37168/diff/
 
 
 Testing
 ---
 
  Test Steps
 
 Build the example and run in local Mesos cluster
 
  Example Output
 
 I0806 15:19:33.955976 17033 sched.cpp:640] Framework registered with 
 20150805-204038-16842879-5050-14289-0015
 Registered!
 Received offer 20150805-204038-16842879-5050-14289-O161 with mem(*):2862; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):4
 Reserve resources cpus(test, dynamic-reservation-framework-cpp):1; 
 mem(test, dynamic-reservation-framework-cpp):128
 Received offer 20150805-204038-16842879-5050-14289-O162 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-  
 reservation-framework-cpp):128
 Launching task 0 using offer 20150805-204038-16842879-5050-14289-O162
 Task 0 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O163 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 1 using offer 20150805-204038-16842879-5050-14289-O163
 Task 1 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O164 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 2 using offer 20150805-204038-16842879-5050-14289-O164
 Task 2 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O165 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 3 using offer 20150805-204038-16842879-5050-14289-O165
 Task 3 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O166 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 4 using offer 20150805-204038-16842879-5050-14289-O166
 Task 4 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O167 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Unreserve resources cpus(test, dynamic-reservation-framework-cpp):1; 
 mem(test, dynamic-reservation-framework-cpp):128
 Received offer 20150805-204038-16842879-5050-14289-O168 with mem(*):2862; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):4
 I0806 15:19:49.515024 17031 sched.cpp:1748] Asked to stop the driver
 I0806 15:19:49.515115 17031 sched.cpp:1032] Stopping framework 
 '20150805-204038-16842879-5050-14289-0015'
 I0806 15:19:49.515630 17027 sched.cpp:1748] Asked to stop the driver
 2015-08-06 
 15:19:49,516:17027(0x7f23f610d700):ZOO_INFO@zookeeper_close@2505: Closing 
 zookeeper sessionId=0x34da910aab20058 to [9.111.159.76:2181]
 
 
 Thanks,
 
 Klaus Ma
 




Re: Review Request 37168: MESOS-3063

2015-08-12 Thread haosdent huang

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



src/examples/dynamic_reservation_framework.cpp (line 267)
https://reviews.apache.org/r/37168/#comment150072

Need use this style:
```
enum State
{
```



src/examples/dynamic_reservation_framework.cpp (line 278)
https://reviews.apache.org/r/37168/#comment150070

Could we change the style here to make it looks better? :-)



src/examples/dynamic_reservation_framework.cpp (line 343)
https://reviews.apache.org/r/37168/#comment150065

Does we need add 
```
logging::initialize(argv[0], flags, true);
```
here?


- haosdent huang


On Aug. 6, 2015, 8:03 a.m., Klaus Ma wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/37168/
 ---
 
 (Updated Aug. 6, 2015, 8:03 a.m.)
 
 
 Review request for mesos.
 
 
 Bugs: MESOS-3063
 https://issues.apache.org/jira/browse/MESOS-3063
 
 
 Repository: mesos
 
 
 Description
 ---
 
 MESOS-3063 (Add an example framework using dynamic reservation)
 
 
 Diffs
 -
 
   src/examples/dynamic_reservation_executor.cpp PRE-CREATION 
   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
 
 Diff: https://reviews.apache.org/r/37168/diff/
 
 
 Testing
 ---
 
  Test Steps
 
 Build the example and run in local Mesos cluster
 
  Example Output
 
 I0806 15:19:33.955976 17033 sched.cpp:640] Framework registered with 
 20150805-204038-16842879-5050-14289-0015
 Registered!
 Received offer 20150805-204038-16842879-5050-14289-O161 with mem(*):2862; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):4
 Reserve resources cpus(test, dynamic-reservation-framework-cpp):1; 
 mem(test, dynamic-reservation-framework-cpp):128
 Received offer 20150805-204038-16842879-5050-14289-O162 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-  
 reservation-framework-cpp):128
 Launching task 0 using offer 20150805-204038-16842879-5050-14289-O162
 Task 0 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O163 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 1 using offer 20150805-204038-16842879-5050-14289-O163
 Task 1 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O164 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 2 using offer 20150805-204038-16842879-5050-14289-O164
 Task 2 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O165 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 3 using offer 20150805-204038-16842879-5050-14289-O165
 Task 3 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O166 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 4 using offer 20150805-204038-16842879-5050-14289-O166
 Task 4 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O167 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Unreserve resources cpus(test, dynamic-reservation-framework-cpp):1; 
 mem(test, dynamic-reservation-framework-cpp):128
 Received offer 20150805-204038-16842879-5050-14289-O168 with mem(*):2862; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):4
 I0806 15:19:49.515024 17031 sched.cpp:1748] Asked to stop the driver
 I0806 15:19:49.515115 17031 sched.cpp:1032] Stopping framework 
 '20150805-204038-16842879-5050-14289-0015'
 I0806 15:19:49.515630 17027 sched.cpp:1748] Asked to stop the driver
 2015-08-06 
 15:19:49,516:17027(0x7f23f610d700):ZOO_INFO@zookeeper_close@2505: Closing 
 zookeeper sessionId=0x34da910aab20058 to [9.111.159.76:2181]
 
 
 Thanks,
 
 Klaus Ma
 




Review Request 37168: MESOS-3063

2015-08-06 Thread Klaus Ma

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

Review request for mesos.


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


Repository: mesos


Description
---

MESOS-3063 (Add an example framework using dynamic reservation)


Diffs
-

  src/examples/dynamic_reservation_executor.cpp PRE-CREATION 
  src/examples/dynamic_reservation_framework.cpp PRE-CREATION 

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


Testing
---

 Test Steps

Build the example and run in local Mesos cluster

 Example Output

I0806 15:19:33.955976 17033 sched.cpp:640] Framework registered with 
20150805-204038-16842879-5050-14289-0015
Registered!
Received offer 20150805-204038-16842879-5050-14289-O161 with mem(*):2862; 
disk(*):460240; ports(*):[31000-32000]; cpus(*):4
Reserve resources cpus(test, dynamic-reservation-framework-cpp):1; 
mem(test, dynamic-reservation-framework-cpp):128
Received offer 20150805-204038-16842879-5050-14289-O162 with mem(*):2734; 
disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
reservation-framework-cpp):1; mem(test, dynamic-  reservation-framework-cpp):128
Launching task 0 using offer 20150805-204038-16842879-5050-14289-O162
Task 0 is in state TASK_FINISHED
Received offer 20150805-204038-16842879-5050-14289-O163 with mem(*):2734; 
disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
Launching task 1 using offer 20150805-204038-16842879-5050-14289-O163
Task 1 is in state TASK_FINISHED
Received offer 20150805-204038-16842879-5050-14289-O164 with mem(*):2734; 
disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
Launching task 2 using offer 20150805-204038-16842879-5050-14289-O164
Task 2 is in state TASK_FINISHED
Received offer 20150805-204038-16842879-5050-14289-O165 with mem(*):2734; 
disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
Launching task 3 using offer 20150805-204038-16842879-5050-14289-O165
Task 3 is in state TASK_FINISHED
Received offer 20150805-204038-16842879-5050-14289-O166 with mem(*):2734; 
disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
Launching task 4 using offer 20150805-204038-16842879-5050-14289-O166
Task 4 is in state TASK_FINISHED
Received offer 20150805-204038-16842879-5050-14289-O167 with mem(*):2734; 
disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
Unreserve resources cpus(test, dynamic-reservation-framework-cpp):1; 
mem(test, dynamic-reservation-framework-cpp):128
Received offer 20150805-204038-16842879-5050-14289-O168 with mem(*):2862; 
disk(*):460240; ports(*):[31000-32000]; cpus(*):4
I0806 15:19:49.515024 17031 sched.cpp:1748] Asked to stop the driver
I0806 15:19:49.515115 17031 sched.cpp:1032] Stopping framework 
'20150805-204038-16842879-5050-14289-0015'
I0806 15:19:49.515630 17027 sched.cpp:1748] Asked to stop the driver
2015-08-06 
15:19:49,516:17027(0x7f23f610d700):ZOO_INFO@zookeeper_close@2505: Closing 
zookeeper sessionId=0x34da910aab20058 to [9.111.159.76:2181]


Thanks,

Klaus Ma



Re: Review Request 37168: MESOS-3063

2015-08-06 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [37168]

All tests passed.

- Mesos ReviewBot


On Aug. 6, 2015, 8:03 a.m., Klaus Ma wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviews.apache.org/r/37168/
 ---
 
 (Updated Aug. 6, 2015, 8:03 a.m.)
 
 
 Review request for mesos.
 
 
 Bugs: MESOS-3063
 https://issues.apache.org/jira/browse/MESOS-3063
 
 
 Repository: mesos
 
 
 Description
 ---
 
 MESOS-3063 (Add an example framework using dynamic reservation)
 
 
 Diffs
 -
 
   src/examples/dynamic_reservation_executor.cpp PRE-CREATION 
   src/examples/dynamic_reservation_framework.cpp PRE-CREATION 
 
 Diff: https://reviews.apache.org/r/37168/diff/
 
 
 Testing
 ---
 
  Test Steps
 
 Build the example and run in local Mesos cluster
 
  Example Output
 
 I0806 15:19:33.955976 17033 sched.cpp:640] Framework registered with 
 20150805-204038-16842879-5050-14289-0015
 Registered!
 Received offer 20150805-204038-16842879-5050-14289-O161 with mem(*):2862; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):4
 Reserve resources cpus(test, dynamic-reservation-framework-cpp):1; 
 mem(test, dynamic-reservation-framework-cpp):128
 Received offer 20150805-204038-16842879-5050-14289-O162 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-  
 reservation-framework-cpp):128
 Launching task 0 using offer 20150805-204038-16842879-5050-14289-O162
 Task 0 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O163 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 1 using offer 20150805-204038-16842879-5050-14289-O163
 Task 1 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O164 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 2 using offer 20150805-204038-16842879-5050-14289-O164
 Task 2 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O165 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 3 using offer 20150805-204038-16842879-5050-14289-O165
 Task 3 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O166 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Launching task 4 using offer 20150805-204038-16842879-5050-14289-O166
 Task 4 is in state TASK_FINISHED
 Received offer 20150805-204038-16842879-5050-14289-O167 with mem(*):2734; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):3; cpus(test, dynamic-
 reservation-framework-cpp):1; mem(test, dynamic-reservation-framework-cpp):128
 Unreserve resources cpus(test, dynamic-reservation-framework-cpp):1; 
 mem(test, dynamic-reservation-framework-cpp):128
 Received offer 20150805-204038-16842879-5050-14289-O168 with mem(*):2862; 
 disk(*):460240; ports(*):[31000-32000]; cpus(*):4
 I0806 15:19:49.515024 17031 sched.cpp:1748] Asked to stop the driver
 I0806 15:19:49.515115 17031 sched.cpp:1032] Stopping framework 
 '20150805-204038-16842879-5050-14289-0015'
 I0806 15:19:49.515630 17027 sched.cpp:1748] Asked to stop the driver
 2015-08-06 
 15:19:49,516:17027(0x7f23f610d700):ZOO_INFO@zookeeper_close@2505: Closing 
 zookeeper sessionId=0x34da910aab20058 to [9.111.159.76:2181]
 
 
 Thanks,
 
 Klaus Ma