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

10x deployment frequency using GitLab Flow and GitHub Actions on AWS ECS

10x deployment frequency using GitLab Flow and GitHub Actions on AWS ECS

English version of this slide
https://speakerdeck.com/tadashi0713/depuroipin-du-wo10bei-nisita-burantizhan-lue-togithub-actions-on-aws-ecs

#githubactions #devops #awsecs #cicd #gitlabflow

Tadashi Nemoto

May 10, 2021
Tweet

More Decks by Tadashi Nemoto

Other Decks in Technology

Transcript

  1. 10x deployment frequency using GitLab Flow and GitHub Actions on

    AWS ECS Tadashi Nemoto
  2. Introduction • Tadashi Nemoto • Exawizards, Inc. • Platform Engineer

    (DevOps Engineer) ◦ Introduce and improve CI / CD pipelines ◦ Maintain production / develop environments ◦ Introduce Test Automation
  3. Have you introduced CI / CD ?

  4. Are these CI / CD pipelines optimized for current product

    / organization?
  5. State of DevOps Report 2019

  6. State of DevOps Report 2018

  7. State of DevOps Report 2018

  8. Startup companies need speed to market

  9. None
  10. Deployment Frequency(27 deploys / 2 weeks) 10x Deployment Frequency

  11. Outlines • Previous CI /CD pipelines and deployment flows •

    What I improved ◦ Jenkins → GitHub Actions on AWS ECS ◦ Git Flow → GitLab Flow • Effect of improvements • Challenges
  12. Previous CI / CD pipelines and deployment flows

  13. Previous CI / CD・Deployment flows • Hashicorp Nomad on AWS

    ◦ develop, staging, production environments ◦ Difficult to create multiple development environments • Git Flow as branching strategy ◦ Usages are slightly different depending on teams • Jenkins on AWS ◦ Some deployments to production depend on us
  14. Enable small, autonomous deployments

  15. Increase deployment frequency

  16. Improvement ① Jenkins → GitHub Actions on AWS ECS

  17. Jenkins • Maintenance cost ◦ Update versions, plugins ◦ Add

    machines, scale ◦ Authority management, Security, etc. • Need dedicated members or teams • Not suitable for autonomous deployments
  18. SaaS CI / CD tools

  19. Limitation of deployment

  20. GitHub Actions self-hosted runners

  21. GitHub Actions self-hosted runners • GitHub Actions provides self-hosted runners

    • No additional charge • Compatible both self-hosted and GitHub-hosted runners ◦ Deploy → self-hosted runners ◦ Test → GitHub-hosted runners • No need to maintain the management part of a CI / CD workflow (like a Jenkins master instance)
  22. GitHub Actions self-hosted runners on AWS ECS

  23. https://techblog.exawizards.com/entry/2020/11/04/100000

  24. Improvement ② Git Flow → GitLab Flow

  25. Git Flow

  26. Git Flow • Works well for projects with fixed release

    timing ◦ Mobile apps(1 release / 1~2 weeks) • Less beneficial for projects API / Frontend projects • More complex branch management, and not suitable for deploying to production frequently ◦ Creating release branches, Hotfix branches, Tags
  27. GitHub Flow

  28. GitHub Flow Prod env ︖env • Simpler branch management ◦

    master / feature branch • Enable high deployment frequency • Problems with verification environment ◦ master branch = prod environment ◦ staging environment︖ ◦ development environment︖ ︖env
  29. I want high deployment frequency while utilizing current environments (develop,

    staging, production)
  30. GitLab Flow • feature branch → merge to master branch

    ◦ Same as GitHub Flow • GitLab Flow allows to have branch for a release ◦ master branch → staging env ◦ production branch → production env ◦ Merge to production branch for production release Staging env Prod env
  31. Deploy to develop environment (workflow_dispatch)

  32. Automatically generate release pull requests Staging env Prod env

  33. https://techblog.exawizards.com/entry/2021/01/28/113812

  34. Effect of improvements

  35. Deployment Frequency(4 deploys / 1 month)

  36. Deployment Frequency(27 deploys / 2 weeks)

  37. Deployment Frequency(27 deploys / 2 weeks) 10x Deployment Frequency

  38. State of DevOps Report 2019

  39. Small, autonomous deployments

  40. Challenges

  41. Continuous monitoring / improvement

  42. PR based environments / drop self-hosted runners Staging env PR1

    env PR2 env
  43. Continuous Testing / Inspection

  44. Conclusion

  45. Message(Key takeaways) • Important to improve deployment frequency, especially startups

    • I achieved 10x deployment frequency by 2 improvements ◦ Jenkins → GitHub Actions on AWS ECS ◦ Git Flow → GitLab Flow • Continuous monitoring / improvement