A testable Mesos cluster on minimesos and AWS;
A testable Mesos cluster on minimesos and AWS;

Minimesos on AWS

Example of minimesos on aws
Whilst creating our reference microservices application for Weave, I wanted to use minimesos as a controlled Mesos environment for demos and testing. The key benefit for this use case was the static definition of the Mesos environment. The stability not only helps during integration testing, but also during user experiments. I can (almost) guarantee that the demonstration will work for them.

But the testing requirement forced me to use cloud infrastructure as my host. This post describes how I used minimesos on AWS.

Provisioning

I used Terraform to perform the provisioning step. The goal was to start a single AWS instance with enough grunt to power minimesos and the application. All the code is available on github in the microservices repository.

The Terraform scripts are typical, so I won’t describe them verbatim. But I would like to highlight a few key points. In the aws.tf script, I’ve specifically chosen to use Ubuntu 14.04, a rather old version of Ubuntu, due to package support for Mesos and Docker. In other versions there would be support for one, but not for the other. This will undoubtedly change over time.

The script opens all TCP ports to the world. Despite the obvious security hole, I’m convinced that the simplicity is more important. On many occasions I’ve had to view the Mesos UI, or curl one of the microservices on some unspecified port. I doubt that this is ever a problem because the nature of the test environment is that it will only be alive for a few minutes and there is no sensitive information there.

In the main.tf script, the Ireland AWS region is selected and then starts the provision.sh bash script.

The provisioning script starts by installing some dependencies, then installs the Docker engine.

Next, it installs minimesos from the helpful install script and copies the binary into a folder that is accessible by all users:

This is necessary because Docker installed under root, so we need to run minimesos as root in order to access Docker. By default, the minimesos script installs as the current user.

Next, the script installs items required by the microservices application and checks out the project. You may want to remove this, or replace with your project.

Weave Net is a software defined network that we are using to provide networking features within this demo. I encourage the reader to check it out.

Now that the infrastructure is in place, we need to deploy minimesos and the demo application.

Deployment

The provisioning script will call a deployment script located elsewhere in the repository. But to summarise it performs the following steps.

The first command initialises the working directory with a minimesosFile, the configuration file that specifies the architecture of the upcoming Mesos cluster. The second command starts minimesos. It will take a moment to download the images.

Next, the script can obtain the ip addresses of the running minimesos cluster with a little bash foo:

This will add the typical minimesos environmental variables to the current session. Finally, you can submit your application via marathon in the usual way. This code is taken from the mesos-marathon deployment script in the microservices repository.

Try it!

If you’d like to try this yourself, feel free to test the reference microservices application. Simply clone the microservices repository and navigate to the minimesos-aws installation folder. Export the following variables that provide the scripts with your AWS credentials:

Then simply:

The ip addresses will be printed at the end of the provisioning step. Alternatively, here is a demo I recorded performing the same steps.

If you have any problems, please get in touch via Github. If you’d like some help with your application, all of us at Container Solutions would love to help.

The following two tabs change content below.

Philip Winder

Phil Winder is a multi-disciplinary consultant architect that specialises in the Research and Development of cutting edge technology. His expertise lies between the boundaries of Software Development and Machine Learning. Describing himself simply as an “Engineer”, he has 10 years experience in a wide range of Engineering disciplines (7 years software and machine learning, 3 years production electronics). Phil has Ph.D. and Masters degrees from the University of Hull, U.K. These were in Electronics, with a focus on embedded signal processing.

Latest posts by Philip Winder (see all)

Leave a Reply

Your email address will not be published. Required fields are marked *