├── server ├── assets │ └── .gitkeep ├── static │ ├── images │ │ ├── favicon.ico │ │ ├── eremiteLOGO_01.png │ │ ├── eremiteLOGO_02.png │ │ ├── disappointed_minion.png │ │ ├── cpu.svg │ │ └── ram.svg │ ├── css │ │ ├── themes │ │ │ └── default │ │ │ │ └── assets │ │ │ │ └── fonts │ │ │ │ ├── icons.ttf │ │ │ │ ├── icons.woff │ │ │ │ ├── icons.woff2 │ │ │ │ ├── fontcustom_cb066050d5b786186aa0e7f121427d8b.eot │ │ │ │ ├── fontcustom_cb066050d5b786186aa0e7f121427d8b.ttf │ │ │ │ ├── fontcustom_cb066050d5b786186aa0e7f121427d8b.woff │ │ │ │ └── fontcustom_cb066050d5b786186aa0e7f121427d8b.svg │ │ └── style.css │ └── js │ │ ├── serialize_object.min.js │ │ └── task_view.js ├── generate.go ├── templates │ ├── error_401.html │ ├── error_404.html │ ├── index.html │ └── task.html ├── formatter_test.go ├── formatter.go ├── routes_test.go ├── routes_v0.go ├── routes_v1.go ├── routes.go ├── helpers_test.go ├── helpers.go ├── server_test.go └── handler.go ├── api ├── version.go ├── route.go ├── api_test.go ├── api_v0.go └── api_v1.go ├── dcos ├── icon-eremetic-large.png ├── icon-eremetic-medium.png ├── icon-eremetic-small.png ├── icon-eremetic-large@2x.png ├── icon-eremetic-medium@2x.png └── icon-eremetic-small@2x.png ├── .gitignore ├── version └── version.go ├── misc ├── docker.sh ├── eremetic.json └── swagger.yaml ├── docker ├── marathon.sh └── Dockerfile ├── eremetic.yml.example ├── scheduler.go ├── config ├── config_test.yml ├── config_test.go └── config.go ├── LICENSE ├── cmd ├── hermit │ └── README.md └── eremetic │ ├── eremetic_test.go │ └── eremetic.go ├── zk ├── zk_connector.go ├── zk_connection.go └── zookeeper.go ├── boltdb ├── bolt_connector.go ├── bolt_connection.go ├── boltdb.go └── boltdb_test.go ├── mesos ├── driver_test.go ├── extractor.go ├── builders.go ├── reconcile_test.go ├── extractor_test.go ├── reconcile.go ├── driver.go ├── match.go ├── match_test.go └── task.go ├── .travis.yml ├── callback.go ├── metrics └── metrics.go ├── go.mod ├── callback_test.go ├── Makefile ├── examples.md ├── database.go ├── mock ├── mock.go └── mesos_scheduler.go ├── client ├── client_test.go └── client.go └── README.md /server/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /api/version.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | // API Version constants 4 | const ( 5 | V0 = "apiv0" 6 | V1 = "apiv1" 7 | ) 8 | -------------------------------------------------------------------------------- /dcos/icon-eremetic-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/dcos/icon-eremetic-large.png -------------------------------------------------------------------------------- /dcos/icon-eremetic-medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/dcos/icon-eremetic-medium.png -------------------------------------------------------------------------------- /dcos/icon-eremetic-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/dcos/icon-eremetic-small.png -------------------------------------------------------------------------------- /dcos/icon-eremetic-large@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/dcos/icon-eremetic-large@2x.png -------------------------------------------------------------------------------- /dcos/icon-eremetic-medium@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/dcos/icon-eremetic-medium@2x.png -------------------------------------------------------------------------------- /dcos/icon-eremetic-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/dcos/icon-eremetic-small@2x.png -------------------------------------------------------------------------------- /server/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/server/static/images/favicon.ico -------------------------------------------------------------------------------- /server/static/images/eremiteLOGO_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/server/static/images/eremiteLOGO_01.png -------------------------------------------------------------------------------- /server/static/images/eremiteLOGO_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/server/static/images/eremiteLOGO_02.png -------------------------------------------------------------------------------- /server/static/images/disappointed_minion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/server/static/images/disappointed_minion.png -------------------------------------------------------------------------------- /server/static/css/themes/default/assets/fonts/icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/server/static/css/themes/default/assets/fonts/icons.ttf -------------------------------------------------------------------------------- /server/static/css/themes/default/assets/fonts/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/server/static/css/themes/default/assets/fonts/icons.woff -------------------------------------------------------------------------------- /server/static/css/themes/default/assets/fonts/icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/server/static/css/themes/default/assets/fonts/icons.woff2 -------------------------------------------------------------------------------- /server/generate.go: -------------------------------------------------------------------------------- 1 | //go:generate rm -vf assets/assets.go 2 | //go:generate go-bindata-assetfs -pkg assets -o assets/assets.go ./static/... ./templates/... 3 | 4 | package server 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | eremetic 2 | eremetic.yml 3 | db/*.db 4 | docker/static 5 | docker/templates 6 | server/assets/assets.go 7 | .DS_Store 8 | ._* 9 | *\.sw[op] 10 | vendor/* 11 | *.orig 12 | .idea 13 | -------------------------------------------------------------------------------- /server/static/css/themes/default/assets/fonts/fontcustom_cb066050d5b786186aa0e7f121427d8b.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/server/static/css/themes/default/assets/fonts/fontcustom_cb066050d5b786186aa0e7f121427d8b.eot -------------------------------------------------------------------------------- /server/static/css/themes/default/assets/fonts/fontcustom_cb066050d5b786186aa0e7f121427d8b.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/server/static/css/themes/default/assets/fonts/fontcustom_cb066050d5b786186aa0e7f121427d8b.ttf -------------------------------------------------------------------------------- /server/static/css/themes/default/assets/fonts/fontcustom_cb066050d5b786186aa0e7f121427d8b.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eremetic-framework/eremetic/HEAD/server/static/css/themes/default/assets/fonts/fontcustom_cb066050d5b786186aa0e7f121427d8b.woff -------------------------------------------------------------------------------- /version/version.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | var ( 4 | // Version contains the Eremetic application version. Overridden at compile-time by make 5 | Version = "0.0.0+devel" 6 | // BuildDate contains the date of the build 7 | BuildDate = "" 8 | ) 9 | -------------------------------------------------------------------------------- /server/templates/error_401.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
23 |
2 |
3 | [![Build Status][travis-image]](https://travis-ci.org/eremetic-framework/eremetic)
4 | [![Coverage Status][coveralls-image]](https://coveralls.io/r/eremetic-framework/eremetic?branch=master)
5 | [![Go Report][goreport-image]](https://goreportcard.com/report/github.com/eremetic-framework/eremetic)
6 |
7 | ## Purpose
8 | Eremetic is a Mesos Framework to run one-shot tasks. The vision is to provide a
9 | bridge between Applications that need to run tasks and Mesos. That way a developer
10 | creating an application that needs to schedule tasks (such as cron) wouldn't need
11 | to connect to Mesos directly.
12 |
13 | ## Usage
14 | 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.
15 |
16 | ```bash
17 | curl -H "Content-Type: application/json" \
18 | -X POST \
19 | -d '{"mem":22.0, "cpu":1.0, "image": "busybox", "command": "echo $(date)"}' \
20 | http://eremetic_server:8080/api/v1/task
21 | ```
22 |
23 | These basic fields are required but you can also specify volumes, container names to mounts volumes from, ports, environment
24 | variables, and URIs for the mesos fetcher to download. See
25 | [examples.md](examples.md) for more examples on how to use eremetic.
26 |
27 | JSON format:
28 |
29 | ```javascript
30 | {
31 | // Float64, fractions of a CPU to request
32 | "cpu": 1.0,
33 | // Float64, memory to use (MiB)
34 | "mem": 22.0,
35 | // String, full tag or hash of container to run
36 | "image": "busybox",
37 | // Boolean, if set to true, docker image will be pulled before each task launch
38 | "force_pull_image": false,
39 | // Boolean, if set to true, docker will run the container in 'privileged' mode giving it all capabilities
40 | "privileged": false,
41 | // String, command to run in the docker container
42 | "command": "echo $(date)",
43 | // Array of Strings, arguements to pass to the docker container entrypoint
44 | "args": ["+%s"],
45 | // Array of Objects, volumes to mount in the container
46 | "volumes": [
47 | {
48 | "container_path": "/var/run/docker.sock",
49 | "host_path": "/var/run/docker.sock"
50 | }
51 | ],
52 | // Array of Strings, container names to get volumes from
53 | "volumes_from": ["+%s"],
54 | //String, name of the task. If empty, Eremetic assigns a random task name
55 | "name" : "Task Name",
56 | //String, network mode to pass to the container.
57 | "network" : "BRIDGE",
58 | //String, DNS address to be used by the container.
59 | "dns" : "172.0.0.2",
60 | // Array of Objects, ports to forward to the container.
61 | // Assigned host ports are available as environment variables (e.g. PORT0, PORT1 and so on with PORT being an alias for PORT0).
62 | "ports": [
63 | {
64 | "container_port": 80,
65 | "protocol": "tcp"
66 | }
67 | ],
68 | // Object, Environment variables to pass to the container
69 | "env": {
70 | "KEY": "value"
71 | },
72 | // Object, Will be merged to `env` when passed to Mesos, but masked when doing a GET.
73 | // See Clarification of the Masked Env field below for more information
74 | "masked_env": {
75 | "KEY": "value"
76 | },
77 | // Object, labels to be passed to the Mesos task
78 | "labels": {
79 | "KEY": "value"
80 | },
81 | // URIs and attributes of resource to download. You need to explicitly define
82 | // `"extract"` to unarchive files.
83 | "fetch": [
84 | {
85 | "uri" : "http://server.local/another_resource",
86 | "extract": false,
87 | "executable": false,
88 | "cache": false
89 | }
90 | ],
91 | // Constraints for which agent the task can run on (beyond cpu/memory).
92 | // Matching is strict and only attributes are currently supported. If
93 | // multiple constraints exist, they are evaluated using AND (ie: all or none).
94 | "agent_constraints": [
95 | {
96 | "attribute_name": "aws-region",
97 | "attribute_value": "us-west-2"
98 | }
99 | ],
100 | // String, URL to post a callback to. Callback message has format:
101 | // {"time":1451398320,"status":"TASK_FAILED","task_id":"eremetic-task.79feb50d-3d36-47cf-98ff-a52ef2bc0eb5"}
102 | "callback_uri": "http://callback.local"
103 | }
104 | ```
105 |
106 | ### Note
107 | Most of this meta-data will not remain after a full restart of Eremetic.
108 |
109 | ### Clarification of the Masked Env field
110 | The purpose of the field is to provide a way to pass along environment variables that you don't want to have exposed in a subsequent GET call.
111 | It is not intended to provide full security, as someone with access to either the machine running Eremetic or the Mesos Agent that the task is being run on will still be able to view these values.
112 | These values are not encrypted, but simply masked when retrieved back via the API.
113 |
114 | For security purposes, ensure TLS (https) is being used for the Eremetic communication and that access to any machines is properly restricted.
115 |
116 |
117 | ## Configuration
118 | create /etc/eremetic/eremetic.yml with:
119 |
120 | address: 0.0.0.0
121 | port: 8080
122 | master: zk://