Here is the Marathon JSON used to deploy Riak on Mesos backed by Flocker and Calico Docker Networking
{
"id": "marathon-demo-riak",
"apps": [{
"id": "riak1",
"container": {
"type": "DOCKER",| export function actionTypeBuilder(prefix) { | |
| return { | |
| type: actionType => `${prefix}/${actionType}`, | |
| loading: actionType => `${actionType}/loading`, | |
| ready: actionType => `${actionType}/ready`, | |
| stopped: actionType => `${actionType}/stopped`, | |
| changed: actionType => `${actionType}/changed`, | |
| error: actionType => `${actionType}/error`, | |
| success: actionType => `${actionType}/success` | |
| }; |
| var npm = require("npm"); | |
| var fs = require("fs-extra"); | |
| var chokidar = require("chokidar"); | |
| var packagePaths = [ | |
| "../mobile-app/node_modules/shared-package/lib", | |
| "../web-app/node_modules/shared-package/lib", | |
| ]; | |
| var noop = () => {}; |
| defmodule Abilities1 do | |
| defimpl Canada.Can, for: User do | |
| def can?(%User{id: user_id}, action, %Testimonial{id: testimonial_id}) | |
| when action in [:create], do: true | |
| def can?(%User{id: user_id}, action, %Testimonial{id: testimonial_id}) | |
| when action in [:edit], do: true | |
| end | |
| end | |
| defmodule BetterAbilities do |
| defmodule HttpRequester do | |
| use GenServer | |
| def start_link(_) do | |
| GenServer.start_link(__MODULE__, nil, []) | |
| end | |
| def fetch(server, url) do | |
| # Don't use cast: http://blog.elixirsips.com/2014/07/16/errata-dont-use-cast-in-a-poolboy-transaction/ | |
| timeout_ms = 10_000 |
Here is the Marathon JSON used to deploy Riak on Mesos backed by Flocker and Calico Docker Networking
{
"id": "marathon-demo-riak",
"apps": [{
"id": "riak1",
"container": {
"type": "DOCKER",This gist is an implementation of http://sirile.github.io/2015/05/18/using-haproxy-and-consul-for-dynamic-service-discovery-on-docker.html on top of Docker Machine and Docker Swarm.
| # Just for perf, you can skip this. | |
| START_SEC=$(date +'%s') | |
| # Creating network. | |
| docker-machine ssh node-1 "docker network create --driver overlay proxy" | |
| # Grab the source. | |
| docker-machine ssh node-1 "curl -o docker-compose-stack.yml https://raw.githubusercontent.com/vfarcic/docker-flow-proxy/master/docker-compose-stack.yml" | |
| # Create docker-flow-proxy and docker-flow-swarm-listener services. |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <schema name="geotest" version="1.5"> | |
| <uniqueKey>_yz_id</uniqueKey> | |
| <fields> | |
| <field name="name" type="string" indexed="true" stored="true"/> | |
| <field name="loc" type="location_rpt" indexed="true" stored="true" /> | |
| <!-- Begin Yokozuna Fields --> | |
| <field name="_yz_id" type="_yz_str" indexed="true" stored="true" required="true" /> |
| curl -XPOST http://localhost:8098/types/location_type/buckets/people/datatypes/person1 \ | |
| -H "Content-Type: application/json" \ | |
| -d ' | |
| { | |
| "update": { "username_register": "user1", "city_register": "Denver", "state_register": "NY", "position_register": "42.27,-74.53" } | |
| }' | |
| curl -XPOST http://localhost:8098/types/location_type/buckets/people/datatypes/person2 \ | |
| -H "Content-Type: application/json" \ | |
| -d ' |