I see what's happening. So it looks like I am only getting one offer, but that offer has multiple cpus resources. One cpus resource for * and another cpus resource for 'role1'. in the same offer. I did not expect this.
So if at registration a framework specifies a role, that framework will receive resources that are reserved for it's role and additionally any resources allocated for default *. If a framework does not specify a role it will only receive offers with default * resources. Based on this I suppose it's up to my framework how it handles these resources when launching a task. 1. Framework can decide only to launch tasks on resources if they match it's 'role1' and decline any offers with only * resources 2. Framework can decide to first launch tasks on * resources, and save the 'role1' resources for last 3. Framework can decide to first use up it's 'role1' resources and then after use the * resources Each of those can impact how well my framework plays with other frameworks. Im trying to figure out how that can be used best to priority up or down. I was not sure how to specify --resources on the slave, whether * should be total cpus of the box and then a role be a subset of that, which would then be managed by the allocator somehow. But if my understanding of the above is correct, it seems that the resources allocated should sum to a total resources of the box. 16 core box --resources='cpus:14;cpus(role1):2' Can someone offer some insight into master --weights setting? I'm not clear how that would work, especially when thinking about what I just wrote above. Radek On Mon, Feb 24, 2014 at 1:27 PM, Brenden Matthews < [email protected]> wrote: > Are you specifying the correct role in the TaskInfo when launching the > task? You would normally receive an offer for the '*' role as well as your > 'role1' role. The offer for '*' would contain whatever resources are > available, and the 'role1' offer would contain the remaining unreserved > resources for that role. Here's a sample of how roles are handled from > Chronos: > > > https://github.com/airbnb/chronos/blob/master/src/main/scala/com/airbnb/scheduler/mesos/MesosTaskBuilder.scala#L31-L52 > > The code above looks for the first resource that is at least as much as > the value required, and uses the role from the resource offer for that task. > > Similarly, here's how it's done with Storm: > > > https://github.com/brndnmtthws/storm-mesos/blob/master/src/storm/mesos/MesosNimbus.java#L435-L519 > > (just grep for 'role'). > > > On Sun, Feb 23, 2014 at 8:32 PM, Radek Burkat <[email protected]> wrote: > >> I'm in the process of rewriting our framework to take account of roles in >> mesos but am having trouble understanding the intended behaviour of roles. >> >> If I have a slave started with --resources='cpus:4;cpus(role1):2' and a >> framework registered with a role of 'role1', the framework start receiving >> the role1 offer of 2 cpus as expected, but when I launch tasks for that >> offer using up all cpus, the framework starts receiving an offer of role >> '*' with 4 cpus while the 'role1' offers are busy / not available. >> >> Is this the intended behaviour? >> >> Is there any documentation on the behaviour of roles, weights, and how >> they are intended to be used/implemented? >> >> >> Radek >> > > -- *RADEK BURKAT **FOUNDER* *//pinkbike <http://www.pinkbike.com/>* *PHONE 1-604-351-2581* *FAX *+1 403 668 0887 *SKYPE radek.burkat* *pb <http://radek.pinkbike.com/> facebook <http://www.facebook.com/pinkbikecom> * *twitter <http://www.twitter.com/pinkbike>* *Confidentiality notice and disclaimer*: The information in this email may be confidential and is intended only for the person or persons to whom it is addressed. If you are not the individual to whom it is addressed, you are warned that any disclosure, copying or dissemination of the information is unauthorized. If you have received the email in error, please immediately contact Pinkbike.com by telephone or email, to inform us of the error. No liability is accepted for any unauthorized use of the information contained in this email.

