Repository navigation
fix: kure_retriever Lambda Docker 빌드 실패 수정 (numpy wheel + hash pinning) - #82
Merged
Merged
Conversation
…inning The two most recent ai-ecr-push CI runs (PR #79, #80 merges) both failed in the "Build and push KURE retriever Lambda image" job, so the ECR repo never actually got an image pushed - the Lambda/Gateway have nothing to point at yet despite the Terraform being merged. Root cause 1: numpy>=1.26.0 resolves to the latest 2.x (2.4.6 at lock time), which only ships manylinux wheels requiring glibc>=2.28. public.ecr.aws/lambda/python:3.11 is Amazon Linux 2 (glibc 2.26), so pip falls back to building numpy from source - which fails because that base image has no C compiler. Fix: use python:3.12 (Amazon Linux 2023, glibc 2.34) instead, for both the builder and runtime stage. Root cause 2: switching the base image surfaces a second failure - `uv export | pip install -r ... --target` puts pip in --require-hashes mode, which then rejects installing torch's build-time `setuptools` dependency because uv export only hash-pins runtime deps, not PEP 517 build deps. Fix: use `uv pip install --target` instead of plain pip, which resolves this correctly. Verified with a real `docker build` of the full Dockerfile (not just the dependency-install step) on --platform linux/amd64 to match the GitHub Actions runner architecture: model bake + all stages complete, image builds successfully.
jeongmin1999
approved these changes
Jul 4, 2026
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
문제
PR #79, #80 머지 시점에 자동으로 돈
ai-ecr-push.yaml의 "Build and push KURE retriever Lambda image" job이 둘 다 실패했습니다. 그 결과utterai-kure-retrieverECR 리포지토리는 여전히 비어있고, Lambda/Gateway가 실제로 가리킬 이미지가 없는 상태입니다 (Terraform은 머지됐지만terraform apply를 해도 이미지가 없어 실패합니다).원인 2가지
numpy>=1.26.0제약이 느슨해서 최신 2.x(락 시점 2.4.6)로 풀리는데, 이 버전은 glibc 2.28+ 요구하는 manylinux wheel만 배포합니다.public.ecr.aws/lambda/python:3.11은 Amazon Linux 2(glibc 2.26)라 wheel을 못 찾고 소스 빌드로 빠지는데, 이 이미지엔 컴파일러가 없어 실패합니다.uv export로 만든 requirements.txt를 순정pip install --target에 넘기면 pip이--require-hashes모드로 들어가는데, torch가 빌드 시점에 끌어오는setuptools가 해시 고정이 안 돼 있어(uv export는 런타임 의존성만 해시 고정) 실패합니다.수정
python:3.11(AL2) →python:3.12(AL2023, glibc 2.34)로 변경pip install --target→uv pip install --target으로 변경검증
docker build --platform linux/amd64 -f lambda/kure_retriever/Dockerfile .로 전체 빌드(모델 다운로드/베이킹 포함) 실제 실행, 성공 확인 (GH Actions 러너와 동일한 amd64로 재현)pytest tests/179 passed (Dockerfile만 변경, 앱 코드 영향 없음)Test plan
ai-ecr-push.yaml)에서 이미지 빌드/push 성공 확인