Advertisement
Advertisement

More Related Content

Slideshows for you(20)

Similar to 다양한 배포 기법과 AWS에서 구축하는 CI/CD 파이프라인 l 안효빈 솔루션즈 아키텍트(20)

Advertisement

More from Amazon Web Services Korea(20)

Recently uploaded(20)

Advertisement

다양한 배포 기법과 AWS에서 구축하는 CI/CD 파이프라인 l 안효빈 솔루션즈 아키텍트

  1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 다양한 배포 기법과 AWS에서 구축하는 CI/CD 파이프라인 Hyobin An, Solutions Architect
  2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Agenda • CI/CD 란 무엇인가? • CI/CD 가 해결할 수 있는 문제 • AWS 에서 구축하는 CI/CD • 다양한 배포 기법 • Rolling • Blue/Green • Canary • Blue/Green 배포 Demo
  3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CI/CD 란 무엇인가?
  4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CI/CD 란 무엇인가? 지속적 통합(Continuous Integration) • 모든 개발자가 개발한 코드를 공유 리포지토리에 하루에도 여러번 코드를 커밋하고 병합하는 것 지속적 전달(Continuous Delivery) • 개발팀이 짧은 주기로 소프트웨어를 개발하고 언제든지 운영환경으로 안정적으로 배포하는 것
  5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 전달 vs 배포 지속적 전달(Continuous Delivery) • 배포 가능한 Asset 생성 • 운영환경으로의 배포에 일종의 승인 작업이 필요 지속적 배포(Continuous Deployment) • 변경사항이 운영환경으로 자동 배포
  6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CI/CD 가 해결할 수 있는 문제
  7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 몇 가지 질문들… 얼마나 많은 배포를 수행하고 있는지? “우리는 분기별 릴리즈 주기를 가지고 있어요, 연간 4번 정도랄까요?” 얼마나 많은 배포가 업무 시간 이외에 수행되는지? “고객의 영향을 최소화하는게 우선입니다, 다들 주무실 때가 대부분이죠” 얼마나 많은 사람들이 급작스런 롤백으로 고통 받는지? “자꾸 늦게 문제를 확인하는 바람에.. 릴리즈 전 백업에서 롤백해야 하는게 보통이죠”
  8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 몇 가지 질문들… 얼마나 많은 배포를 수행하고 있는지? “우리는 분기별 릴리즈 주기를 가지고 있어요, 연간 4번 정도랄까요?” 얼마나 많은 배포가 업무 시간 이외에 수행되는지? “고객의 영향을 최소화하는게 우선입니다, 다들 주무실 때가 대부분이죠” 얼마나 많은 사람들이 급작스런 롤백으로 고통 받는지? “자꾸 늦게 문제를 확인하는 바람에.. 릴리즈 전 백업에서 롤백해야 하는게 보통이죠” “셀 수 없이 많이” “시간은 무관!” “뒤로 가지는 않아요, 앞으로 나아갈뿐!”
  9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CI/CD 가 무엇을 해결할 수 있는가? • 빌드, 테스트 및 배포 단계를 자동화 • 소프트웨어 릴리스 주기 가속화 • 비용 및 배포 변경에 대한 위험 감소 • 개발자가 빠르게 피드백을 얻을 수 있음 • 소프트웨어 개발에 대한 반복적인 접근이 쉬워짐
  10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon.com 의 사례
  11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 이전의 Amazon.com 애플리케이션은 중앙집중식 (monolith) 컴파일에 18시간이 필요한 1GB 크기의 실행파일과 중앙집중식 배포팀
  12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon 의 개발 변혁: 2001 - 2009 20092006 마이크로서비스 2-피자팀
  13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 그렇게 Amazon 은 수천개의 서비스 팀 + Microservice 아키텍처 + 다양한 환경 + 지속적 전달 ? = 50 million deployments / 1 yr (1.5 deployments / 1 sec)
  14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CI/CD 의 이점 신뢰성 속도 확장성 신속한 전달향상된 협업 보안
  15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 숫자로 보는 CI/CD 의 이점 30x 더 잦은 배포 200x 짧은 리드 타임 60x 더 적은 실패 168x 더 빠른 복구
  16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 그래서 다양한 도구들이 개발되었고, 현재의 AWS 개발 도구들이 되었습니다.
  17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS 에서 구축하는 CI/CD
  18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 소스 빌드 테스트 프로덕션 • 버전 관리 • 브랜칭 • 코드 리뷰 • 컴파일 • 유닛 테스트 • 정적 분석 • 패키징 • 통합 테스트 • 부하 테스트 • 보안 테스트 • 적용 테스트 • 배포 • 모니터링 • 검증
  19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS 개발자 도구 소프트웨어 릴리즈 단계: 소스 빌드 테스트 프로덕션 Third-Party Tooling 또는 AWS CodeCommit AWS CodeBuild AWS CodeDeploy AWS CodePipeline
  20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 소스 단계 도구 • AWS CodeCommit • Git 과 호환이 가능한 소스 리포지토리 • 다른 AWS 서비스와 통합, e.g. IAM, KMS • 변경사항 감사 • Pull 요청과 CloudWatch 알람 • GitHub Enterprise • Bitbucket, etc.
  21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 빌드 단계 도구 • AWS CodeBuild • 소스를 컴파일하고 테스트한 뒤 배포 준비가 된 asset을 생성하는 관리형 빌드 서비스 • VPC 액세스 • Jenkins • Others
  22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 테스트 단계 • 여러 기준의 따른 업데이트 검증 • UI, 로드, 통합, API • 업데이트 확인 및 버그 발견
  23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 프로덕션/배포 단계 도구 • AWS CodeDeploy • 원하는 리소스에 코드 배포를 자동화하는 서비스 • 다양한 배포 기법 • Rolling • Blue/Green • Canary
  24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 배포 자동화
  25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 배포 자동화 AWS CloudFormation 구성
  26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 배포 자동화 AWS CloudFormation AWS CodeCommit AWS CodePipeline AWS CodeDeploy AWS CodeBuild S3 Bucket 승인 Amazon SNS 구성
  27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 배포 자동화 AWS CloudFormation AWS CodeCommit AWS CodePipeline AWS CodeDeploy AWS CodeBuild 체크인 S3 Bucket 승인 Amazon SNS
  28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 배포 자동화 AWS CloudFormation AWS CodeCommit AWS CodePipeline AWS CodeDeploy AWS CodeBuild 체크인 S3 Bucket 승인 Template Staging instances Elastic Load Balancing Auto Scaling Amazon SNS
  29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 배포 자동화 AWS CloudFormation AWS CodeCommit AWS CodePipeline AWS CodeDeploy AWS CodeBuild 체크인 S3 Bucket 승인 Template Staging instances Elastic Load Balancing Auto Scaling Amazon SNS Production instances Elastic Load Balancing Auto Scaling
  30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 다양한 배포 기법 • Rolling • Blue/Green • Canary
  31. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Rolling 배포 • 애플리케이션의 새 버전을 한 번에 하나의 배치로 배포 • 기존 버전을 실행하는 인스턴스는 점차 제거 • 트래픽은 구 버전에서 새 버전으로 점진적으로 옮겨가게 됨
  32. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Rolling 배포 Availability Zone Availability Zone Scenario 새로운 버전의 애플리케이션을 다음의 구성에 따라 배포합니다. Desired Count = 2 Minimum Healthy Percent = 50% Maximum Percent = 100% 이러한 설정은 서비스가 원하는 크기를 초과하지 않도록 하지만 배포 중 인스턴스의 수는 절반으로 줄어들게 됩니다. EXISTING EXISTING
  33. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Rolling 배포 Availability Zone Availability Zone 우선, 기존의 인스턴스 한대가 종료되어 서비스의 비율이 50% 가 됩니다. EXISTING Desired Count = 2 Minimum Healthy Percent = 50% Maximum Percent = 100%
  34. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Rolling 배포 Availability Zone Availability Zone 새로운 버전의 애플리케이션 인스턴스가 배포된 뒤 서비스는 100% 정상 상태가 됩니다. EXISTING Desired Count = 2 Minimum Healthy Percent = 50% Maximum Percent = 100% NEW
  35. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Rolling 배포 Availability Zone Availability Zone ELB가 새로운 인스턴스가 정상인 것을 확인한 뒤에 남아 있는 구 버전의 인스턴스를 삭제합니다. Desired Count = 2 Minimum Healthy Percent = 50% Maximum Percent = 100% NEW
  36. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Rolling 배포 Availability Zone Availability Zone 새로운 버전의 인스턴스가 ELB 에 할당되고 배포가 완료 됩니다. 100% 정상 상태가 됩니다. NEW NEW Desired Count = 2 Minimum Healthy Percent = 50% Maximum Percent = 100%
  37. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Blue/Green 배포 • 구버전과 새버전을 동시에 나란히 구성 • 하나의 버전만 프로덕션 트래픽을 처리 • 빠른 롤백 가능 • 운영환경에 영향을 주지 않고 새 버전 테스트 가능 • Ex) 새 버전은 다른 포트에서 수신하거나 내부 리소스로만 액세스 가능
  38. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Blue/Green 배포 Availability Zone EXISTING EXISTING Scenario 호스트 기반 라우팅을 사용하여 동일한 ALB에 다른 버전의 애플리케이션이 서로 다른 타겟 그룹으로 나란히 구성됩니다. 배포는 두 버전의 리스너 규칙이 Swap 되며 완료됩니다. Availability Zone
  39. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Blue/Green 배포 Availability Zone EXISTING EXISTING 새로운 서비스가 동일한 ALB의 새로운 타겟 그룹으로 등록됩니다. 호스트 기반 라우팅을 사용하여 www.example.com 에 대한 요청은 Blue 서비스(기존)로 전달되고, next.example.com에 대한 요청은 Green 서비스(신규)로 연결됩니다. NEW NEW Availability Zone
  40. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Blue/Green 배포 Availability Zone 자동 또는 수동 테스트 후 ALB에서 리스너 규칙을 Swap하고 프로덕션 트래픽을 Green 서비스로 전달하여 배포를 완료하게 됩니다. NEW NEW Availability Zone EXISTING EXISTING
  41. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Blue/Green 배포 Availability Zone 이전 서비스 및 해당 대상 그룹을 파괴할 수 있습니다. NEW NEW Availability Zone
  42. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Canary 스타일 배포 • 새 버전의 애플리케이션으로 프로덕션 트래픽의 일부를 분산 • A/B 테스팅 사용 가능 • 라우팅은 임의적이거나 사용자 프로필을 기반으로 할 수 있음 • 결과에 따라 Canary 버전이 운영 환경을 대체하거나 혹은 중지할 수 있음
  43. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Canary 스타일 배포 Scenario 새로운 버전의 애플리케이션을 Elastic Beanstalk 를 이용하여 배포합니다. Route53의 가중치 기반 라우팅 방식으로 새로운 애플리케이션에 조금씩 트래픽을 이동합니다. 이후 테스트 결과에 따라 이전 버전으로의 롤백도 수월하게 할 수 있습니다.
  44. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Canary 스타일 배포 우선 조금의 트래픽을 이동한 뒤 테스트를 진행합니다. 내부 테스트를 진행할 수도 있고 A/B 테스팅 방식으로 사용자 반응을 볼 수도 있습니다.
  45. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Canary 스타일 배포 10%의 트래픽을 라우팅한 뒤 문제가 발견되지 않는다면 점진적으로 트래픽을 새로운 버전으로 옮겨갑니다.
  46. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Canary 스타일 배포 10%의 트래픽을 라우팅한 뒤 문제가 발견되지 않는다면 점진적으로 트래픽을 새로운 버전으로 옮겨갑니다. 모니터링을 통해 결과가 좋지 않다면 이전 버전으로 롤백할 수 있습니다.
  47. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Canary 스타일 배포 트래픽을 새로운 버전으로 라우팅한 뒤 문제가 발견되지 않는다면 점진적으로 트래픽을 새로운 버전으로 옮겨갑니다. 모니터링을 통해 결과가 좋지 않다면 이전 버전으로 롤백할 수 있습니다.
  48. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Canary 스타일 배포 새로운 버전으로 트래픽을 100% 이동합니다. 구 버전의 애플리케이션 환경은 여전히 남아있기 때문에 여전히 롤백이 가능합니다.
  49. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Canary 스타일 배포 이 후 이전 환경을 제거하면 모든 배포 프로세스가 완료됩니다.
  50. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Blue/Green 배포 Demo ☺
  51. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Demo 흐름 Availability Zone EXISTING EXISTINGNEW NEW Availability Zone
  52. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Demo 흐름 Availability Zone EXISTING EXISTINGNEW NEW Availability Zone
  53. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DEMO ☺
  54. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Reference Deep Dive into Blue/Green Deployments on AWS (re:Invent 2015) https://www.youtube.com/watch?v=aX54mhZbN58&t=7s CI/CD Deployment Github https://github.com/awslabs/ecs-refarch-continuous-deployment Blue/Green Deployment Github https://github.com/awslabs/ecs-blue-green-deployment Canary Blue/Green Deployment Github https://github.com/awslabs/ecs-canary-blue-green-deployment
  55. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 더 자세한 것은 AWS 교육 정보를 참고하시기 바랍니다. 온라인 교육 AWS 무료 온라인 교육 자료, 실습 과정을 만나실 수 있습니다. 오프라인 공인 교육 AWS 공인 강사가 직접 유료 과정을 통해 다양한 교과 과정을 운영합니다. AWS 공인 자격증 산업 현장에서 인정 받을 수 있는 다양한 전문 자격증 제도를 활용하세요. 더 자세한 사항은 AWS 교육 자료 웹 사이트를 참고하세요! https://www.aws.training/
  56. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Innovate에 참여해주셔서 감사합니다! 본 세션이 끝난 후, 간단한 설문 조사에 응해 주시면 여러분의 피드백을 바탕으로 향후 더 좋은 콘텐츠를 준비해드리겠습니다. 다양한 AWS 콘텐츠를 온라인에서 만나보세요! aws-korea-marketing@amazon.com twitter.com/AWSKorea facbook.com/AmazonWebServices youtube.com/user/AWSKorea slideshare.net/AWSKorea twitch.tv/aws
Advertisement