5. CI(Continuous Integration)
지속적인 통합(CI) : software 개발 방식
• 개발팀 구성원들이 각자 일단위로 code를 integration.
→ 하루에 다수의 integration이 발생.
• integration은 자동화된 build와 test로 검증.
→ integration error는 가능한 한 빠르게 감지.
위 방식의 도입으로 다수의 팀에서 만들어지는 integration 문
제를 획기적으로 줄임으로써 빠르게 software를 개발할 수 있
다.
2006… Martin Fowler
6. CD(Continuous Delivery)
• 지속적인 통합을 확장.
• CI 프로세스를 통과한 변경사항을
Test/Production 환경에 즉시 배포.
• 지속적인 전달(CD).
• dev/staging/production 환경에 대한
application 배치 자동화.
• 여러 application에 대한 변경 사항, 동시 배치
관리의 Pipeline.
• production 업데이트에 대한 승인 프로세스 제
공.
11. Container 기반 MSA에서 CI/CD 고려사항
• VCS(Version Control System) – Git 기반 repository.
• Container image registry – 내부 project들의 이미지가 외부에 노출되지 않도록 private
registry 필요.
• Container Orchestration – 다수의 Docker instance들을 clustering하여 scheduling,
network setup, 고가용성, 확장성을 관리.
• CI(Continuous Integration) – Polyglot(multi-language) programming을 지원, 다수의
MicroService CI Pipeline을 동시에 실행.
• CD(Continuous Delivery) – Container Orchestration과 통합되어 최신의 Container
image를 Roll out/back할 수 있는 기능과 인터페이스 제공.
12. CI/CD architecture 초안
• CI/CD는 Jenkins를 통해 관리.
• AWS ECR을 private image registr
로 사용.
• Container Orchestration platform
으로 AWS ECS 사용.
• Jenkins에서는 AWS CodePipeline
plug-in을 통해 deploy trigger.
• deploy step에서 issue 발생 시
email로 통지.
Developer
git commit
GitHub webhook
triggers Jenkins
Administrator
Request
deploy
Create container from latest image
docker pull [image:tag]
Amazon ECR
Amazon ECS
AWS
CodePipeline
triggersdeploy
appimages
13. CI/CD architecture 초안 문제 사항
Administrator
Amazon ECR Amazon ECS AWS
CodePipeline
Jenkins
• plug-in 관리의 복잡성.
• CI/CD Pipeline 작성의 어려움.
• 계정관리의 복잡성.
AWS Container Service
• Service discovery 미지원.(별도 solution 구축 필요.)
• Korea region 미지원(당시).
• AWS 서비스 의존성 100%.
• AWS 구성요소들에 대한 설정 복잡성 증가.
Administrator
• 모든 요소들에 대한 설정 및 제어.
• 배워야 하는 기술들의 증가.
• Microservice Project가 수 백개가 증가하면 작업량도 비례하여 증가.
14. Solution은?
Open source
Git 기반 version 관리 서비스
통합된 CI 제공.
Private Container Registry 통합.
Docker 기반으로 build 및 Test, 등록, 배포 자동화.
다수의 GitLab Runner 서버를 통해 동시작업을 병렬로
수행.
YAML 기반의 CI workflow 정의로 code화 template화
가능.
CLI script job executor로 Container
Orchestration(Kubernetes)에 배포가능.
GitLab
15. GitLab CI/CD process
• 개발자 – microservice project에 code를 commit.
• CI/CD pipelin은 .gitlab-ci.yml에 YAML code를 통해 정의.
• GitLab은 GitLab Runner들을 통해 병렬로 target에 deploy를 수행.
• pipeline 실행과정에서 발생된 issue는 slack에 통합되어 통지.
Developer
git commit Deploy
Kubernetes
notification
17. GitLab CI/CD Architecture
• GitLab CI/CD – GitLab의 일
부분으로 web applicatio과
state를 DB에 저장하는 API로
동작한다. project들과 build들
을 관리하며 사용자 친화적인
UI를 제공한다.
• GitLab Runner – build들을
처리하는 applicatio으로 별도
로 배치되어 GitLab CI/CD와
API를 통해 동작된다. 각각의
Runner는 공유되지만 project
에 dedicate될 수 있다.