/apt-mesos

A Mesos Framework which provides an easy way to build job environment and schedule tasks in a multi-node cluster, written in Go.

Primary LanguageGo

apt-mesos

Travis

Apt-Mesos is a Mesos Framework for Testing which provides an easy way to build testing environment and schedule testing tasks in a multi-node cluster.

The latest version is 0.2.0, which support:

  • Use RESTful API to submit, list, delete, kill tasks
  • Measure cluster's metrics(cpus, mem, disk) Other features will be added in later versions.
  • WEBUI (updated on version 0.2.0)

Prerequisites

  • golang (nessesary)
  • vagrant
  • VirtualBox
  • vagrant plugins
    • vagrant-omnibus $ vagrant plugin install vagrant-omnibus
    • vagrant-berkshelf $ vagrant plugin install vagrant-berkshelf
    • vaggrant-hosts $ vagrant plugin install vagrant-hosts

Note: You should build a Mesos environment first. We provide Vagrantfile and some scripts to help you build Mesos Cluster easily (thanks to everpeace/vagrant-mesos), or you can use playa-mesos to build Mesos Standalone .

Installation

Compile source code

$ go get github.com/icsnju/apt-mesos
$ cd $GOPATH/src/github.com/icsnju/apt-mesos
$ go build

Build Mesos cluster

$ cd vagrant
$ vagrant up

Usage

Start server

$ ./apt-mesos --master=<mesos_addr> --addr=<server_listened_addr>

AM WebUI

Open your browser and visit http://<server_listened_addr>, then you can create a task easily and fetch the test results.

Submit a task:

$ curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" <server_listened_addr>/api/tasks -d@task.json

Task format

{
    "cmd": "sh /data/ping.sh",
    "cpus": "1",
    "mem": "16",
    "docker_image": "busybox",
    "volumes": [
        {
            "container_path":"/data",
            "host_path":"/vagrant"
        }
    ]
}

Complete usage:

Usage of ./apt-mesos:
  -addr string
    	Address to listen on <ip:port> (default "127.0.0.1:3030")
  -debug
    	Run in debug mode
  -master string
    	Master to connect to <ip:port> (default "127.0.0.1:5050")

Hack the WEBUI

We provide a simple WEBUI, welcome to fork the code https://github.com/JetMuffin/sher-frontend and contribute to this project!

Contributors

JetMuffin