-
Notifications
You must be signed in to change notification settings - Fork 1
[SRLT-122] prod workflow에서 arm64를 지원하도록 수정한다 #70
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
The head ref may contain hidden characters: "SRLT-122-arm-\uAE30\uBC18-\uC6CC\uD06C\uD50C\uB85C\uC6B0-\uC218\uC815"
Changes from all commits
19b6f1b
d87f5cb
38d0474
2e7d884
df3bba8
1119742
1cc92ff
be74db0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ jobs: | |
| SPRING_PROFILES_ACTIVE: test | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| submodules: recursive | ||
| token: ${{ secrets.PAT }} | ||
|
|
@@ -25,7 +25,7 @@ jobs: | |
| distribution: 'temurin' | ||
|
|
||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v3 | ||
| uses: gradle/actions/setup-gradle@v5 | ||
|
|
||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
|
|
@@ -34,46 +34,79 @@ jobs: | |
| run: ./gradlew clean build --info --stacktrace --no-daemon | ||
|
|
||
| - name: Docker login | ||
| uses: docker/login-action@v2 | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Set image tag | ||
| id: vars | ||
| run: echo "IMAGE_TAG=${GITHUB_SHA::7}" >> $GITHUB_ENV | ||
|
|
||
| - name: Build Docker image | ||
| run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/startuplight-be:${{ env.IMAGE_TAG }} -f deploy/Dockerfile . | ||
|
|
||
| - name: Docker Hub push | ||
| run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/startuplight-be:${{ env.IMAGE_TAG }} | ||
| # Multi-architecture 빌드 및 푸시 | ||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: deploy/Dockerfile | ||
| platforms: linux/amd64,linux/arm64 # 두 아키텍처 모두 빌드 | ||
| push: true | ||
| tags: ${{ secrets.DOCKERHUB_USERNAME }}/startuplight-be:${{ env.IMAGE_TAG }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
| - name: Checkout manifest repository | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| repository: 'StartUpLight/STARLIGHT_MANIFEST' | ||
| token: ${{ secrets.PAT }} | ||
| path: 'manifest' | ||
|
|
||
| - name: Update deployment.yml | ||
| - name: Update deployment.yml and push manifest | ||
| env: | ||
| DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| IMAGE_TAG: ${{ env.IMAGE_TAG }} | ||
| run: | | ||
| sed -i "s|image:.*|image: ${DOCKERHUB_USERNAME}/startuplight-be:${IMAGE_TAG}|g" manifest/production/deployment.yml | ||
|
|
||
| # 변경사항 확인 | ||
| echo "Updated deployment.yml:" | ||
| cat manifest/production/deployment.yml | ||
| update_manifest() { | ||
| local dir="$1" | ||
| local file="$dir/production/deployment.yml" | ||
|
|
||
| - name: Commit and push changes | ||
| env: | ||
| IMAGE_TAG: ${{ env.IMAGE_TAG }} | ||
| run: | | ||
| cd manifest | ||
| git config --local user.email "[email protected]" | ||
| git config --local user.name "SeongHo5356" | ||
| git add production/deployment.yml | ||
| git commit -m "Update image tag to $IMAGE_TAG" || exit 0 | ||
| git push | ||
| sed -i "s|image:.*|image: ${DOCKERHUB_USERNAME}/startuplight-be:${IMAGE_TAG}|g" "$file" | ||
| echo "Updated $file:" | ||
| cat "$file" | ||
|
|
||
| git -C "$dir" config --local user.email "[email protected]" | ||
| git -C "$dir" config --local user.name "SeongHo5356" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. email과 user name은 secrets로 관리해주는게 좋을 것 같습니다!!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. username/email은 수정될 일이 거의 없고, 민감정보라기보다는 단순 커밋 메타데이터라서 공개로 둬도 괜찮을 것 같다! |
||
| git -C "$dir" add production/deployment.yml | ||
|
|
||
| if [ -z "$(git -C "$dir" status --porcelain)" ]; then | ||
| echo "No changes to commit in $dir" | ||
| return 0 | ||
| fi | ||
|
|
||
| git -C "$dir" commit -m "Update image tag to $IMAGE_TAG" | ||
|
|
||
| for i in {1..3}; do | ||
| echo "Push attempt $i for $dir" | ||
| git -C "$dir" pull --rebase origin main && \ | ||
| git -C "$dir" push && \ | ||
| echo "Successfully pushed $dir" && \ | ||
| break || { | ||
| echo "Push failed for $dir, retrying in 2 seconds..." | ||
| sleep 2 | ||
| } | ||
| done | ||
|
|
||
| if ! git -C "$dir" diff --quiet origin/main HEAD; then | ||
| echo "ERROR: Failed to push $dir after 3 attempts" | ||
| return 1 | ||
| fi | ||
| } | ||
|
|
||
| update_manifest manifest | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ jobs: | |
| SPRING_PROFILES_ACTIVE: test | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| submodules: recursive | ||
| token: ${{ secrets.PAT }} | ||
|
|
@@ -25,33 +25,33 @@ jobs: | |
| distribution: 'temurin' | ||
|
|
||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v3 | ||
| uses: gradle/actions/setup-gradle@v5 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: Summary of v5 changes and migration notes (from v3) Key breaking change in v5
Other notable changes (upgrade guidance)
Migration steps from gradle/gradle-build-action@v3 -> gradle/actions/setup-gradle@v5
Sources Would you like me to fetch the exact runner release note (v2.327.1) and include the GitHub Actions runner release link and exact CLI commands to update a self-hosted runner? 🌐 Web query:
💡 Result: Short answer: gradle/actions/setup-gradle@v5 is compatible with Java 21 — but what matters is the Gradle version it installs and the JDK you set up.
Recommendation: in your workflow install JDK 21 (actions/setup-java@v4/5) and either:
Sources:
gradle/actions/setup-gradle@v5로 업그레이드 시 다음 세 가지를 반드시 확인하세요 v3에서 v5로의 메이저 버전 업그레이드는 다음과 같은 주의사항이 있습니다:
🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. @SeongHo5356, 세 가지 체크포인트를 모두 확인해주셔서 감사합니다!
모든 전제 조건이 충족되었으니 v5로 안전하게 업그레이드할 수 있습니다. 🚀 |
||
|
|
||
| - name: Grant execute permission for gradlew | ||
| run: chmod +x gradlew | ||
|
|
||
| - name: Build with Gradle Wrapper | ||
| run: ./gradlew clean build --info --stacktrace --no-daemon | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Docker login | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Set image tag | ||
| id: vars | ||
| run: echo "IMAGE_TAG=${GITHUB_SHA::7}" >> $GITHUB_ENV | ||
|
|
||
| # Multi-architecture 빌드 및 푸시 | ||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v5 | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: deploy/Dockerfile | ||
|
|
@@ -62,30 +62,59 @@ jobs: | |
| cache-to: type=gha,mode=max | ||
|
|
||
| - name: Checkout manifest repository | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| repository: 'StartUpLight/STARLIGHT_MANIFEST' | ||
| token: ${{ secrets.PAT }} | ||
| path: 'manifest' | ||
|
|
||
| - name: Update deployment.yml | ||
| - name: Checkout manifest repository (oracle) | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| repository: 'StartUpLight/STARLIGHT_MANIFEST_ORACLE' | ||
| token: ${{ secrets.PAT }} | ||
| path: 'manifest-oracle' | ||
|
|
||
| - name: Update deployment.yml and push manifests | ||
| env: | ||
| DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| IMAGE_TAG: ${{ env.IMAGE_TAG }} | ||
| run: | | ||
| sed -i "s|image:.*|image: ${DOCKERHUB_USERNAME}/startuplight-be:${IMAGE_TAG}|g" manifest/staging/deployment.yml | ||
|
|
||
| # 변경사항 확인 | ||
| echo "Updated deployment.yml:" | ||
| cat manifest/staging/deployment.yml | ||
| update_manifest() { | ||
| local dir="$1" | ||
| local file="$dir/staging/deployment.yml" | ||
|
|
||
| - name: Commit and push changes | ||
| env: | ||
| IMAGE_TAG: ${{ env.IMAGE_TAG }} | ||
| run: | | ||
| cd manifest | ||
| git config --local user.email "[email protected]" | ||
| git config --local user.name "SeongHo5356" | ||
| git add staging/deployment.yml | ||
| git commit -m "Update image tag to $IMAGE_TAG" || exit 0 | ||
| git push | ||
| sed -i "s|image:.*|image: ${DOCKERHUB_USERNAME}/startuplight-be:${IMAGE_TAG}|g" "$file" | ||
| echo "Updated $file:" | ||
| cat "$file" | ||
|
|
||
| git -C "$dir" config --local user.email "[email protected]" | ||
| git -C "$dir" config --local user.name "SeongHo5356" | ||
| git -C "$dir" add staging/deployment.yml | ||
|
|
||
| if [ -z "$(git -C "$dir" status --porcelain)" ]; then | ||
| echo "No changes to commit in $dir" | ||
| return 0 | ||
| fi | ||
|
|
||
| git -C "$dir" commit -m "Update image tag to $IMAGE_TAG" | ||
|
|
||
| for i in {1..3}; do | ||
| echo "Push attempt $i for $dir" | ||
| git -C "$dir" pull --rebase origin main && \ | ||
| git -C "$dir" push && \ | ||
| echo "Successfully pushed $dir" && \ | ||
| break || { | ||
| echo "Push failed for $dir, retrying in 2 seconds..." | ||
| sleep 2 | ||
| } | ||
| done | ||
|
|
||
| if ! git -C "$dir" diff --quiet origin/main HEAD; then | ||
| echo "ERROR: Failed to push $dir after 3 attempts" | ||
| return 1 | ||
| fi | ||
| } | ||
|
|
||
| update_manifest manifest | ||
| update_manifest manifest-oracle | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: StartUpLight/STARLIGHT_BE
Length of output: 1380
🏁 Script executed:
Repository: StartUpLight/STARLIGHT_BE
Length of output: 3833
🌐 Web query:
eclipse-temurin 21 jre alpine multi-architecture support amd64 arm64💡 Result:
Short answer: The official eclipse-temurin repository publishes multi‑arch images (including amd64 and arm64), but the alpine variant tags (e.g. 21-jre-alpine / -jdk-alpine) have historically been published only for amd64 — so an out‑of‑the‑box linux/arm64 manifest for 21-jre-alpine is often not available. [1][2][3]
What to do
Sources
Would you like me to check the current manifest for a specific tag (e.g. inspect eclipse-temurin:21-jre-alpine manifest now) and return exact platforms?
❌ Dockerfile의 베이스 이미지가 ARM64 멀티아키텍처 빌드를 지원하지 않습니다 - 즉시 수정 필요
CI/CD 파이프라인이 현재 설정 그대로 실행되면 linux/arm64 빌드에서 실패합니다.
문제점:
eclipse-temurin:21-jre-alpine은 amd64 아키텍처만 지원합니다. docker/build-push-action이 arm64 이미지를 빌드하려 할 때 "no matching manifest for linux/arm64/v8" 에러가 발생합니다.해결 방법:
deploy/Dockerfile의 런타임 베이스 이미지를 다음과 같이 변경하세요:
Dockerfile 수정 사항
eclipse-temurin:21-jre(non-Alpine)는 amd64와 arm64 모두에서 공식 지원되며, 이미지 크기 차이도 무시할 수 있는 수준입니다. 멀티아키텍처 빌드가 성공적으로 실행될 수 있도록 이 변경을 먼저 적용하세요.🤖 Prompt for AI Agents
Uh oh!
There was an error while loading. Please reload this page.
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.
🧩 Analysis chain
🏁 Script executed:
Length of output: 892
🌐 Web query:
💡 Result:
Short answer: Yes — as of Dec 31, 2025 the official eclipse-temurin:21-jre-alpine images are published for ARM64 (linux/arm64 / arm64v8). See the Docker Hub supported architectures and the Adoptium release notes about Alpine images. [1][2]
Sources
@SeongHo5356, 스테이징 검증 결과를 확인해주셔서 감사합니다! 👍
확인 결과, 제가 제시한 우려는 더 이상 유효하지 않습니다.
eclipse-temurin:21-jre-alpine이미지가 이제 ARM64 아키텍처를 공식 지원하고 있어서, 현재 Dockerfile 설정 그대로 멀티 아키텍처 빌드가 정상적으로 작동합니다.스테이징 서버에서의 실제 검증이 이를 확인해주었네요. 현재 설정으로 프로덕션 배포도 문제없이 진행하실 수 있습니다. 실제 테스트를 통해 확인해주셔서 감사합니다! 🚀