Search code examples
frameworksmesosexecutormarathon

Running Marathon with Mesos's example frameworks


I want to launch Mesos's exameple frameworks such as test_framework, long_lived_framework in /mesos/src/example with marathon. or I want to launch dummy tasks with using a same executor.

But I don't know how to do it.

please help me.


Solution

  • Marathon needs some URI to fetch binaries for running the task. Compile the application put it into an archive, e.g. apps.tar.gz (if it's single binary, no need to pack it). Upload the archive on an HTTP server, that is available from all slave nodes. Then submit an app into Marathon (you can do this in web GUI or using API from command line):

    # Save the following json as app.json
    {
      "id": "/test_framework",
      "instances": 1,
      "cpus": 0.1,
      "mem": 5m,
      "cmd": "./test_framework",
      "uris": [
        "http://my.apps.store/apps.tar.gz"
      ],
    }
    

    From any node which can reach Marathon API submit the app:

    curl -X POST [email protected] -H "Content-Type: application/json" http://marathon.service:8080/v2/apps
    

    Mesos slave will fetch the tar archive, unpack it into working folder of the task and run the command you supplied as cmd parameter.