{"id":20098829,"url":"https://github.com/mark-5/perl-mesos","last_synced_at":"2025-09-01T06:33:30.461Z","repository":{"id":19948648,"uuid":"23215421","full_name":"mark-5/perl-mesos","owner":"mark-5","description":"Perl bindings for Apache Mesos","archived":false,"fork":false,"pushed_at":"2016-09-03T22:31:43.000Z","size":277,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-25T05:43:56.224Z","etag":null,"topics":["perl"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mark-5.png","metadata":{"files":{"readme":"README.pod","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-22T06:33:17.000Z","updated_at":"2021-02-04T09:13:40.000Z","dependencies_parsed_at":"2022-08-17T15:55:18.970Z","dependency_job_id":null,"html_url":"https://github.com/mark-5/perl-mesos","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/mark-5/perl-mesos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-5%2Fperl-mesos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-5%2Fperl-mesos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-5%2Fperl-mesos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-5%2Fperl-mesos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mark-5","download_url":"https://codeload.github.com/mark-5/perl-mesos/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-5%2Fperl-mesos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273082418,"owners_count":25042282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["perl"],"created_at":"2024-11-13T17:06:52.081Z","updated_at":"2025-09-01T06:33:30.422Z","avatar_url":"https://github.com/mark-5.png","language":"C++","funding_links":[],"categories":["Language Bindings"],"sub_categories":["Experimental/Example/Unsorted"],"readme":"=pod\n\n=head1 NAME\n\nMesos - perl bindings for Apache Mesos\n\n=for html \u003ca href=\"https://travis-ci.org/mark-5/perl-mesos\"\u003e\u003cimg src=\"https://travis-ci.org/mark-5/perl-mesos.svg?branch=master\"\u003e\u003c/a\u003e\n\n=head1 DESCRIPTION\n\nThis 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).\n\n=head2 Dispatchers\n\nMesos uses Mesos::Dispatchers for communicating with the underlying C++ drivers. If a dispatcher does not require any arguments, the short name may be passed, and the dispatcher will be automatically constructed. If a dispatcher is not explicitly passed, Mesos::Dispatcher::AnyEvent will be used.\n\n    my $driver = Mesos::SchedulerDriver-\u003enew(\n        dispatcher =\u003e 'AnyEvent',\n        %args,\n    );\n\n=over 4\n\n=item AnyEvent\n\nMesos writes to a Unix pipe with an attached AnyEvent I/O watcher. This means that perl callbacks for watchers will be executed by the AnyEvent event loop.\n\n=item Interrupt\n\nMesos uses Async::Interrupt callbacks. This means the perl interpreter will be safely interrupted(waits for the current op to finish) in order to execute the corresponding perl callback. See Async::Interrupt for more details on how callbacks are executed. Be aware that this does not interrupt system calls(such as select) and XS code. This means if your code is blocking on a select(such as during an AnyEvent recv), the interrupt callback will not execute until the call has finished.\n\n=item IOAsync\n\nMesos writes to a Unix pipe with an attached IO::Async::Handle.\n\nThe IOAsync dispatcher requires an IO::Async::Loop, and needs to be constructed manually\n\n    my $loop = IO::Async::Loop-\u003enew;\n    my $disp = Mesos::Dispatcher::IOAsync-\u003enew(loop =\u003e $loop);\n    my $driver = Mesos::SchedulerDriver-\u003enew(\n        dispatcher =\u003e $disp,\n        %args,\n    );\n\n=item Mojo\n\nMesos writes to a Unix pipe with an attached Mojo::Reactor watcher.\n\n=item POE\n\nMesos writes to a Unix pipe with an attached POE::Session.\n\n=back\n\n=head2 Logging\n\nLogging is controlled by the PERL_MESOS_TRACE environmental variable. Valid logging levels are ERROR, WARNING, and INFO, which can be referred to by numbers 1, 2, and 3 respectively). PERL_MESOS_TRACE can alse be set to $level=$dir, which will write log files to $dir.\n\n=head2 Protobuf Messages\n\nFrameworks, masters, and slaves all communicate using google protocol buffers. The Mesos module handles protobuf messages using the Google::ProtocolBuffers library, which is what's used to generate the message classes in Mesos::Messages from resources/mesos.proto. It is encouraged to look over Google::ProtocolBuffers documentation before using Mesos.\n\nThe Mesos module ships with message classes generated from v0.20.0. Messages are still backwards compatible with previous versions, but please make sure to check the mesos.proto file from your Mesos installation, to see what fields are and are not allowed.\n\n=head2 Internal POSIX Threads\n\nThe 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 event handlers.\n\nLaunching internal POSIX threads also means that Mesos drivers are not fork safe, 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 after forking.\n\n=head1 SYNOPSIS\n\n    package MyScheduler {\n        use Moo;\n        extends 'Mesos::Scheduler';\n        use Mesos::Messages; # load protobuf messages\n\n        sub resourceOffers {\n                my ($self, $driver, $offers) = @_;\n                for my $offer (@$offers) {\n                    my $task = Mesos::TaskInfo-\u003enew({\n                        # task_id is a Mesos::TaskID message\n                        task_id   =\u003e Mesos::TaskID-\u003enew({value =\u003e \"a unique id\"}),\n                        slave_id  =\u003e $offer-\u003eslave_id,\n                        name      =\u003e \"does something cool\",\n                        # executor is a Mesos::ExecutorInfo message\n                        # Google::ProtocolBuffers will let you pass the constructor args\n                        #  and will instantiate the message for you\n                        executor  =\u003e {\n                            executor_id =\u003e {value =\u003e \"does cool tasks\"},\n                            command     =\u003e {value =\u003e \"/path/to/executor\"},\n                        },\n                        resources =\u003e [\n                            {name =\u003e \"cpus\", type =\u003e Mesos::Value::Type::SCALAR, scalar =\u003e {value =\u003e 1}},\n                            {name =\u003e \"mem\",  type =\u003e Mesos::Value::Type::SCALAR, scalar =\u003e {value =\u003e 32}},\n                        ],\n                    });\n                    $driver-\u003elaunchTasks([$offer-\u003e{id}], [$task]);\n                }\n        }\n    };\n\n    use Mesos::SchedulerDriver;\n    my $driver = Mesos::SchedulerDriver-\u003enew(\n        master    =\u003e \"mesoshost:5050\",\n        framework =\u003e {user =\u003e \"mesos user\", name =\u003e \"awesome framework\"},\n        scheduler =\u003e MyScheduler-\u003enew,\n    );\n    $driver-\u003erun;\n\n=head1 INSTALL\n\nFirst make sure the apache mesos library is installed. This is easiest either with your native package manager, or with a package from L\u003cmesosphere|http://mesosphere.io/downloads/\u003e.\n\nMake sure Google Protocol Buffers headers are installed, and the version is compatible with your Mesos installation.\n\nNext just install like any other Module::Build distribution with C\u003cperl Build.PL \u0026\u0026 ./Build install\u003e\n\nNote that Mesos before v0.20 has issues with include headers not being very smart(L\u003cMESOS-1504|https://issues.apache.org/jira/browse/MESOS-1504\u003e). Compiling against these earlier versions requires explicitly including the directory for mesos headers. By default Makefile.PL will check /usr/local/include/mesos, otherwise you may need to specify an include path using the PERL_MESOS_INCLUDE env var.\n\nIf the Mesos library/headers are installed in non-standard locations, you will need to specify these paths using the PERL_MESOS_LIB and PERL_MESOS_INCLUDE env vars.\n\n=head1 CAVEATS\n\nBe 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.\n\n=head1 TODO\n\n=over 4\n\n=item maybe work on pure perl drivers\n\n=back\n\n=head1 SEE ALSO\n \nMore information about Apache Mesos, projects using Mesos, or the underlying Mesos drivers can be found at the Apache Mesos project's L\u003chome page|http://mesos.apache.org/\u003e or L\u003cmesosphere|http://mesosphere.io\u003e. \n\n=head1 AUTHOR\n\nMark Flickinger E\u003clt\u003emaf@cpan.orgE\u003cgt\u003e\n\n=head1 LICENSE\n\nThis software is licensed under the same terms as Perl itself.\n\n\n=cut\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark-5%2Fperl-mesos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmark-5%2Fperl-mesos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark-5%2Fperl-mesos/lists"}