Coder Social home page Coder Social logo

continuous-deployment-cluster's Introduction

continuous deployment cluster

This is an example project demonstrating how to set up continuous multi-server cluster deployment with propagit and seaport.

example

Suppose there are 3 systems: hub, say, and web.

on hub:

$ npm install -g seaport propagit
$ seaport 6000 &
$ propagit hub --port=6001 --secret=beepboop &

on say:

$ propagit drone --hub=hubhost:6001 --secret=beepboop -- node say.js

on web:

$ propagit drone --hub=hubhost:6001 --secret beepboop -- node web.js

then from your git project (with node_modules checked in):

$ git push http://hubhost:6002/webapp master
$ git log|head -n1
commit 74336bc1db98478e02e69f59e7100895be207389
$ propagit deploy --hub=hubhost=6001 --secret=beepboop \
  webapp 74336bc1db98478e02e69f59e7100895be207389
^C

now dump the port tables:

$ seaport localhost:6000 show
{
  "74336bc1db98478e02e69f59e7100895be207389": {
    "http": [
      {
        "host": "127.0.0.1",
        "port": 15194
      }
    ],
    "say": [
      {
        "host": "127.0.0.1",
        "port": 13308
      }
    ]
  }
}

and curl the http server:

$ curl localhost:15194
beep boop
$ curl localhost:15194/HUG
HUG ALL HUMANS

Hooray everything works!

Now make a change to the git repo and redeploy the latest hash:

$ git commit -am'newlines, beepity'
$ git push http://localhost:6002/webapp master
$ git log|head -n1
commit 40548daf17f7d25ec0f1925b97d24bc05043e4ed
$ propagit deploy --hub=localhost:6001 --secret=beepboop \
  webapp 40548daf17f7d25ec0f1925b97d24bc05043e4ed
^C

and dump the new port table:

$ seaport localhost:6000 show
{
  "74336bc1db98478e02e69f59e7100895be207389": {
    "http": [
      {
        "host": "127.0.0.1",
        "port": 15194
      }
    ],
    "say": [
      {
        "host": "127.0.0.1",
        "port": 13308
      }
    ]
  },
  "40548daf17f7d25ec0f1925b97d24bc05043e4ed": {
    "http": [
      {
        "host": "127.0.0.1",
        "port": 10745
      }
    ],
    "say": [
      {
        "host": "127.0.0.1",
        "port": 10831
      }
    ]
  }
}

and curl against the new entry:

$ curl localhost:10745
beepity boop!
$ curl localhost:10745/BEFRIEND
BEFRIEND ALL HUMANS

Hooray we pushed out a new version of the cluster alongside the old one!

Now just glue seaport's port tables programatically to an HTTP proxy like bouncy.

You can set up A/B testing or iterative deployment at the proxy level with this clustering approach!

Soon propagit will support taking down deployments that aren't in use anymore.

continuous-deployment-cluster's People

Watchers

 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.