mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Bannier <bbann...@apache.org>
Subject Re: Review Request 63519: Allowed toggling of agent capabilities via command line flags.
Date Tue, 07 Nov 2017 12:26:10 GMT


> On Nov. 7, 2017, 1:08 a.m., Jie Yu wrote:
> > src/slave/main.cpp
> > Lines 377-394 (patched)
> > <https://reviews.apache.org/r/63519/diff/4/?file=1881887#file1881887line377>
> >
> >     You can in fact do this (leverage the existing `protobuf::slave::Capabilities`)

> >     
> >     ```
> >     protobuf::slave::Capabilities capabilities(
> >         flags.agent_features->capabilities());
> >     
> >     if (!capabilities.multiRole ||
> >         !capabilities.hierarchicalRole ||
> >         !capabilities.reservationRefinement) {
> >       return Error("...");
> >     }
> >     
> >     return None();
> >     ```

A `slave::Capabilities` can only be constructed from an iterable of `Capability`, but `flags.agent_features->capabilities`
is an iterable of `Capability::Type`. Let's not pull another helper into this scope just to
allow this conversion.


> On Nov. 7, 2017, 1:08 a.m., Jie Yu wrote:
> > src/slave/slave.cpp
> > Lines 8403 (patched)
> > <https://reviews.apache.org/r/63519/diff/4/?file=1881889#file1881889line8410>
> >
> >     I'd avoid this static helper by just inline the code in the initializer:
> >     ```
> >     capabilities(_flags.agent_features.isNone()
> >       : AGENT_CAPABILITIES()
> >       ? _flags.agent_features->capabilities()),
> >     ```
> 
> Jie Yu wrote:
>     ```
>     capabilities(_flags.agent_features.isNone()
>       : protobuf::slave::Capabilities(AGENT_CAPABILITIES())
>       ? protobuf::slave::Capabilities(_flags.agent_features->capabilities())),
>     ```

A `slave::Capabilities` can only be constructed from an iterable of `Capability`, but `flags.agent_features->capabilities`
is an iterable of `Capability::Type` (chiefly to simplify the flags which need to be passed).
The helper function constructs a `Capability`, and I'd rather keep it than introducing another
global factory.


- Benjamin


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


On Nov. 7, 2017, 1:25 p.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/63519/
> -----------------------------------------------------------
> 
> (Updated Nov. 7, 2017, 1:25 p.m.)
> 
> 
> Review request for mesos, Jie Yu and Jan Schlicht.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch introduces a new agent command line flags
> '--agent_features' which can be used to whitelist capabilities to
> enable. This flag is intended to enable introducing feature flags in
> the future so experimental features can be added while still reducing
> the risk of breaking existing functionality. Currently only the
> 'RESOURCE_PROVIDER' capability can be toggled.
> 
> 
> Diffs
> -----
> 
>   docs/configuration/agent.md 116e7c6b10d6eafdf6a163c821d2204db29f6d4c 
>   src/slave/flags.hpp d02edbfd68266c9f2d5c78fdbd5c2ba5f497adba 
>   src/slave/flags.cpp 789b45b8d84fc01733a885754204fe2fdd6d6807 
>   src/slave/slave.hpp df1b0205124555dcb6a0efa5c237f5e77fa2bdf7 
>   src/slave/slave.cpp 79ee163b41ade93cae1054985379d61faf6a081a 
> 
> 
> Diff: https://reviews.apache.org/r/63519/diff/5/
> 
> 
> Testing
> -------
> 
> `make check`, tested as part of https://reviews.apache.org/r/63496/
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message