The goal of every developer is get her super cool new feature out to customers, as fast as possible, with little to no bugs and with no manual effort so she can go back to coding the next awesome one. Doing all of this takes tremendous amounts of effort to plan, coordinate and execute on a DevOps engineer. Continuous Integration coupled with Continuous Deployment aide in this endeavor. But again, those are cumbersome and can be difficult to set up. AWS has four new tools to help with this; AWS CodeDeploy, CodeCommit, CodePipeline, and CodeBuild. Each one has specialized features to help get your code to customers faster, more reliable and bug free as possible. In this presentation, we will walk through how to setup a CI/CD pipeline using those AWS tools and demonstrate how we can go from yay it compiles to a 5-star review.
2. whoami
• DevOps Engineer Team Lead,
Bluesentry IT
• Worked in IT for 11 years,
networking, sysadmin,
development
• All 5 AWS certifications
• @strongjz
3. Agenda
• Dev What? Ops who?
• Continuous Integration / Continuous Deployment
• How AWS enables CI/CD
• Demo
4. Agenda
• Dev What? Ops who?
• Continuous Integration / Continuous Deployment
• How AWS enables CI/CD
• Demo
11. What DevOps really is
“DevOps isn’t about automation, just as
astronomy isn’t about telescopes.”
- Gene Kim, The DevOps Handbook: How to Create World-Class Agility, Reliability,
and Security in Technology Organizations
12. More so this….
“we’re hearing more lately: something called “DevOps.” Maybe everyone
attending this party is a form of DevOps, but I suspect it’s something
much more than that. It’s Product Management, Development, IT
Operations, and even Information Security all working together and
supporting one another.”
― Gene Kim, The Phoenix Project: A Novel About IT, DevOps, and Helping Your Business Win
13. More so this….
“we’re hearing more lately: something called “DevOps.” Maybe everyone
attending this party is a form of DevOps, but I suspect it’s something
much more than that. It’s Product Management, Development, IT
Operations, and even Information Security all working together and
supporting one another.”
― Gene Kim, The Phoenix Project: A Novel About IT, DevOps, and Helping Your Business Win
18. Agenda
• Dev What? Ops who?
• Continuous Integration / Continuous Deployment
• How AWS enables CI/CD
• Demo
19. CI/CD
• Continuous – All day, Every day.
• Integration – This is my code, that’s your code,
Let’s get together.
• Deployment – Deploy to ALL the servers! Or
not
20. CI/CD Running Rules
8. Automate the deployment and rollback
2. Automate the build
7. Everyone can see the results of the build
6. Every commit to the mainline gets built
5. Commit early, commit often
4. Make the build self-testing
3. Keep the build fast
1. Maintain a code repository
21. Agenda
• Dev What? Ops who?
• Continuous Integration / Continuous Deployment
• How AWS enables CI/CD
• Demo
29. AWS CodePipeline: Actions
• A build action that builds or transforms the items
• A test action that configures and runs automated tests
• A deploy action that deploys items to one or more servers, websites, or repositories
• An invoke action that runs functions
• As well as custom actions
31. Agenda
• Dev What? Ops who?
• Continuous Integration / Continuous Deployment
• How AWS enables CI/CD
• Demo
32. CI/CD Running Rules
8. Automate the deployment and rollback Deploy
2. Automate the build *
7. Everyone can see the results of the build Pipeline
6. Every commit to the mainline gets built Pipeline
5. Commit early, commit often Commit
4. Make the build self-testing Deploy
3. Keep the build fast Build
1. Maintain a code repository Commit
42. Code Commit Costs
First 5 active users*
Each active user* above
the first 5
Free $1 per month
Receives:
•Unlimited repositories
•50 GB-month of storage
•10,000 Git
requests/month
Receives:
•Unlimited repositories
•10 GB-month of storage
per active user
•2,000 Git
requests/month per
active user
•Storage
•$0.06 per GB-month
•$0.001 per Git request
44. Code Deploy Costs
• For CodeDeploy on EC2: There is no additional
charge for code deployments to Amazon EC2
instances through AWS CodeDeploy.
For CodeDeploy On-Premises: You pay $0.02 per
on-premises instance update using AWS
CodeDeploy.
45. Code Pipeline Costs
You pay only for what you use. AWS CodePipeline costs $1
per active pipeline* per month.
An active pipeline is a pipeline that has existed for more than
30 days and has at least one code change that runs through
it during the month. There is no charge for pipelines that have
no new code changes running through them during the
month. An active pipeline is not prorated for partial months.
You may incur additional charges for storing and accessing
your pipeline artifacts in Amazon S3 and for triggering actions
from other AWS and third party services that you connect to
your pipeline.
Editor's Notes
People – teams, silos
Process – tickets, back and forth, lots of non value add
Technology
Automation removes some barriers to processes.
Cloud builds, API
Removes some of the hurdles of silo mindset
DevOps is more about this….
Culture
Tools help us to change culture, Galileo Telescope changed are world view
That tool, well process really is CI/CD
But….
Continuous delivery is a software development methodology where the release process is automated.
Every software change is automatically built, tested, and deployed to production.
Before the final push to production, a person, an automated test, or a business rule.
Continuous integration is a software development practice where members of a team use a version control system and integrate their work frequently to the same location, such as a master branch. Each change is built and verified by means of tests and other verifications in order to detect any integration errors as quickly as possible. Continuous integration is focused on automatically building and testing code, as compared to continuous delivery, which automates the entire software release process up to production Services
repositories are encrypted at rest as well as in transit
Triggers – SNS and Lambda
CodeBuild – source repo for code
Elastic Beanstalk – deploy code from commit into eb resources
Cloudformation – create or update a stack or change set in CFN
CodePipeline – source for a deployment
Key management - AWS CodeCommit uses AWS KMS to encrypt
Lambda – fire lambda events based on commits
SNS – sends notifications about commits.
https://stelligent.com/2016/01/15/automating-aws-codedeploy-provisioning-in-cloudformation/
CodeDeployDefault.AllAtOnce
CodeDeployDefault.HalfAtATime
In the example of nine instances, it will deploy to up to four instances at a time. The overall deployment succeeds if deployment to five or more instances succeed; otherwise, the deployment fails.
CodeDeployDefault.OneAtATime
Deployment Configuration – How code gets there and when
All at once
Half
One at a time
Applications - container around all the attributes
Deployment Group – EC2 instances or ASG
Application revisions – version of files to deploy
Deployments – process of deploying and how.
In Place – app stopped and new version installed
Blue Green – new instance and latest version placed the traffic rerouted
Automated or manual rollback
Monitoring all this
Revision – Change in source, multiple revision can be ran thru a single pipeline but only one per stage , S3, CodeCommit, Github
Stage – build stage, testing stage, all actions must be run to be considered complete
Action – some task to be performed
Type –
Transition – moving from one stage to the next
Deployments -
Type -
Source
build Codebuild, Cloudbees. Jenkins. SolanCI. Team City
Test – Codebuild, Apica BlaseMeter, Ghost inspector, HPE stormrunner load, runscope
Deploy - CFN, Codedeploy , Elastic beanstalk, opsworks, Xebia labs
Approval – Manually
Invoke – Lambda functions
create a custom action, you must also create a job worker that will poll AWS CodePipeline for job requests for this custom action, execute the job, and return the status result to AWS Code pipeline
AWS CodeDeploy: Type or choose the name of an existing AWS CodeDeploy application in Application name and the name of a deployment group for that application in Deployment group, and then choose Next step. Alternatively, you can create an application, deployment group, or both by choosing those links in AWS CodeDeploy.
AWS Elastic Beanstalk: Type or choose the name of an existing Elastic Beanstalk application in Application name and an environment for that application in Environment name, and then choose Next step. Alternatively, you can create an application, environment, or both by choosing those links in Elastic Beanstalk.
AWS OpsWorks: Type or choose the name of the stack you want to use in Stack and the layer that your target instances belong to in Layer. In App, choose the application that you want to update and deploy. If you need to create an app, choose create a new one in AWS OpsWorks.Services
CFN – create or update a stack, also create a change set on a stack
Commit
Pipeline
http://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-simple-codecommit.html
Deploy
https://github.com/awslabs/aws-codedeploy-samples/tree/master/applications/SampleApp_Linux
Go sample Code Build
http://docs.aws.amazon.com/codebuild/latest/userguide/sample-go-hw.html
Codepipeline Blog annoucement
https://aws.amazon.com/blogs/aws/category/code-pipeline/