[ 
https://issues.apache.org/jira/browse/MESOS-3366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14734386#comment-14734386
 ] 

Klaus Ma commented on MESOS-3366:
---------------------------------

Prefer to script; because lots of developer/operators are NOT good at C\+\+, 
it'll be hard for them to build a strong C\+\+ module to detect 
resources/attributes; and the only interaction with Mesos is its output which 
can be handled well by script.

{quote}
    If we continue down this path, in addition to --ip_discovery_command we 
might end up with --resources_script and then --attributes_script and possibly 
--topology_script, etc.
{quote}
Module have the similar concern: will provide several interfaces. But we can 
design the output format to cover them, for example, 
{{ip:ip_discovery_command.sh, resources:resources_script.sh, topology: 
topology_script.sh}} 

{quote}
    If the script simply outputs the discovered resources on stdout, there is a 
risk that it will print a malformed output (because of a bug, or a version 
mismatch). The interaction looks fragile, you have no way of checking version 
compatibility. It might be acceptable for an IP address, but it sounds risky 
for something more complex like resources.
{quote}
It maybe worse for module, for example, keeping crash and the core file 
consumer the whole disk. For the compatibility, it depends on our design.

{quote}
    You can already do that, without having to run an arbitrary script inside 
mesos: {{mesos-master --resources=`discover_resources.sh`}}
{quote}
Not sure the case.

{quote}
    You still cannot compose multiple scripts or override the values detected 
by default (see above).
{quote}
Both module & script need to build a wrapper to merge the output; but script is 
easier to develop, e.g. it's easy for Python to parse the output of each script 
and merge them together.

> Allow resources/attributes discovery
> ------------------------------------
>
>                 Key: MESOS-3366
>                 URL: https://issues.apache.org/jira/browse/MESOS-3366
>             Project: Mesos
>          Issue Type: Improvement
>          Components: slave
>            Reporter: Felix Abecassis
>
> In heterogeneous clusters, tasks sometimes have strong constraints on the 
> type of hardware they need to execute on. The current solution is to use 
> custom resources and attributes on the agents. Detecting non-standard 
> resources/attributes requires wrapping the "mesos-slave" binary behind a 
> script and use custom code to probe the agent. Unfortunately, this approach 
> doesn't allow composition. The solution would be to provide a hook/module 
> mechanism to allow users to use custom code performing resources/attributes 
> discovery.
> Please review the detailed document below:
> https://docs.google.com/document/d/15OkebDezFxzeyLsyQoU0upB0eoVECAlzEkeg0HQAX9w
> Feel free to express comments/concerns by annotating the document or by 
> replying to this issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to