mesos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Rukletsov <a...@mesosphere.com>
Subject Re: Custom Mesos Allocation module
Date Mon, 08 Jun 2015 15:39:44 GMT
Hi Dariia,

interesting! I think you can actually subclass the Hierarchical allocator,
but you need access to Mesos sources (quick check of your code hints you
need it nevertheless since you build unbundled Mesos).

What protobufs do you plan to send to your Go server? Allocator maintains a
list of available resources and registered frameworks and periodically
makes offers. Also, in your design it looks like if the Go server becomes
unavailable, there will be no offers made.

On Fri, May 29, 2015 at 3:20 PM, Dariia Zhyrova <dzhyrova@cogniance.com>
wrote:

> Hi Alex,
>
> My task was to create allocator which produces information about all
> protobufs it receives to Kafka (prior to actual resources allocation). Here
> is the implementation: https://github.com/stealthly/alligator. I had to
> copy-paste Hierarchical allocator from Mesos sources since unfortunately
> there is no possibility to inherit from it (or use in other way) outside
> Mesos.
> Further I will need to implement a custom allocator which sends all
> protobufs to Go server and then receives them back (changed in some way).
> In this way it is expected to customize allocation process using Go, not
> C++.
>
> Best regards,
> Dariia
>
> On Thu, May 28, 2015 at 2:54 PM, Alex Rukletsov <alex@mesosphere.com>
> wrote:
>
> > Dariia,
> >
> > I'm excited to see people hacking on allocation algorithms in Mesos! May
> I
> > ask you to share some information about what custom allocation policy do
> > you use? What is the motivation?
> >
> > Thanks,
> > Alex
> >
> > On Wed, May 27, 2015 at 8:32 PM, Dariia Zhyrova <dzhyrova@cogniance.com>
> > wrote:
> >
> > > Thank you very much! I used an old Mesos version indeed. Using custom
> > > allocator module works just fine.
> > > Best reagrds,
> > > Dariia
> > >
> > > On Tue, May 26, 2015 at 6:39 PM, Alex Rukletsov <alex@mesosphere.com>
> > > wrote:
> > >
> > > > Dariia,
> > > >
> > > > what Mesos version are you using? The ability to write and and use
> > custom
> > > > allocator modules without hacking on Mesos source code has just
> landed
> > in
> > > > Mesos (means will be available in 0.23 release) with docs being
> updated
> > > > right now (here <https://reviews.apache.org/r/34545/> is the RR
> > request
> > > if
> > > > you really want to be on the bleeding edge).
> > > >
> > > > However, if you're on an older version of Mesos, you can still write
> > your
> > > > own module and replace / adjust the line you refer to in
> > master/main.cpp
> > > to
> > > > support your custom allocator.
> > > >
> > > > On Mon, May 25, 2015 at 1:18 PM, Dariia Zhyrova <
> > dzhyrova@cogniance.com>
> > > > wrote:
> > > >
> > > > > Hello,
> > > > >
> > > > > I need to write custom Allocation module, but I don't see a
> > possibility
> > > > to
> > > > > load it dynamically using --modules command line argument.
> > > > > This is the allocation module creation in master/main:
> > > > >
> > > > > allocator::Allocator* allocator = new
> > > > > allocator::HierarchicalDRFAllocator();
> > > > >
> > > > > (so it is just hardcoded)
> > > > > Other modules are loaded dynamically like this:
> > > > >
> > > > > if (flags.modules.isSome()) {
> > > > >     Try<Nothing> result = ModuleManager::load(flags.modules.get());
> > > > >     if (result.isError()) {
> > > > >       EXIT(1) << "Error loading modules: " << result.error();
> > > > >     }
> > > > >   }
> > > > > ...
> > > > > // Create anonymous modules.
> > > > >   foreach (const string& name, ModuleManager::find<Anonymous>())
{
> > > > >     Try<Anonymous*> create =
> ModuleManager::create<Anonymous>(name);
> > > > >     if (create.isError()) {
> > > > >       EXIT(1) << "Failed to create anonymous module named '"
<<
> name
> > <<
> > > > > "'";
> > > > >     }
> > > > > ...
> > > > > Authenticator* authenticator;
> > > > >   // TODO(tillt): Allow multiple authenticators to be loaded and
> > enable
> > > > >   // the authenticatee to select the appropriate one. See
> MESOS-1939.
> > > > >   if (authenticatorNames[0] == DEFAULT_AUTHENTICATOR) {
> > > > >     LOG(INFO) << "Using default CRAM-MD5 authenticator";
> > > > >     authenticator = new cram_md5::CRAMMD5Authenticator();
> > > > >   } else {
> > > > >     Try<Authenticator*> module =
> > > > >
> > > >
> modules::ModuleManager::create<Authenticator>(authenticatorNames[0]);
> > > > >     if (module.isError()) {
> > > > >       EXIT(1) << "Could not create authenticator module '"
> > > > >               << authenticatorNames[0] << "': " <<
module.error();
> > > > >     }
> > > > > ...
> > > > > if (ModuleManager::contains<Isolator>(type)) {
> > > > >       Try<Isolator*> isolator =
> > ModuleManager::create<Isolator>(type);
> > > > >       if (isolator.isError()) {
> > > > >         return Error(
> > > > >             "Could not create isolator " + type + ": " +
> > > > isolator.error());
> > > > >       }
> > > > >
> > > > > This is a list of supported modules which can be loaded
> dynamically:
> > > > >  kindToVersion["Anonymous"] = MESOS_VERSION;
> > > > >   kindToVersion["Authenticatee"] = MESOS_VERSION;
> > > > >   kindToVersion["Authenticator"] = MESOS_VERSION;
> > > > >   kindToVersion["Hook"] = MESOS_VERSION;
> > > > >   kindToVersion["Isolator"] = MESOS_VERSION;
> > > > >   kindToVersion["TestModule"] = MESOS_VERSION;
> > > > >
> > > > > If allocation module is absent here, it will not pass such check:
> > > > >
> > > > > Try<Nothing> ModuleManager::verifyModule(
> > > > >     const string& moduleName,
> > > > >     const ModuleBase* moduleBase)
> > > > > {
> > > > > ...
> > > > > if (!kindToVersion.contains(moduleBase->kind)) {
> > > > >     return Error("Unknown module kind: " +
> > > stringify(moduleBase->kind));
> > > > >   }
> > > > > ...
> > > > > }
> > > > >
> > > > > Mesos documentation also does not mention Allocation module as
> > > > dynamically
> > > > > loadable:  http://mesos.apache.org/documentation/latest/modules/
> > > > >
> > > > > Could you please help me, is there a possibility to use custom
> > > allocation
> > > > > module with Mesos?
> > > > >
> > > > > Best regards,
> > > > > Dariia
> > > > >
> > > >
> > >
> >
>

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