Search code examples
mesosmarathon

How to run a one-off task with Apache Mesos/Marathon?


I'm trying to run a one-off task with Marathon. I'm able to get the task container running, but after the task command completes, marathon runs another task, and so on. How can I prevent Marathon from running more than one task/command?

Or, if this is not possible with Marathon, how can I achieve the desired behaviour?


Solution

  • As a hack you can kill a marathon task at the end, as suggested here: https://github.com/mesosphere/marathon/issues/344#issuecomment-86697361

    As rukletsov already mentioned - Marathon is desigend for long-running tasks: https://stackoverflow.com/a/26647789/1047843

    If Chronos doesn't fit in your situation you can use Jenkins with Mesos plugin: https://github.com/jenkinsci/mesos-plugin

    Or you can try to talk with Mesos directly and write you own framework: http://mesos.apache.org/documentation/latest/app-framework-development-guide/

    In my opinion the two easiest options would be Chronos and Jenkins.