Skip to content

Instantly share code, notes, and snippets.

@mhausenblas
Last active January 30, 2017 19:50
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhausenblas/bb967625088902874d631eaa502573cb to your computer and use it in GitHub Desktop.
Save mhausenblas/bb967625088902874d631eaa502573cb to your computer and use it in GitHub Desktop.
Installs VAMP 0.9 incl. dependencies on DC/OS 1.8

Install VAMP and dependencies on DC/OS 1.8

Make sure the DC/OS CLI is installed. I'm using httpie here but curl also works ;)

Note that all you'll need locally is install-job.json, a DC/OS Jobs definition. So, to install VAMP 0.9 and dependencies, do the following:

# download the install job
$ http --download https://gist.githubusercontent.com/mhausenblas/bb967625088902874d631eaa502573cb/raw/ece1c702dede66693b4873985ef317c568384436/install-job.json

# submit the install job so that it is available to be executed:
$ http POST $(dcos config show core.dcos_url)/service/metronome/v1/jobs Authorization:token=$(dcos config show core.dcos_acs_token) < install-job.json

# run the job:
$ http POST $(dcos config show core.dcos_url)/service/metronome/v1/jobs/install-vamp/runs Authorization:token=$(dcos config show core.dcos_acs_token)

You can see the progress and outcome via the DC/OS UI in the Jobs tab. Once completed, head over to http://PUBLIC_AGENT:8080 to access VAMP.

{
"id": "install-vamp",
"description": "Installs VAMP and dependencies",
"run": {
"cpus": 0.5,
"mem": 100,
"disk": 0,
"artifacts": [{
"uri": "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64",
"executable": true,
"extract": false,
"cache": true
}, {
"uri": "https://gist.githubusercontent.com/mhausenblas/bb967625088902874d631eaa502573cb/raw/4829525ab7700645166f7c47843cb351e3d2a807/install-vamp-09.sh",
"executable": true,
"extract": false,
"cache": false
}, {
"uri": "https://gist.githubusercontent.com/mhausenblas/bb967625088902874d631eaa502573cb/raw/7e738db72693716a246c29abd320d67c5a4ec74b/vamp09-es.json",
"executable": false,
"extract": false,
"cache": false
}, {
"uri": "https://gist.githubusercontent.com/mhausenblas/bb967625088902874d631eaa502573cb/raw/7e738db72693716a246c29abd320d67c5a4ec74b/vamp09.json",
"executable": true,
"extract": false,
"cache": true
}, {
"uri": "https://gist.githubusercontent.com/mhausenblas/bb967625088902874d631eaa502573cb/raw/7e738db72693716a246c29abd320d67c5a4ec74b/vamp09-gateway.json",
"executable": false,
"extract": false,
"cache": false
}
],
"cmd": "mv jq-linux64 jq && ./install-vamp-09.sh",
"restart": {
"policy": "NEVER"
}
}
}
#!/usr/bin/env bash
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
MESOS_MASTER=leader.mesos:5050
MARATHON=leader.mesos:8080
CLUSTER_NODES=`curl -s $MESOS_MASTER/slaves | ./jq '.slaves | length' | tr -d '[[:space:]]'`
echo Deploying Elasticsearch
curl -X POST -H "Content-Type: application/json" $MARATHON/v2/apps -d@vamp09-es.json
sleep 5
echo Deploying VAMP
curl -X POST -H "Content-Type: application/json" $MARATHON/v2/apps -d@vamp09.json
sleep 3
echo Deploying $CLUSTER_NODES VAMP Gateways
sed -i "s/NUM_AGENTS/$CLUSTER_NODES/g" vamp09-gateway.json
curl -X POST -H "Content-Type: application/json" $MARATHON/v2/apps -d@vamp09-gateway.json
echo DONE deploying VAMP, go to http://PUBLIC_AGENT:8080 to access it.
{
"id": "elasticsearch",
"instances": 1,
"cpus": 0.2,
"mem": 512,
"container": {
"docker": {
"image": "mesos/elasticsearch-scheduler",
"network": "HOST",
"forcePullImage": true
}
},
"args": [
"--zookeeperMesosUrl", "zk://zk-1.zk:2181/mesos",
"--elasticsearchDockerImage", "magneticio/elastic:2.2",
"--elasticsearchRam", "1024",
"--elasticsearchPorts", "9200,9300"
],
"env": {
"JAVA_OPTS": "-Xms128m -Xmx256m"
}
}
{
"id": "/vamp/vamp-gateway-agent",
"args": [
"--storeType=zookeeper",
"--storeConnection=zk-1.zk:2181",
"--storeKey=/vamp/haproxy/1.6",
"--logstash=elasticsearch-executor.elasticsearch.mesos:10001"
],
"cpus": 0.2,
"mem": 256,
"instances": NUM_AGENTS,
"acceptedResourceRoles": [
"slave_public",
"*"
],
"container": {
"type": "DOCKER",
"docker": {
"image": "magneticio/vamp-gateway-agent:0.9.0",
"network": "HOST",
"portMappings": [],
"privileged": true,
"parameters": []
}
},
"env": {},
"constraints": [
[
"hostname",
"UNIQUE"
]
]
}
{
"id": "/vamp/vamp",
"instances": 1,
"cpus": 0.5,
"mem": 1024,
"container": {
"type": "DOCKER",
"docker": {
"image": "magneticio/vamp:0.9.0-dcos",
"network": "HOST",
"forcePullImage": true
}
},
"acceptedResourceRoles": [
"slave_public"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment