since until

Marathon Dreamin'

It’s weekend… so I allow myself this silly post. Every time, I play around with Mesos, Marathon and/or Kubernetes I feel like I’m the star in my very own Inception adventure1.

Disclaimer: Only continue if you can stand bull:shit:ing at this moment. The music should get you in the mood while reading :wink:.

Level 0

Some call this reality. Some believe this is also just dream. If that were true I figure we’d probably call the dreamer god. Anyways, I just turn on my computer at this level. Nothing fancy yet.

Level 1

Computer is on. I’m plugged in (sorry for the Matrix reference, don’t want to confuse).

Level 2

At this level, I enter my VM, being an instance in the cloud or the kitten purring in Virtualbox (vagrant up; vagrant ssh).

Level 3

Mesos, the place where the frameworks are fired up, drops us one notch deeper down the dream pipeline.

One could start a task that lasts at least 10 seconds in Mesos.

mesos-execute --master=$MASTER --name="envie" --command="echo env; sleep 10"

This task would run as a framework (a short-lived one at that).

By visiting the Marathon portal (most likely running on port 5050 on the Mesos master), navigating to the frameworks view and selecting the most recently terminated framework (provided that the 10 seconds have already expired :wink:) one can enter the job’s sandbox o observe the output to stderr and stdout.

The Mesos frameworks view allows one to observe running and terminated frameworks

Mesos jobs are executed from the directory and environment in which the mesos-execute command is called. In stdout we expect to see something that resembles env on the Mesos slave.

Level 4

Marathon is started as a Mesos framework, which drops us down another level. Upon adding another Marathon job, the framework (being Marathon) manages the environment in which the call is executed.

Adding a Marathon job

By adding a Marathon job that echoes env and observing the stdout from the task’s sandbox one can verify that the env differs from the host’s.

Selecting the task’s sandbox and opening the task’s stdout (both screens portrayed in the following figures) allows us to introspect stdout for the task of interest.

The mesos portal allows one to get into the job's sandbox
A look inside the Mesos sandbox allows one to view the job's stderr and stdout

Marathon provides us with extra management functionality as in easily scaling, suspending and resuming of jobs. That is why it makes sense to start jobs from Marathon instead of firing them directly into Mesos. We run frameworks in Mesos, we run jobs in Marathon (which is a framework)… that simple.


If you made it this far, thank you so much for your time.

Enough of the Inception :shit: (err junk or analogy), you may say at this stage. I don’t even fully remember what Inception was all about other than some convoluted mess involving nested dreams; after all 2010 is a lifetime ago (for a toddler it actually is).

All I wanted to say is: Mesos rocks, Marathon rocks and life is good.

For now… more Inception junk for the weekend. Have a good one :tropical_drink:

  1. Before 2010 (premiere of Inception) it happened to be The Matrix :sunglasses: