Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 979
Sander Smits Avatar asked Aug 11 '15 09:08

Sander Smits


People also ask

What is Apache Mesos and Marathon?

Marathon is a production-proven Apache Mesos framework for container orchestration, providing a REST API for starting, stopping, and scaling applications. Written in Scala, Marathon can run in highly-available mode by running multiple copies. The state of running tasks gets stored in the Mesos state abstraction.

What is the difference between mesos and Kubernetes?

Mesos supports any type of workload -- containerized or not -- while Kubernetes is designed specifically for containerized applications. It's technically possible to run non-containerized applications on Kubernetes by deploying them to a VM and running them inside a Kubernetes cluster with an add-on, such as KubeVirt.

Which of the following is the basic feature of Marathon?

A Basic Overview of Marathon It has many features that simplify running applications in a clustered environment, such as high-availability, node constraints, application health checks, an API for scriptability and service discovery, and an easy to use web user interface.

Which framework is used by Mesos to schedule containers?

Mesosphere has developed a framework for running Google's open source container scheduler on top of a Mesos cluster. This allows you to run Kubernetes alongside other Mesos frameworks such as Spark. Marathon is an open source framework for Mesos developed and maintained by Mesosphere.


1 Answers

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.

like image 135
Mik Avatar answered Sep 24 '22 21:09

Mik