Skip to content

fix: kure_retriever CI가 :latest push에서 매번 실패하던 문제 수정 - #84

Merged
jeongmin1999 merged 1 commit into
mainfrom
fix/kure-lambda-latest-tag-immutability
Jul 4, 2026
Merged

jeongmin1999 merged 1 commit into
mainfrom
fix/kure-lambda-latest-tag-immutability

Conversation

@gpffh20

@gpffh20 gpffh20 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

문제

PR #82, #83 머지 후 CI(ai-ecr-push.yaml)의 "Build and push KURE retriever Lambda image" job이 둘 다 docker push \$LATEST_URI 단계에서 실패했습니다:

```
tag invalid: The image tag 'latest' already exists in the 'utterai-kure-retriever'
repository and cannot be overwritten because the tag is immutable.
```

이 job이 실패하면서 뒤 단계인 "Deploy image to Lambda"(update-function-code)가 실행 안 됐고, 버전 태그 이미지는 ECR에 정상 push됐는데도 실제 Lambda 코드는 갱신 안 되는 상태가 반복됐습니다 (PR #83의 웜업 수정도 이 때문에 CI로는 배포 안 돼서 수동으로 update-function-code를 직접 실행해 확인했습니다).

원인과 수정

utterai-kure-retriever ECR 리포지토리는 버전 관리를 강제하려고 imageTagMutability=IMMUTABLE로 설정돼 있는데, CI는 매 실행마다 :latest를 덮어쓰려고 시도해서 두 번째 실행부터 항상 실패했습니다.

:latest는 사실 최초 부트스트랩(Terraform이 Lambda를 처음 생성할 때 image_uri로 참조) 이후로는 전혀 안 쓰입니다 - lifecycle.ignore_changes로 무시되고, 실제 배포는 전부 버전 태그 + update-function-code로 이뤄지기 때문입니다. :latest push를 아예 없앴습니다 (실패를 무시하는 방식은 immutable 정책 자체를 무력화하므로 채택하지 않았습니다).

검증

  • YAML 파싱 확인
  • 로직상 나머지 build-and-push-cpu/gpu job과 동일한 패턴(버전 태그만 push)으로 통일됨

Test plan

  • 머지 후 다음 lambda/kure_retriever/** 변경에서 이 job이 끝까지(Deploy 단계 포함) 성공하는지 확인

Both real CI runs of the "Build and push KURE retriever Lambda image" job
after the ECR immutable-tag policy was in place failed at "docker push
$LATEST_URI" with "tag invalid: ... immutable" - meaning the job's actual
deploy step (update-function-code) never ran, so the Lambda kept running
stale code despite CI reporting activity.

:latest was never actually needed past the first bootstrap - Terraform's
image_uri reference to it is only read once at resource creation and then
ignored via lifecycle.ignore_changes; every real deploy already goes
through the versioned tag + update-function-code step below. Dropping the
:latest push (rather than ignoring its failure) keeps the immutable-tag
policy meaningful instead of quietly defeating it.
@jeongmin1999
jeongmin1999 self-requested a review July 4, 2026 06:01
@jeongmin1999
jeongmin1999 merged commit 35802e8 into main Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants