CAF extra lib to deploy apps in a Mesos cluster
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.drone.yml
.eslintignore
.eslintrc.js
.gitignore
.npmignore
LICENSE-2.0.txt
README.md
index.js
package.json

README.md

CAF (Cloud Assistant Framework)

Co-design permanent, active, stateful, reliable cloud proxies with your web app.

See http://www.cafjs.com

CAF Extra Deploy

This repository contains a CAF lib to deploy applications in Mesos/Marathon.

API

lib/proxy_deploy.js

See the caf_turtles application for an example.

Configuration Example

framework.json

{
    "module": "caf_deploy#plug",
    "name": "deploy",
    "description": "Shared plug to deploy apps in Mesos/Marathon\n Properties: \n",
    "env": {
        "refreshInterval" : "process.env.REFRESH_INTERVAL||1000",
        "protocol" : "process.env.MARATHON_PROTOCOL||http",
        "hostname" : "process.env.HOST||localhost",
        "port" : ""process.env.MARATHON_PORT||8080",
        "username" : "process.env.MARATHON_USERNAME||root",
        "password" : "process.env.MARATHON_KEY_PASSWORD||pleasechange",
        "redis" : {
            "templateFile" : "process.env.REDIS_TEMPLATE_FILE||marathon.redis.mus",
            "prefixID": "process.env.REDIS_PREFIX_ID||redis",
            "rangePortStart" : "process.env.REDIS_RANGE_PORT_START||6380",
            "rangePortEnd" : "process.env.REDIS_RANGE_PORT_END||6480",
            "hostname" : "process.env.REDIS_HOSTNAME||redisHost1",
            "image" : "process.env.REDIS_IMAGE||redis:2.8",
            "cpus" : "process.env.REDIS_CPUS||0.1",
            "memory" : "process.env.REDIS_MEMORY||64.0"
        },
        "app" : {
            "templateFile" : "process.env.APP_TEMPLATE_FILE||marathon.app.mus",
            "args": "process.env.APP_ARGS||[]",
            "cpus" : "process.env.APP_CPUS||0.1",
            "memory" : "process.env.APP_MEMORY||64.0",
            "instances": "process.env.APP_INSTANCES||1",
            "services" :["redis"]
        }
    }
}

The properties define the Marathon/Mesos target URL, username, and password.

ca.json

    {
        "module": "caf_deploy#plug_ca",
        "name": "deploy",
        "description": "Manages deployments for this CA.",
        "env" : {
            "maxRetries" : "$._.env.maxRetries",
            "retryDelay" : "$._.env.retryDelay"
        },
        "components" : [
            {
                "module": "caf_deploy#proxy",
                "name": "proxy",
                "description": "Provides deployment API.",
                "env" : {

                }
            }
        ]
    }