Skip to content

Instantly share code, notes, and snippets.

@revett
Last active February 9, 2016 02:12
Show Gist options
  • Save revett/b2bf66e95589139529b5 to your computer and use it in GitHub Desktop.
Save revett/b2bf66e95589139529b5 to your computer and use it in GitHub Desktop.

Tutum <> ASW

This gist quickly describes the infrastructure being used at Vidsy.

Overview

Bryan (@kickingthetv) mentioned that other members of the Tutum community would like a brief overview of how Vidsy are using Tutum and AWS.

This is a work-in-progress.

AWS

Slightly simplified:

  • ASG which uses a user-data script to register new EC2 instances to Tutum.
  • ELB pointing at the ASG.

When a new instance starts in the ASG, it:

  • Installs tutum-cli and aws-cli.
  • Sets environment variables for Tutum authentication (API key stored in S3).
  • Uses "Bring Your Own Node" CLI command to register new instance as Tutum node.
  • Remove nodes from Tutum which have become "Unreachable".
  • Waits for Tutum deployment to finish.
  • Retrieves EC2 instance tags.
  • Adds each tag as a Tutum tag.
  • Redeploys the Tutum stack.
  • Sends a Slack notification telling the team that a new instance was launched.
  • Delete all installed packages and Bash history.

Check out the script at vidsy/tutum-startup

Tutum

Use a stack file:

platform:
  image: 'tutum.co/org/some-image:latest'
  autoredeploy: true
  deployment_strategy: every_node
  ports:
    - '80:4000'
  restart: always
  sequential_deployment: true
  tags:
    - dev
    - app
  • Each container will only be deployed to certain tagged nodes.
  • Every node must contain a container, as we want high availability and it is required to pass the ELB health checks.
  • Sequential deployments will make sure that there is no downtime.
  • Auto-redeploy helps with a nice automated CI pipeline.

CI Pipeline

Planned Improvements

  • Use tutumcloud/haproxy image as entry point of node to allow for multiple web-server images to exist on each node.
  • Need to write a post_test hook script for the automated testing pipeline so that the result is posted to the Github Status API.

Bugs

  • Tutum will not recognise that a new node has been added, thus this is why you have to redeploy the entire stack. This is because the node did not have any tags at the point it was registered.
  • Tutum does not allow tags to be added to a node until it has finished deploying.

Notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment