Giter Site home page Giter Site logo

eremetic's Introduction

EremeticBuild Status

Eremetic is a Mesos Framework to run one-shot tasks.

Usage

Send a cURL to the eremetic framework with how much cpu and memory you need, what docker image to run and which command to run with that image.

curl -H "Content-Type: application/json" \
     -X POST \
     -d '{"task_mem":22.0, "task_cpus":1.0, "docker_image": "a_docker_container", "command": "rails"}' \
     http://eremetic_server:8080/task

JSON format:

{
  // Float64, fractions of a CPU to request
  "task_cpus":      1.0,
  // Float64, memory to use (MiB)
  "task_mem":       22.0,
  // String, full tag or hash of container to run
  "docker_image":   "busybox",
  // String, command to run in the docker container
  "command": "echo date",
  // Array of Objects, volumes to mount in the container
  "volumes": [
    {
      "container_path": "/var/run/docker.sock",
      "host_path": "/var/run/docker.sock"
    }
  ],
  // Object, Environment variables to pass to the container
  "env": {
    "KEY": "value"
  },
  // String, URL to post a callback to. Callback message has format: 
  // {"time":1451398320,"status":"TASK_FAILED","task_id":"eremetic-task.79feb50d-3d36-47cf-98ff-a52ef2bc0eb5"}
  "callback_uri": "http://callback.local"
}

Note

Most of this meta-data will not remain after a full restart of Eremetic.

Configuration

create /etc/eremetic/eremetic.yml with:

address: 0.0.0.0
port: 8080
master: zk://<zookeeper_node1:port>,<zookeeper_node2:port>,(...)/mesos
messenger_address: <callback address for mesos>
messenger_port: <port for mesos to communicate on>

Building

Environment

Clone the repository into $GOCODE/src/github.com/klarna/eremetic. This is needed because of internal package dependencies

Install dependencies

First you need to install dependencies. Parts of the eremetic code is auto-generated (assets and templates for the HTML view are compiled). In order for go generate to work, go-bindata and go-bindata-assetfs needs to be manually installed.

go get github.com/jteeuwen/go-bindata/...
go get github.com/elazarl/go-bindata-assetfs/...
go generate
go get -t ./...

Creating the docker image

To build a docker image with eremetic, simply run

make docker

Running on mesos

Eremetic can itself by run on mesos using e.g marathon. An example configuration for marathon is provided that is ready to be submitted through the api.

curl -X POST -H 'Content-Type: application/json' $MARATHON/v2/apps -d@misc/eremetic.json

Running tests

The tests rely on GoConvey, and can be run either by running goconvey or go test ./... from the project root.

Contributors

  • Rickard Dybeck
  • David Keijser

Acknowledgements

Thanks to Sebastian Norde for the awesome logo!

Licensing

Apache-2

eremetic's People

Contributors

alde avatar keis avatar gengmao avatar

Watchers

Zo-Hasina Rasatavohary avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.