Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Tale of Two Pizzas: Developer Tools at AWS

Darko Mesaros
September 23, 2020

Tale of Two Pizzas: Developer Tools at AWS

Darko Mesaros

September 23, 2020
Tweet

More Decks by Darko Mesaros

Other Decks in Technology

Transcript

  1. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Tale of Two Pizzas: Developer
    Tools at AWS
    @darkosubotica
    ln/darko-mesaros
    twitch.tv/ruptwelve
    youtube.com/ruptwelve

    View Slide

  2. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    The Three What's!
    • What is DevOps?
    • What is a Modern Application?
    • What Tools make my life easier?

    View Slide

  3. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    What is DevOps?

    View Slide

  4. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    What is DevOps?
    • Cultural philosophies
    • Practices
    • Tools

    View Slide

  5. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    DevOps Culture
    • Dev & Ops coming together
    • No more “silos”
    • Shared responsibility
    • Ownership
    • Visibility and communication

    View Slide

  6. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    DevOps Practices
    • Microservices
    • Moving away from “monolithic” application
    architecture to many individual services

    View Slide

  7. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    DevOps Practices
    • Continuous Integration
    • Continuous Delivery & Deployment

    View Slide

  8. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    DevOps Practices
    • Infrastructure as Code
    • Model your AWS resources using code

    View Slide

  9. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    DevOps Practices
    • Monitoring and Logging
    • Track and analyze metrics and logs
    • Understand real-time performance of
    infrastructure and application

    View Slide

  10. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Reliability
    Benefits of DevOps
    Speed
    Scale
    Rapid Delivery
    Improved Collaboration
    Security

    View Slide

  11. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    $(whoami) Darko Mesaroš / Darko Meszaros /
    Дарко Месарош
    Berlin
    @darkosubotica
    ln/darko-mesaros
    twitch.tv/ruptwelve
    youtube.com/ruptwelve

    View Slide

  12. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Tell me about Amazon’s Story

    View Slide

  13. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Development transformation at Amazon: 2001–2002
    monolithic application
    + teams
    2001
    Lesson learned: decompose for agility
    2002
    microservices
    + 2 pizza teams

    View Slide

  14. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Amazon Retail Platform (2009)

    View Slide

  15. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Full ownership
    Full accountability
    “DevOps”
    Focused innovation
    Two-pizza teams

    View Slide

  16. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Things went much
    better under this
    model and teams
    were releasing faster
    than ever, but we
    felt that we could
    still improve.

    View Slide

  17. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    In 2009, we ran
    a study to find
    out where
    inefficiencies
    might still exist

    View Slide

  18. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    We were just waiting.
    Wait
    Write
    Code
    Wait
    Build
    Code
    Wait
    Deploy
    to Test
    Deploy
    to Prod

    View Slide

  19. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    We were just waiting.
    Wait
    Write
    Code
    Wait
    Build
    Code
    Wait
    Deploy
    to Test
    Deploy
    to Prod
    Mins Days Mins Days Mins Days Mins

    View Slide

  20. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    We were just waiting.
    Wait
    Write
    Code
    Wait
    Build
    Code
    Wait
    Deploy
    to Test
    Deploy
    to Prod
    Weeks
    Mins Days Mins Days Mins Days Mins

    View Slide

  21. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    We were just waiting.
    Wait
    Write
    Code
    Wait
    Build
    Code
    Wait
    Deploy
    to Test
    Deploy
    to Prod
    Weeks
    Mins Days Mins Days Mins Days Mins

    View Slide

  22. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    https://secure.flickr.com/photos/lindseygee/5894617854/

    View Slide

  23. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Automated actions
    and transitions; from
    check-in to production
    Development benefits:
    • Faster
    • Safer
    • Simplification &
    standardization
    • Visualization of the
    process

    View Slide

  24. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    This has continued to work out really well:
    In 2014:
    • Thousands of service teams across Amazon
    • Building microservices
    • Practicing continuous delivery
    • Many environments (staging, beta, production)
    50 million deploys

    View Slide

  25. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    This has continued to work out really well:
    Every year at Amazon, we perform a survey of all our
    software developers. The 2014 results found only one
    development tool/service could be correlated statistically
    with happier developers:
    Our pipelines service!
    continuous delivery == happier developers!

    View Slide

  26. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Monolith development lifecycle
    monitor
    release
    test
    build
    developers
    delivery pipelines
    services

    View Slide

  27. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Microservice development lifecycle
    ???
    developers
    delivery pipelines
    services

    View Slide

  28. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Microservice development lifecycle
    developers services
    monitor
    release
    test
    build
    delivery pipelines
    monitor
    release
    test
    build
    monitor
    release
    test
    build
    monitor
    release
    test
    build
    monitor
    release
    test
    build
    monitor
    release
    test
    build

    View Slide

  29. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Listen
    Iterate
    Experiment
    Innovation
    Flywheel
    Experiments power the engine of rapid innovation

    View Slide

  30. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    What is a Modern Application?

    View Slide

  31. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    What changes do you need to make to adopt these best
    practices?
    Serverless
    No provisioning/management
    Automatic scaling
    Pay for value billing
    Availability and resiliency
    Microservices
    Componentization
    Business capabilities
    Products not projects
    Infrastructure automation
    DevOps
    Cultural philosophies
    Cross-disciplinary teams
    CI/CD
    Automation tools
    DEV OPS
    Architectural
    patterns
    Operational
    Model
    Software
    Delivery

    View Slide

  32. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Approaches to modern application development
    • Simplify environment management
    • Reduce the impact of code changes
    • Automate operations
    • Accelerate the delivery of new, high-quality services
    • Gain insight across resources and applications
    • Protect customers and the business

    View Slide

  33. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Approaches to modern application development
    • Simplify environment management with serverless technologies
    • Reduce the impact of code changes with microservice architectures
    • Automate operations by modeling applications & infrastructure as code
    • Accelerate the delivery of new, high-quality services with CI/CD
    • Gain insight across resources and applications by enabling observability
    • Protect customers and the business with end-to-end security & compliance

    View Slide

  34. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Approaches to modern application development
    • Simplify environment management with serverless technologies
    • Reduce the impact of code changes with microservice architectures
    • Automate operations by modeling applications & infrastructure as code
    • Accelerate the delivery of new, high-quality services with CI/CD
    • Gain insight across resources and applications by enabling observability
    • Protect customers and the business with end-to-end security & compliance

    View Slide

  35. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Approaches to modern application development
    • Simplify environment management with serverless technologies
    • Reduce the impact of code changes with microservice architectures
    • Automate operations by modeling applications & infrastructure as code
    • Accelerate the delivery of new, high-quality services with CI/CD
    • Gain insight across resources and applications by enabling observability
    • Protect customers and the business with end-to-end security & compliance

    View Slide

  36. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Release process stages
    Source Build Test Production

    View Slide

  37. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Release process stages
    Source Build Test Production
    • Integration tests
    with other
    systems
    • Load testing
    • UI tests
    • Security testing
    • Check-in source
    code such as .java
    files
    • Peer review new
    code
    • Compile code
    • Unit tests
    • Style checkers
    • Create container
    images and
    function
    deployment
    packages
    • Deployment to
    production
    environments
    • Monitor code in
    production to
    quickly detect
    errors

    View Slide

  38. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Release process stages
    Source Build Test Production

    View Slide

  39. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Release process stages
    Source Build Test Production

    View Slide

  40. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Pillars of releasing modern applications

    View Slide

  41. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    What Tools should I use?

    View Slide

  42. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Pillars of releasing modern applications
    Infrastructure
    as code

    View Slide

  43. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Infrastructure as code

    Make infrastructure
    changes repeatable and
    predictable

    Release infrastructure
    changes using the same
    tools as code changes

    Replicate production in
    a staging environment
    to enable continuous
    testing

    View Slide

  44. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    AWS CloudFormation
    • Infrastructure as code (IaC)
    • Provides a common language for you to
    describe and provision all the infrastructure
    resources in your cloud environment
    • Build and rebuild your infrastructure and
    applications, without having to perform
    manual actions or write custom scripts
    https://aws.amazon.com/cloudformation/

    View Slide

  45. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Model function environments with AWS Serverless
    Application Model (SAM)
    • Open source framework for building serverless
    applications on AWS
    • Shorthand syntax to express functions, APIs,
    databases, and event source mappings
    • Transforms and expands SAM syntax into AWS
    CloudFormation syntax on deployment
    • Supports all AWS CloudFormation resource types
    https://aws.amazon.com/serverless/sam/

    View Slide

  46. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    SAM template
    AWSTemplateFormatVersion: '2010-09-09’
    Transform: AWS::Serverless-2016-10-31
    Resources:
    GetFunction:
    Type: AWS::Serverless::Function
    Properties:
    Handler: index.get
    Runtime: nodejs8.10
    CodeUri: src/
    Policies:
    - DynamoDBReadPolicy:
    TableName: !Ref MyTable
    Events:
    GetResource:
    Type: Api
    Properties:
    Path: /resource/{resourceId}
    Method: get
    MyTable:
    Type: AWS::Serverless::SimpleTable
    Just 20 lines to create:
    • Lambda function
    • IAM role
    • API Gateway
    • DynamoDB table

    View Slide

  47. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

    View Slide

  48. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

    View Slide

  49. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Shorten the learning curve with AWS Cloud Development
    Kit (CDK)
    Late 2020
    Brings cloud infrastructure to developers in ways the can understand
    • Build cloud infrastructure with the languages they already know
    • Use their existing tools and workflows
    • Helpful abstractions that remove the need to learn the details
    • Vibrant and fast-growing community of developers

    View Slide

  50. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    AWS Cloud Development Kit (AWS CDK)
    A multi-language development framework for modeling infrastructure as reusable components

    View Slide

  51. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Pillars of releasing modern applications
    Infrastructure
    as code

    View Slide

  52. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Pillars of releasing modern applications
    Continuous
    integration

    View Slide

  53. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Continuous integration goals
    Source Build Test Production

    View Slide

  54. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Continuous integration goals
    1. Automatically kick off a new release when new code is checked in
    2. Build and test code in a consistent, repeatable environment
    3. Continually have an artifact ready for deployment
    4. Continually close feedback loop when build fails

    View Slide

  55. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    AWS CodePipeline
    • Continuous delivery service for fast and reliable
    application updates
    • Model and visualize your software release process
    • Builds, tests, and deploys your code every time there is
    a code change
    • Integrates with third-party tools and AWS

    View Slide

  56. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    AWS CodePipeline: Supported sources
    Pick branch
    AWS CodeCommit
    GitHub
    Pick object or folder
    Amazon S3
    Pick Docker tag
    Amazon ECR
    Automatically kick off release and pull latest source code

    View Slide

  57. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    AWS CodePipeline: ECR source action
    Source code:
    “master” branch
    ECR repository:
    “release” tag

    View Slide

  58. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    AWS CodeBuild
    • Fully managed build service that compiles source code,
    runs tests, and produces software packages
    • Scales continuously and processes multiple builds
    concurrently
    • No build servers to manage
    • Pay by the minute, only for the compute resources you
    use
    • Monitor builds through CloudWatch Events

    View Slide

  59. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    AWS CodeBuild: Docker buildspec
    version: 0.2
    phases:
    build:
    commands:
    - $(aws ecr get-login --no-include-email)
    - docker build -t $IMAGE_REPO_NAME:$IMAGE_TAG .
    - docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $ECR_REPO:$IMAGE_TAG
    - docker push $ECR_REPO:$IMAGE_TAG

    View Slide

  60. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Continuous integration goals
    1. Automatically kick off a new release when new code is checked in
    2. Build and test code in a consistent, repeatable environment
    3. Continually have an artifact ready for deployment
    4. Continually close feedback loop when build fails

    View Slide

  61. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Pillars of releasing modern applications
    Continuous
    integration

    View Slide

  62. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Pillars of releasing modern applications
    Continuous
    deployment

    View Slide

  63. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Continuous deployment goals
    Source Build Test Production

    View Slide

  64. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Continuous deployment goals
    1. Automatically deploy new changes to staging environments for testing
    2. Deploy to production safely without impacting customers
    3. Deliver to customers faster: Increase deployment frequency, and
    reduce change lead time and change failure rate

    View Slide

  65. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    AWS CodeDeploy
    • Automates code deployments to any instance and
    Lambda
    • Handles the complexity of updating your applications
    • Avoid downtime during application deployment
    • Roll back automatically if failure detected
    • Deploy to Amazon EC2, Lambda, or on-premises
    servers

    View Slide

  66. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    CodeDeploy-Lambda deployments
    • Shifts traffic using Lambda function weighted aliases
    • Choose canary (“shift 10% of traffic for 10 minutes, then shift rest”) or linear
    (“shift 10% more traffic every 10 minutes”)
    • Validation “hooks” enable testing at each stage of the deployment
    • Fast rollback in seconds if case of hook failure or CloudWatch alarms
    • Monitor deployment status and history via console, API, Amazon Simple
    Notification Service (Amazon SNS) notifications, and CloudWatch Events

    View Slide

  67. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    CodeDeploy – Lambda deployments
    Enable in your serverless application template
    Resources:
    GetFunction:
    Type: AWS::Serverless::Function
    Properties:
    DeploymentPreference:
    Type: Canary10Percent10Minutes
    Alarms:
    - !Ref ErrorsAlarm
    Hooks:
    PreTraffic: !Ref PreTrafficHook
    Canary10Percent30Minutes
    Canary10Percent5Minutes
    Canary10Percent10Minutes
    Canary10Percent15Minutes
    Linear10PercentEvery10Minutes
    Linear10PercentEvery1Minute
    Linear10PercentEvery2Minutes
    Linear10PercentEvery3Minutes
    AllAtOnce

    View Slide

  68. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    CodeDeploy – Lambda canary deployment
    API
    Gateway
    Lambda
    function
    weighted
    alias “live”
    v1 Lambda
    function
    code
    100%

    View Slide

  69. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    CodeDeploy – Lambda canary deployment
    API
    Gateway
    Lambda
    function
    weighted
    alias “live”
    v1 code
    100%
    Run PreTraffic hook against v2 code before it receives traffic
    v2 code
    0%

    View Slide

  70. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    CodeDeploy – Lambda canary deployment
    API
    Gateway
    Lambda
    function
    weighted
    alias “live”
    v1 code
    90%
    Wait for 10 minutes, roll back in case of alarm
    v2 code
    10%

    View Slide

  71. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    CodeDeploy – Lambda canary deployment
    API
    Gateway
    Lambda
    function
    weighted
    alias “live”
    v1 code
    0%
    Run PostTraffic hook and complete deployment
    v2 code
    100%

    View Slide

  72. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Continuous deployment goals
    1. Automatically deploy new changes to staging environments for testing
    2. Deploy to production safely without impacting customers
    3. Deliver to customers faster: Increase deployment frequency, and
    reduce change lead time and change failure rate

    View Slide

  73. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Pillars of releasing modern applications
    Continuous
    deployment

    View Slide

  74. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Demo

    View Slide

  75. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    Takeaways
    1. No one knows what is DevOps
    2. Decompose for Agility
    3. Use the right tool for the right job – and focus your efforts on your value not
    everything else around it!

    View Slide

  76. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
    @darkosubotica
    ln/darko-mesaros
    twitch.tv/ruptwelve
    youtube.com/ruptwelve

    View Slide