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)
- 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
- vagrant-omnibus
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
.
$ go get github.com/icsnju/apt-mesos
$ cd $GOPATH/src/github.com/icsnju/apt-mesos
$ go build
$ cd vagrant
$ vagrant up
$ ./apt-mesos --master=<mesos_addr> --addr=<server_listened_addr>
Open your browser and visit http://<server_listened_addr>
, then you can create a task easily and fetch the test results.
$ curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" <server_listened_addr>/api/tasks -d@task.json
{
"cmd": "sh /data/ping.sh",
"cpus": "1",
"mem": "16",
"docker_image": "busybox",
"volumes": [
{
"container_path":"/data",
"host_path":"/vagrant"
}
]
}
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")
We provide a simple WEBUI, welcome to fork the code https://github.com/JetMuffin/sher-frontend and contribute to this project!