Skip to content

Conversation

@hyoinkang
Copy link
Collaborator

@hyoinkang hyoinkang commented Feb 19, 2025

📌 Issue Number

🪐 작업 내용

  • CI/CD 배포에 소모되는 시간을 줄이고자 캐싱 적용

기존 빌드 시 소요되던 시간 / GHA runner에 성능에 따른 편차가 존재함
gradle 빌드 : 약 48s ~ 1m 10s
docker 빌드 : 약 12s ~ 17s

✅ PR 상세 내용

  • Gradle 빌드에 캐시 적용 (actions/cache, JDK-setup : cache 옵션)
  • gradle --no-daemon 옵션 적용
  • 도커 이미지 빌드에 캐시 적용 (docker/build-push-action)
  • 빌드 속도 테스트

📸 스크린샷(선택)

  1. gradle 캐시
    [캐시 적용 후-1] 45s / 1m 30s (https://github.com/Catch-y/Spring_BE/actions/runs/13413539952)
    [캐시 적용 후-2] 46s / 1m 29s (https://github.com/Catch-y/Spring_BE/actions/runs/13415569299/attempts/1)
    [캐시 삭제 후 실행] 56s / 1m 44s (https://github.com/Catch-y/Spring_BE/actions/runs/13415569299/attempts/3)
  2. 도커 캐시
    [캐시 적용 후-1] 35s + 52s / 2m 31s (https://github.com/Catch-y/Spring_BE/actions/runs/13414459309)
    [캐시 적용 후-2] 36s + 1m 26s / 2m 59s (https://github.com/Catch-y/Spring_BE/actions/runs/13414730011)
  • 결론 : runner의 속도가 보장되지 않는 gha의 특성 상, 편차가 있는 편이지만, gradle 캐시 적용, 도커 캐시 미적용이 빌드 시간에 있어 가장 최적화된 것으로 보임.

❌ 애로 사항

  • ./greadlew assemble로 빌드 시 실행 가능한 JAR을 만들지 않음
    -> 빌드 시간은 빨라 테스트 빌드에는 적합하지만, 도커 이미지 등을 만드는 경우에는 적합하지 않음.

=>빌드 명령어를 다시 bootJar로 바꿔 해결함.

📚 Reference

@hyoinkang hyoinkang self-assigned this Feb 19, 2025
@hyoinkang hyoinkang linked an issue Feb 19, 2025 that may be closed by this pull request
2 tasks
Copy link
Member

@StoneCAU StoneCAU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

성능 개선을 위해 많은 노력하신 부분이 인상깊습니다.
수고하셨습니다.

@hyoinkang hyoinkang merged commit b5b6827 into develop Feb 20, 2025
2 checks passed
@hyoinkang hyoinkang deleted the chore/220 branch February 20, 2025 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[chore] CI/CD 파이프라인에 캐싱 적용

3 participants