{"id":21293139,"url":"https://github.com/criteo/mesos-modules-ruby","last_synced_at":"2026-05-20T19:35:00.977Z","repository":{"id":143044998,"uuid":"120746986","full_name":"criteo/mesos-modules-ruby","owner":"criteo","description":"A simple way to use ruby script as mesos modules","archived":false,"fork":false,"pushed_at":"2018-03-02T17:27:09.000Z","size":56,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":11,"default_branch":"master","last_synced_at":"2026-04-21T03:20:46.385Z","etag":null,"topics":["isolator","mesos","mesos-isolator","mesos-modules","ruby"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/criteo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-08T10:30:40.000Z","updated_at":"2018-12-17T13:01:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"b1a49c35-b9f2-4bb7-b64e-2426b4126f5f","html_url":"https://github.com/criteo/mesos-modules-ruby","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/criteo/mesos-modules-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criteo%2Fmesos-modules-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criteo%2Fmesos-modules-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criteo%2Fmesos-modules-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criteo%2Fmesos-modules-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/criteo","download_url":"https://codeload.github.com/criteo/mesos-modules-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/criteo%2Fmesos-modules-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33272485,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-20T15:12:43.734Z","status":"ssl_error","status_checked_at":"2026-05-20T15:12:42.300Z","response_time":356,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["isolator","mesos","mesos-isolator","mesos-modules","ruby"],"created_at":"2024-11-21T13:53:31.395Z","updated_at":"2026-05-20T19:35:00.958Z","avatar_url":"https://github.com/criteo.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Mesos Modules Ruby\n\nThis repository is a collection of **experimental** mesos modules to call ruby scripts implementing hooks.\n\nThis project is not battle-tested, use it at your own risk.\n\n## Build Instructions\n\n```shell\n    $ export MESOS_BUILD_DIR=[ directory where Mesos was BUILT, e.g. ~/repos/mesos/build ]\n    $ mkdir build\n    $ cd build\n    $ cmake ..\n    $ make\n    $ ./test_rmodules ../tests/mesos_modules.rb\n```\n\n## Scripting Documentation\n\nExample available in ./tests/mesos_modules.rb\n\n### Ruby based Mesos Hook\n\nRubyHook is currently expecting the following API from the attached Ruby script:\n\n```ruby\n    def slaveRunTaskLabelDecorator taskinfo\n        ...             # read and modify taskinfo fields or\n        ...             # taskinfo sub-classes, esp. Labels\n        return taskinfo # mandatory!\n    end\n    \n    def slaveRemoveExecutorHook execinfo\n        ...\n        # no return value\n    end\n```\n\nBoth `taskinfo` and `execinfo` are hashes filled from equivalent C++ classes.\nFor instance, you can get the name of a task with `taskinfo[\"name\"]` and access\nthe labels kv-pairs through `taskinfo[\"labels\"]` as a string-string hash. \n\n### Ruby based Mesos Isolator\n\nCurrent implemenation supports the prepare and cleanup callback of the mesos isolator\nFor details on the Isolator interface, please check directly the source code:\n https://github.com/apache/mesos/blob/master/include/mesos/slave/isolator.hpp\n\n```ruby\n  def isolator_prepare params\n    # Params contains the container_id, user,\n    # and environment (pre-launch w/o for example the actual mesos-slave inject environment!)\n\n    return {\"pre_exec_commands\" =\u003e [{\"value\" =\u003e \"touch /tmp/rb_isolator\"}]} # pre exec commands\n  end\n\n  def isolator_cleanup params\n    # params: hash containing a container_id\n  end\n```\n\n## Deployement \u0026 Configuration\n\nThis library supports a single source Ruby script, for both supported module interfaces: hook and isolation.\nThe hook and isolation modules both supports the `script_path` parameter, and shall be pointing to the same script.\nThe library will, on purpose, only take into account the first `script_path` processed.\n\nThis is done on purpose to make it explicit that all modules (hook and isolator) will run in the same \nruby context (single vm/process).\n\nExample of json configuration file in examples sub-folder.\nDon't forget to add `com_criteo_mesos_RubyIsolator` to the list of slave's activated isolators\n(--isolation=\"...,com_criteo_mesos_RubyIsolator\") \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcriteo%2Fmesos-modules-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcriteo%2Fmesos-modules-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcriteo%2Fmesos-modules-ruby/lists"}