17. Goals
• Highly available
• Ability to scale easily
• Flexible
18. Wonderful Code
• Service-Oriented Architecture
• Multiple specialised services
• Rails and Node.js initially
• MongoDB & Redis initially
• Communication via asynchronous
messaging
19. Complicated!
• SOA is complicated
• Requires rock-solid setup
• Consistency across
environments
• Sanely manageable
20. The Way It Should Be
Servers Development
• Ubuntu 12.04 LTS • Ubuntu 12.04 LTS
• Nginx • Nginx
• Unicorn • Unicorn
• Ruby 1.9.2 • Ruby 1.9.2
• Rails 3.1 • Rails 3.1
• MongoDB • MongoDB
• Redis • Redis
21. Wunderful Infrastructure
• Configuration Management - Chef
• Infrastructure as Code
• Virtualisation - VirtualBox + Vagrant
22. CHEF
• Deployment & configuration management
• Write Recipes as part of Cookbooks, which are applied through Roles.
• Ruby-based = Developers can write cookbooks ;)
• Client-Server or Solo (standalone) modes
• Similar to Elastic Beanstalk, Puppet, Babushka, CFEngine
• http://www.opscode.com/chef
23. Infrastructure as Code
• Define packages & their configurations in code
• Visibility
• Editable
• Testable
• Version Controlled
24. The Cloud!
Ubuntu 12.04 AMI $ ec2-run-instances EC2
(virtual machine image, (virtual machine instance
stored on EBS) running on AWS hardware)
25. Configuration Management
(Servers)
Librarian-Chef
Librarian gem,
used as a “Bundler” for
Chef cookbooks
Download
cookbooks
from remote
Upload cookbooks,
roles & data bags Chef Server running on
Developer’s terminal EC2 + EBS
manages EC2 nodes &
Chef repository
26. Configuration Management
(Servers)
Boot EC2 instance(s) with role(s)
EC2 instance(s)
Developer’s terminal
manages EC2 nodes &
Chef repository EC2 server downloads &
runs cookbooks required
to fulfil role(s)
Chef Server running on
EC2 + EBS
27. Virtualise!
• VirtualBox
• Oracle’s open source VM software, similar to VMWare, Parallels, etc.
• http://www.virtualbox.org
• Vagrant
• Ruby gem, adds in useful features on top of VirtualBox
• http://vagrantup.com
28. Virtualisation
(Development)
Vagrant
Ruby gem, provides
Ubuntu 12.04 image VirtualBox
useful extensions for Developer’s MacBook Air
(stored in S3) instance
provisioning and configuring
29. Configuration Management
(Servers)
Librarian-Chef
Librarian gem,
used as a “Bundler” for
Chef cookbooks
Download
cookbooks
from remote
Developer’s terminal
manages EC2 nodes &
Chef repository
30. Configuration Management
(Servers)
Boot Vagrant instance(s) with role(s)
Vagrant
Vagrant / VirtualBox
Developer’s terminal instance(s)
manages EC2 nodes &
Chef repository
Chef Solo
uses cookbooks
in developer’s Vagrant installs Chef Solo
repository and runs cookbooks
required to fulfil role(s)
Chef Solo running in the
VM
31. Results
• Sane environments
• No voodoo!
• No more “it worked in development”!
• Maintainable
• Aspirin budget drastically reduced!
32. AWS Building Blocks
• EC2
• Complete control from the OS up
• Export AMI images to VMs (Windows only)
• S3
• Store & serve cookbooks, VMs, etc
• SNS
• Notifications on success / failure
• EBS
• Store & snapshot operational data