발표영상 다시보기: https://youtu.be/il8wpd7gxe8
CI/CD 기술을 통해 팀은 민첩성을 높이고 고품질 제품을 신속하게 출시 할 수 있습니다. 이 강의에서는 컨테이너화 된 응용 프로그램을 관리 할 수 있도록 CI/CD 워크 플로우 작성을위한 모범 사례를 안내합니다. AWS Cloud Development Kit를 사용하여 코드 애플리케이션 모델로 인프라를 다루고 AWS CodePipeline 및 AWS CodeBuild를 사용하여 CI/CD 릴리스 파이프 라인을 설정하는 방법을 보여줍니다. 마지막으로 AWS CodeDeploy를 사용한 안전한 배포 자동화에 대해 설명합니다.
2. 강연 중 질문하는 방법 AWS Builders
Go to Webinar “Questions” 창에 자신이 질문한
내역이 표시됩니다. 기본적으로 모든 질문은
공개로 답변 됩니다만 본인만 답변을 받고 싶으면
(비공개)라고 하고 질문해 주시면 됩니다.
본 컨텐츠는 고객의 편의를 위해 AWS 서비스 설명을 위해 온라인 세미나용으로 별도로 제작, 제공된 것입니다. 만약 AWS
사이트와 컨텐츠 상에서 차이나 불일치가 있을 경우, AWS 사이트(aws.amazon.com)가 우선합니다. 또한 AWS 사이트
상에서 한글 번역문과 영어 원문에 차이나 불일치가 있을 경우(번역의 지체로 인한 경우 등 포함), 영어 원문이 우선합니다.
AWS는 본 컨텐츠에 포함되거나 컨텐츠를 통하여 고객에게 제공된 일체의 정보, 콘텐츠, 자료, 제품(소프트웨어 포함) 또는 서비스를 이용함으로 인하여 발생하는 여하한 종류의 손해에
대하여 어떠한 책임도 지지 아니하며, 이는 직접 손해, 간접 손해, 부수적 손해, 징벌적 손해 및 결과적 손해를 포함하되 이에 한정되지 아니합니다.
고지 사항(Disclaimer)
16. 소스 빌드 알파 베타
준비단계
Artifacts
Automated
tests
Automated
integration
tests
Automated
load/perf
tests
Automated
browser
tests
App code
Infrastructure
as code
Configuration
Base image
17. 소스 빌드 알파 베타 감마
준비단계
Artifacts
Automated
tests
Automated
integration
tests
Automated
load/perf
tests
Automated
integration
tests
Automated
synthetic
tests
API smoke
tests
Automated
browser
tests
App code
Infrastructure
as code
Configuration
Base image
18. 소스 빌드 알파 베타 감마
준비단계 프로덕션
Artifacts
Automated
tests
Automated
integration
tests
Automated
load/perf
tests
Automated
integration
tests
Automated
synthetic
tests
API smoke
tests
Automated
browser
tests
App code
Infrastructure
as code
Configuration
Base image
19. 소스 빌드 알파 베타 감마
준비단계 프로덕션
Artifacts
Automated
tests
Automated
integration
tests
Automated
load/perf
tests
Automated
integration
tests
Automated
synthetic
tests
API smoke
tests
Automated
browser
tests
App code
Infrastructure
as code
Configuration
Base image
20. 소스 빌드 알파 베타 감마
준비단계 프로덕션
Artifacts
Automated
tests
Automated
integration
tests
Automated
load/perf
tests
Automated
integration
tests
Automated
synthetic
tests
API smoke
tests
Automated
browser
tests
App code
Infrastructure
as code
Configuration
Base image
21. 소스 빌드 알파 베타 감마
준비단계 프로덕션
Artifacts
Automated
tests
Automated
integration
tests
Automated
load/perf
tests
Automated
integration
tests
Automated
synthetic
tests
API smoke
tests
Automated
browser
tests
App code
Infrastructure
as code
Configuration
Base image
22. 소스 빌드 알파 베타 감마
준비단계 프로덕션
Artifacts
Automated
tests
Automated
integration
tests
Automated
load/perf
tests
Automated
integration
tests
Automated
synthetic
tests
API smoke
tests
Automated
browser
tests
App code
Infrastructure
as code
Configuration
Base image
23. 소스 빌드 알파 베타 감마
준비단계 프로덕션
Artifacts
Automated
tests
Automated
integration
tests
Automated
load/perf
tests
Automated
integration
tests
Automated
synthetic
tests
API smoke
tests
Automated
browser
tests
App code
Infrastructure
as code
Configuration
Base image
…
24. 소스 빌드 알파 베타 감마
준비단계 프로덕션
Artifacts
Automated
tests
Automated
integration
tests
Automated
load/perf
tests
Automated
integration
tests
Automated
synthetic
tests
API smoke
tests
Automated
browser
tests
App code
Infrastructure
as code
Configuration
Base image
…
파이프라인 방해물: 코드 커버리지, 코드 리뷰, 보안 검색, 의존성 업데이트, 시간대, 파이프라인 정책, 기타 여러가지
26. 릴리스 프로세스 단계
소스 빌드 테스트 프로덕션
• Check-in source
code such as
.java files and
Dockerfile
• Peer review new
code
27. 릴리스 프로세스 단계
소스 빌드 테스트 프로덕션
• Check-in source
code such as
.java files and
Dockerfile
• Peer review new
code
• Compile code
• Unit tests
• Style checkers
• Create container
images
28. 릴리스 프로세스 단계
소스 빌드 테스트 프로덕션
• Integration tests
with other
systems
• Load testing
• UI tests
• Security testing
• Check-in source
code such as
.java files and
Dockerfile
• Peer review new
code
• Compile code
• Unit tests
• Style checkers
• Create container
images
29. 릴리스 프로세스 단계
소스 빌드 테스트 프로덕션
• Integration tests
with other
systems
• Load testing
• UI tests
• Security testing
• Check-in source
code such as
.java files and
Dockerfile
• Peer review new
code
• Compile code
• Unit tests
• Style checkers
• Create container
images
• Deploy to
production
environments
• Monitor code in
production in
order to quickly
detect errors
30. 릴리스 프로세스 단계
소스 빌드 테스트 프로덕션
• Integration tests
with other
systems
• Load testing
• UI tests
• Security testing
• Check-in source
code such as
.java files and
Dockerfile
• Peer review new
code
• Compile code
• Unit tests
• Style checkers
• Create container
images
• Deploy to
production
environments
• Monitor code in
production in
order to quickly
detect errors
35. AWS CodePipeline: 지원하는 소스
브랜치 선택
AWS CodeCommit
GitHub
오브젝트나 폴더
선택
Amazon Simple Storage
Service (Amazon S3)
도커 태그 선택
Amazon Elastic
Container Registry
(Amazon ECR)
릴리스를 자동으로 시작하고 최신 소스 코드를 가져옵니다
37. AWS CodeBuild
• 완전 관리형 소프트웨어 빌드 서비스
• 지속적으로 확장되며 여러 빌드를 동시에 처리
• 관리할 빌드 서버가 없음
• 빌드에 소모되는 시간만큼만 분당 요금을 지불
38. AWS CodeBuild for containers
• 도커 이미지를 빌드, 푸시, 확인
• 도커와 AWS CLI가 모든 CodeBuild 이미지에 기본
탑재 되어 있음
• Docker 이미지를 Amazon ECR로 푸시하기 위해
빌드 환경에 채워진 역할 자격 증명
• Amazon ECR에 이미지를 푸시하기위한 역할
자격증명이 빌드 환경에 포함
• 사용자 지정 빌드 이미지 사용 가능
44. Amazon ECR 변경 불가능한 이미지 태그
$ aws ecr put-image-tag-mutability
--repository-name my-ecr-repo
--image-tag-mutability IMMUTABLE
$ docker push $ECR_REPO:latest
Tag invalid: The image tag ‘latest’ already exists in the ‘my-
ecr-repo’ repository and cannot be overwritten because the
repository is immutable.
48. AWS CodePipeline: 샘플 파이프라인
Source code:
“master” 브랜치
CodeBuild:
어플리케이션 이미지
빌드 및 푸시
Amazon ECS:
이미지를
테스트 환경에
배포
소스 빌드 테스트 프로덕션
Amazon ECS:
이미지를
프로덕션
환경에 배포
49. AWS CodePipeline: 이미지 파이프라인
Source code:
“master”
브랜치
CodeBuild:
베이스 이미지나
사이드카 이미지
빌드 및 푸시
Amazon ECR 베이스
이미지나 사이드카
이미지 저장소:
“release” 태그
50. AWS CodePipeline: 샘플 파이프라인
Source code:
“master”
브랜치
CodeBuild:
어플리케이션 이미지
빌드 및 푸시
Amazon ECS:
이미지를 테스트와
프로덕션에 순차적
배포
51. AWS CodePipeline: 샘플 파이프라인
Source code:
“master”
branch
Amazon ECR base
image repository:
“release” tag
CodeBuild:
Build and push
application image
Amazon ECS:
Deploy image to
test, then
production
52. AWS CodePipeline: 샘플 파이프라인
Source code:
“master”
branch
Amazon ECR base
image repository:
“release” tag
CodeBuild:
Build and push
application image
Amazon ECR sidecar
image repository:
“release” tag
Amazon ECS:
Deploy image to
test, then
production
88. AWS Cloud Development Kit (AWS CDK)
• 익숙한 프로그래밍 언어를 사용하여 클라우드
인프라를 정의할 수 있는 오픈 소스 소프트웨어
개발 프레임워크
• JavaScript, TypeScript, Python, Java 및 C# 지원
• AWS CloudFormation을 통해 리소스를 프로비저닝
• CloudFormation 리소스를 모두 지원
• AWS의 노하우가 담겨있는 풍부한 상위 레벨 구문을
제공
95. AWS CDK code를 위한 CI/CD
Repo(s) contain
app code & CDK
code
소스 단계 빌드 단계 테스트 단계 프로덕션 단계
Build & push
image;
synthesize CDK
template
Deploy CFN
template file;
run tests
Deploy CFN
template file;
monitor