Skip to content

Conversation

@Jinseong01
Copy link
Contributor

@Jinseong01 Jinseong01 commented May 18, 2025

🔍 관련 이슈

#96

💡 주요 변경사항

수동 배포 시의 빌드 시간이 길어지는 문제를 해결하고자 생성한 이슈인데, 이후에 CI/CD까지 구현되어 전체 배포 프로세스를 고려하여 수정하였습니다.

특히 '의존성 캐싱'에 중점을 두어, CI/CD 파이프라인의 Build(CI) 단계에서 이전 빌드에서 캐시된 의존성을 재사용하도록 설정했습니다.
또한, 배포용 Dockerfile을 멀티 스테이지 빌드와 의존성 캐싱을 적용해 빌드 속도를 개선하고자 하였습니다.

🎯 테스트 방법

X

🚨 논의하고 싶은 점

실제로 유의미한 결과가 있을지는 잘 모르겠습니다...
효과가 미비하면 추후에 2차 리팩토링해보겠습니다...

🚨🚨 추가 변경사항

해당 내용은 PR 사항이라기보다 개인적 기록용으로 작성합니다!
의존성 캐싱 도입한 내용 배제하고 지금까지의 CI/CD 관련 내용 정리합니다.

basic_deploy.yml.disabled

V1 : CI 단계에서 간단 jar build(컴파일 체크용) + CD 단계에서 jar build & 도커 이미지 build
컴파일 체크용이지만, build를 2번하는 것이 개인적으로 비효율적이라고 생각하였습니다.
슬라이드2

jar_deploy.yml.disabled

V2 : CI 단계에서 jar build + CD 단계에서 CI 단계의 jar파일을 EC2로 전송 & 도커 이미지 build
jar build는 1번으로 줄어들었지만, jar파일을 EC2로 전송하는 시간이 너무 오래 걸려서 되려 CI/CD 총 소요시간이 20분까지 걸리는 문제가 발생하였습니다. (V1보다 되려 악화되어서 바로 폐기)
슬라이드3

docker_hub_deploy.yml

V3: CI단계에서 jar build & 도커 이미지 build & Docker Hub로 업로드 + CD단계의 EC2에서 Docker Hub의 이미지를 다운로드
V2의 실패로 인하여 방법을 더 찾던 과정에서 Docker Hub를 알게 되었고, 현재 적용한 상태입니다.
슬라이드4

image 현재 수동실행한 결과로는 총 3~4분 정도 소요되는 것으로 확인되었습니다. 워크플로우 파일 내용이 뒤죽박죽 섞이고 다소 난잡하여 더 깔끔하게 간소화하고 싶었으나, 시간도 얼마 남지 않았고하여 이쯤에서 마무리할까 합니다...

@Jinseong01 Jinseong01 self-assigned this May 18, 2025
@Jinseong01 Jinseong01 linked an issue May 18, 2025 that may be closed by this pull request
1 task
@hhd1337
Copy link
Member

hhd1337 commented May 18, 2025

의존성 캐싱과 멀티 스테이지 Dockerfile 적용을 통해 CI/CD 빌드 속도를 개선하셨군요. 유의미한 결과가 있으면 좋겠습니다! 고생하셨습니다!!!

@Jinseong01
Copy link
Contributor Author

다시 내용 확인하고 머지 필요할때 말씀드리겠습니다!

@Jinseong01 Jinseong01 force-pushed the refactor/#96 branch 10 times, most recently from 4c80c1e to 5752b88 Compare May 19, 2025 07:13
@Jinseong01 Jinseong01 force-pushed the refactor/#96 branch 4 times, most recently from d97fa36 to 2018cd0 Compare May 19, 2025 08:07
@Jinseong01 Jinseong01 force-pushed the refactor/#96 branch 4 times, most recently from 795b54c to 898baa0 Compare May 19, 2025 16:41
@Jinseong01 Jinseong01 force-pushed the refactor/#96 branch 21 times, most recently from 9161c52 to 9fa12f6 Compare May 19, 2025 18:38
@hhd1337
Copy link
Member

hhd1337 commented May 20, 2025

추가 변경사항까지 확인했습니다!! 고민 많이하신 흔적이 보이네요!! 고생하셨습니다!!

@hhd1337 hhd1337 merged commit 9de11dd into develop May 20, 2025
2 checks passed
@hhd1337 hhd1337 deleted the refactor/#96 branch May 20, 2025 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] 배포 성능 개선

3 participants