Closed skonto closed 8 years ago
Works fine, but I'm not sure about some of the cpu computations.
I propose to merge it and iterate in case there is a better option for the specific computations.
OK, looking deeper, the problem I have is that not much in those tests is role specific.
The things that are role specific:
Not role specific:
spark.cores.max
is respectedThe thing I didn't know, is that Mesos offers also the resources in *
when a role is provided. So in coarse grain, it takes all the available cpus.
What I think could be relevant, would be 2 tests for each mode, one with a role defined, one without a role defined. In the test without a role, only the resources in *
are used. In the test with a role, all the cluster resources are used.
It is pretty straight forward in coarse grain mode, as the resources are just taken at the beginning.
In fine grain mode, it should possible to do a bit like I do in the dynamic allocation tests: to wait, in the RDD transformation that the state of the cluster is what you expect. It requires also to split the RDD in enough partitions to keep busy all the cores.
https://github.com/typesafehub/mesos-spark-integration-tests/pull/46/files#diff-816f85a87cc7a75b49c9d8c088801581R57
In your case, the RDD transformation could return a different value depending if the cluster gets to the 'right' state. Something like -1
if it is wrong the original value if it is right. Then you check that the result of the computation is what you expect. If not, it means something was wrong (not really precise ...).
I set the same standards for what someone should expect for checking role resources no need to mention it again. I havent reviewed your code yet just if it works or not... waiting there is one way... but my proposal is to iterate since this is a first attempt to cover some of the basic cases i found and they are ok... so you can either merge it or freeze it until it is 100% ok or for example someone else has another idea as well...
i will check for improvements...
Let's merge and iterate from there.
Unfortunately I can't merge due to conflicts, but I'd say let's move on with this!
i will work on this along with the merge...
A couple of minor comments, but I would like to understand how the test is supposed to work.
I fixed the issues related to the comments i have one case to resolve. The test logic works as follows, we test spark_only role:
2 slaves x (2 cpus for role (*) + 1 for the role spark_only)= 6
OK, this LGTM. Merging this.