This gist quickly describes the infrastructure being used at Vidsy.
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.
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
andaws-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
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.
- Use Tutum automated builds to build and push an image when a commit is made to
master
on Github. - Use Tutum automated testing to test every commit on any branch.
- 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.
- 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.
- Ping me on Slack (@revett) with any questions!
- All usernames are referring to the Tutum community Slack.
- A lot of these ideas were @jskeates, he helped a lot.