With AWS companies now have the ability to develop and run their applications with speed and flexibility like never before. Working with an infrastructure that can be 100% API driven enables businesses to use lean methodologies and realize these benefits. This in turn leads to greater success for those who make use of these practices. In this session we'll talk about some key concepts and design patterns for Continuous Deployment and Continuous Integration, two elements of lean development of applications and infrastructures.
41. • Viaplay is Nordic’s leading online video service for TV, sport,
film and kids' content.
• The service is available on PC, Mac, Android and iOS mobile
phones, tablets, the Viaplay box, LG Smart TV, Samsung Smart
TV, Philips Smart TV, Panasonic Smart TV, Xbox 360,
PlayStation®3 and PlayStation®4.
42. Preparations for the Olympics
• New content / video / subscriber management platform
• API:s completely rebuilt in Node.js in a service oriented
architecture
• All clients rebuilt (Web, Smartphones, Smart TV:s, Gaming
consoles, Set Top Box)
• Moved hosting of API:s to AWS
43. System Setup
• Almost everything described in CloudFormation
templates: Network (VPC), Load Balancers, Cache clusters,
DNS entries, Autoscaling groups
• The same templates for all different environments
• Every application has its own CloudFormation stack with DNS
entries, Elastic Load Balancers and an Auto Scaling Group
44. Auto Scaling
• An ASG contains a variable number of instances running the
same AMI
• To enable auto scaling, the AMI must start automatically
• Application servers starts with our custom AMI containing
everything except the application build
45. Auto Scaling
• Build and environment are set in tags and UserData. UserData
is run at instance startup, tags are readable from the instance
but more important clearly visible in the console.
• When an EC2 instance is launched it fetches the build from S3,
installs and starts it
• As soon as the ELB health check is OK, the instance gets traffic
46. Deploy
• Autoscaling has already made us create AMIs that starts the
application at instance startup
• Deploy is done by changing parameters to the stack
• Setting new UserData on the ASG/EC2 launch config requires
exchange of instances. CloudFormation does that for us with
the Rolling Update policy
47. Lessons learnt
• Rolling update takes time and is practically unstoppable
during update. We are currently rewriting this so that we start
a new ASG that completely replaces the old one
• To be able to do a change in a stack, your IAM user needs to
have the rights to change all resources in the template. All
developers must be able to deploy their code, but we do not
want all developers to be Power Users.
48. Custom Admin Application
• Our admin application enables CloudFormation updates
without giving Power User rights to all developers
• We can keep track of who has done what in an easy way
• The application also makes sure that deploys are done in
exactly the same way every time
• Built on top of the AWS Javascript SDK
49. Custom Admin Application
• Our admin application enables CloudFormation updates
without giving Power User rights to all developers
• We can keep track of who has done what in an easy way
• The application also makes sure that deploys are done in
exactly the same way every time
• Built on top of the AWS Javascript SDK
50. Deploy From a Web Interface
• Build OK from Jenkins -> copied to S3 builds bucket
• Deploy tool lists all files from the builds bucket
51. Deploy From a Web Interface
• Write a short description of the deploy for the release email
52. Deploy From a Web Interface
• The admin tool updates the CloudFormation stack with the
new build parameter
• The deploy notifier application sends an email with
information on all commits done between the current and the
new build
53.
54. Deploy From a Web Interface
• If everything looks good on stage - click ”thumbs up” to copy
the build to the production bucket, else ”thumbs down” to
reject the build
55. Ready for the Olympics
• Everything deployed during the winter
• Last user migrated in January
• Opening ceremony at Friday Feb 7
56. Ready for the Olympics
• 39 deploys during the week starting Feb 3
• 11 deploys in 6 different applications on the day of the
opening ceremony
• All went fine
61. 11.6s
Mean time
between
deployments
(weekday)
1,079
Max number of
deployments in a
single hour
10,000
Mean number of
hosts
simultaneously
receiving a
deployment
30,000
Max number of
hosts
simultaneously
receiving a
deployment
DEPLOYMENTS AT
AMAZON.COM