-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
무중단 배포 스크립크 작성 (issue #456) #480
base: dev
Are you sure you want to change the base?
Conversation
기존 PR 닫고 커밋들만 체리 픽 해서 새로 PR 만들었어요 @alstn113 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
안녕하세요. 아톰입니다. 구현 잘해주시고 시나리오 별로 테스트 결과 공유 해주셔서 감사합니다.
엣지 케이스가 될만한 부분 의견 들어보고 싶어서 RC 드려요. 고생 많으셨습니다. 😀
public ResponseEntity<ApiResponse<String>> health() { | ||
return ResponseEntity.status(200).body(new ApiResponse<>("up")); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Approve]
ResponseEntity.ok 레츠고?
findPreviousImageVersion: | ||
name: 🔎Find Previous Docker Image Version | ||
runs-on: [ self-hosted, devel-up-prod-a ] | ||
outputs: | ||
previousImageVersion: ${{steps.find_version.outputs.name}} | ||
steps: | ||
- id: find_version | ||
run: | | ||
PREVIOUS_IMAGE_NAME=$(docker ps --format "{{.Image}}") | ||
echo "name=$PREVIOUS_IMAGE_NAME" >> $GITHUB_OUTPUT | ||
echo $PREVIOUS_IMAGE_NAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Commnet]
build job이 해당 작업 안기다려줘도 되는건지 궁금하네요. 👀
만약, build job -> deployToA job까지 수행 했어요.
그리고 healthCheckA 수행 이전에 컨테이너가 잠깐 실행되었고 실패했다고 했을때, docks ps를 찍으면 실패한 최신 도커 이미지 버전이 롤백 대상 버전이 될 가능성은 없나요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굳굳 좋아요. 그럴 가능성이 적긴하네요. 👍
cd 과정에 평균 find previus docker image version 잡 수행 시간이 추가되는 것보다는 자동 롤백 실패 비용이 더 작겠네요.
graceful shutdown 논의는 슬랙으로 이어나가시고, 헬스 체크 api 선택적으로 반영해주시고 다시 요청 주시면 approve 처리할게요.
이 PR이 머지된 이후 main에 머지되기 전에 작업해야되는 내용
product 환경 DB 연동
현재 새로 요구받은 프로덕션 DB환경으로의 연동이 Java 코드에 반영되어있지 않아 임시로 product 환경에서도 local 프로파일로 동작하게 되어있습니다.
다만 이는 아직 main에 배포되지 않았기 때문에 원래 프로덕션 서버는 기존 DB와 연동되고있습니다.
신규 배포 환경은 우선 api2.devel-up.co.kr로 연동해놨어요.
product 환경 로깅 및 모니터링 시스템 연동
구현 요약
Rolling 방식의 무중단 배포를 구현했습니다.
배포 과정은 크게 다음과 같습니다.
알림은 4가지 시나리오에서 발생합니다.
두번째 시나리오는 극단적인 상황이라 재현이 힘들어서 따로 테스트하지 못했습니다.
연관 이슈
참고
코드 리뷰에
RCA 룰
을 적용할 시 참고해주세요.