Name

Mesos - perl bindings for Apache Mesos

Description

This is a collection of perl bindings for Apache Mesos. This requires having the mesos shared library installed, in order to link against(much like python's mesos library).

The Apache Mesos library is multithreaded, which is problematic when dealing with perl. The solution Mesos currently goes with is to create C++ proxy classes, which registers callbacks that send notifications over a pipe, to perl. In the future this may change to sockets, or even to a pure perl implementation of mesos drivers(the latter would also eliminate the need for linking against the mesos shared library). Mesos then handles these notifications, and executes the corresponding perl code, inside of an AnyEvent loop.

Install

First make sure the apache mesos library is installed. This is easiest either with your native package manager, or with a package from mesosphere.

Install Google Protocol Buffers v2.5.0+.

Next just install like any other Module::Build distribution with perl Build.PL && ./Build install

Note that Mesos before v0.20 has issues with include headers not being very smart(MESOS-1504). Compiling against these earlier versions requires explicitly including the directory for mesos headers. By default Build.PL will check /usr/local/include/mesos, but you will be prompted to enter another path if that directory does not exist.

Caveats

Be aware that Mesos drivers are not able to talk to remote servers from behind a NAT. Drivers are required to start an http server that the mesos master will send post requests to.

Mesos is not fork safe. The underlying Mesos driver creates multiple threads during construction, and only exec and POSIX::_exit can be guaranteed to work safely in the child process after forking. One should definitely not call any driver code in the child process.

TODO

create perl friendly types/coercions for Mesos::Messages classes
maybe work on pure perl drivers

See Also

More information about Apache Mesos, projects using Mesos, or the underlying Mesos drivers can be found at the Apache Mesos project's home page or mesosphere.