Continuous Deployment at Spreaker

2,220 views
2,158 views

Published on

Continuous Deployment on AWS EC2 made easy with Fabric and Zonify.

Published in: Technology
1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total views
2,220
On SlideShare
0
From Embeds
0
Number of Embeds
494
Actions
Shares
0
Downloads
3
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide

Continuous Deployment at Spreaker

  1. 1. Continuous Deployment at Marco Pracucci
  2. 2. Platform for Creating and Sharing Audio 8 people (4 developers) 2M unique listeners / month 3.5M audio tracks created 500 reqs / sec
  3. 3. We run 80% of our traffic on AWS about 60 EC2 instances and 50TB on S3
  4. 4. We deploy frequently [even on friday] 51 deploys in last 30 days
  5. 5. How we deploy the web [php] app in 90 seconds
  6. 6. Deploy task
  7. 7. code repository 1. ssh fab www.deploy EC2 instances
  8. 8. code repository 2. checkout fab www.deploy EC2 instances
  9. 9. code repository Checklist - local cache warmup 3. warmup - db schema migrations fab www.deploy - check consistency EC2 instances
  10. 10. code repository 4. switch code fab www.deploy everything ok? EC2 instances
  11. 11. code repository Checklist - iptables --dport 80 -j DROP - ln -sfn /var/www/new /var/www/curr 4. switch code - clear bytecode cache fab www.deploy - iptables --dport 80 -j ACCEPT EC2 instances
  12. 12. notify team on IRC generate report fab www.deploy
  13. 13. which instances to deploy? we do auto-scaling, they change dinamically
  14. 14. we exploited DNS
  15. 15. Split infrastructure into roles EC2 instances www1 api1 worker1 api2 www2 { worker2 { www3 { api3 role: api role: web role: worker-web
  16. 16. Tag each instance with roles [space separated roles for multi-role instances]
  17. 17. Map names and roles to DNS https://github.com/airbnb/zonify Creates Route 53 DNS entries for all instances and roles
  18. 18. Address a single instance
  19. 19. Address instances by role
  20. 20. Easy to integrate with fabric
  21. 21. Do you remember the starting point? Internally does fab -R web www.deploy
  22. 22. few good reasons Easy, Fast, Robust
  23. 23. few good reasons Easy, Fast, Robust Warning: an attacker can easier get your instances IPs (use an unguessable DNS zone name)
  24. 24. Thank you www.spreaker.com/marco @pracucci

×