Skip to content

[Chore] 임베딩 서버 torch를 플랫폼별 조건부 고정으로 변경해 NVIDIA 패키지 재유입 방지 - #453

Merged
kangcheolung merged 2 commits into
developfrom
chore/452
Oct 9, 2026
Merged

kangcheolung merged 2 commits into
developfrom
chore/452

Conversation

@kangcheolung

@kangcheolung kangcheolung commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

🔍️ 작업 내용

✨ 상세 설명

1. 문제

  • [Chore] 임베딩 서버 torch를 CPU 전용으로 교체해 NVIDIA 독점 패키지 제거 #451 이후에도 요구사항이 torch==2.4.1이라, CPU 저장소의 2.4.1+cpu뿐 아니라 PyPI의 일반 2.4.1도 조건을 만족합니다. pip는 기본·추가 인덱스에 우선순위를 두지 않습니다.
  • CPU 저장소에 접속하지 못하면 에러 없이 일반 2.4.1이 선택되고 nvidia-* 12개가 다시 설치됩니다. 외부 접속이 제한된 서버·CI에서 빌드하면 라이선스 문제가 조용히 되살아납니다.
  • 재현 (병합된 develop의 requirements.txt, linux/amd64, download.pytorch.org를 127.0.0.1로 돌려 접속 불가를 흉내 냄): pip install --dry-run 종료코드 0, torch 2.4.1, nvidia-* 12개

2. 해결

torch==2.4.1+cpu ; sys_platform == "linux" and platform_machine == "x86_64"
torch==2.4.1 ; sys_platform != "linux" or platform_machine != "x86_64"
  • x86 Linux는 +cpu 라벨이 붙은 휠만 요구하므로 CPU 저장소를 쓸 수 없으면 설치가 실패합니다.
  • torch==2.4.1+cpu 단독 고정은 쓰지 않았습니다. CPU 저장소에 linux/arm64·macOS용 +cpu 휠이 없어 개발 PC(Apple Silicon)의 Docker 빌드가 No matching distribution으로 실패합니다. (재현 확인)
  • 환경 마커에는 not을 쓸 수 없어(pip InvalidMarker) 반대 조건을 or로 풀어 썼습니다.

3. 검증

수정한 실제 requirements.txt로 python:3.11-slim에서 확인했습니다. (접속 불가는 --add-host로 흉내 냄)

환경 CPU 저장소 결과
linux/amd64 정상 2.4.1+cpu, nvidia-* 0개
linux/amd64 접속 불가 설치 실패 (No matching distribution found for torch==2.4.1+cpu)
linux/arm64 정상 2.4.1, nvidia-* 0개
linux/arm64 접속 불가 2.4.1, nvidia-* 0개
항목 결과
amd64 / arm64 이미지 빌드 둘 다 성공 (nvidia-* 0개, torch.version.cuda=None)
amd64 + 접속 불가 상태의 docker build 빌드 실패, 이미지 생성 안 됨
pytest test_main.py amd64 22 passed, arm64 22 passed

4. 검증하지 못한 범위

  • 임베딩 값 비교와 /health/ready는 이번에 다시 하지 않았습니다. x86에 설치되는 torch는 #450에서 검증한 2.4.1+cpu와 같은 휠이고 설치 조건만 바뀌었다는 판단입니다.
  • 접속 불가는 --add-host로 흉내 낸 것이며 실제 방화벽·프록시 환경은 아닙니다.
  • 운영 x86 서버는 접속하지 못했습니다.

🛠️ 추후 리팩토링 및 고도화 계획

  • 이후 의존성 변화까지 잡는 빌드 후 nvidia-* 검사는 이번에 제외했습니다. 필요하면 별도로 검토합니다.
  • 범위 밖: README 라이선스 표와 전이 의존성 구성요소 목록, MinIO 이미지 태그 고정, 모델 버전 기록, architecture.png의 Redis 로고, MinIO·Grafana(AGPL) 멘토링 확인

💬 리뷰 요구사항

  • 머지만으로는 운영 x86 서버의 이미지가 바뀌지 않습니다. 재빌드·재배포 후 nvidia-* 0개, torch 2.4.1+cpu, /health/ready, 임베딩 값 비교를 확인 부탁드립니다. (#451과 같은 항목)
  • 이 변경 이후 x86에서 download.pytorch.org에 접속할 수 없는 환경은 빌드가 실패합니다. 이는 의도한 동작이며, 빌드하는 곳에서 접속이 가능한지 확인 부탁드립니다.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 버그 수정
    • Linux x86_64 환경에서 임베딩 서버가 CPU 전용 PyTorch 2.4.1을 사용하도록 변경했습니다. 그 외 플랫폼에서는 기존 PyTorch 버전을 유지합니다.

kangcheolung and others added 2 commits October 9, 2026 14:59
torch==2.4.1은 PyPI의 일반 휠도 만족해, PyTorch CPU 저장소에 접속하지 못하면
pip가 경고 없이 일반 휠을 선택하고 nvidia-* 12개가 다시 설치된다.
x86 Linux에서만 torch==2.4.1+cpu를 요구해 CPU 저장소 장애 시 설치가 실패하게 하고,
CPU 저장소에 +cpu 휠이 없는 arm64·macOS는 기존 torch==2.4.1을 유지한다.
서버 코드와 API는 변경하지 않는다.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
배경, 결정(x86 Linux만 +cpu 강제), 선택하지 않은 방법, 재현과 4개 환경 검증,
검증하지 못한 범위를 기록한다.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@kangcheolung kangcheolung added the 🔧 Chore 설정 변경 label Oct 9, 2026
@kangcheolung kangcheolung self-assigned this Oct 9, 2026
@kangcheolung
kangcheolung requested a review from Gimini-3 October 9, 2026 05:59
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: DocGrid/docgrid/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d2dc6924-4919-4283-b9c8-a0fda4defda8
📥 Commits

Reviewing files that changed from the base of the PR and between 4726352 and 0e7cd4c.

📒 Files selected for processing (2)
  • backend/embedding-server/requirements.txt
  • docs/design/kangcheolung-#452-embedding-torch-platform-marker.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

임베딩 서버의 PyTorch 의존성을 플랫폼별로 고정했습니다. 설계 문서에 선택 근거, dry-run 검증 결과와 미검증 범위를 기록했습니다. 서버 코드와 API 계약은 변경하지 않았습니다.

Changes

PyTorch 플랫폼별 의존성

Layer / File(s) Summary
플랫폼별 PyTorch 고정
backend/embedding-server/requirements.txt, docs/design/kangcheolung-#452-embedding-torch-platform-marker.md
Linux x86_64에서는 torch==2.4.1+cpu, 그 외 플랫폼에서는 torch==2.4.1을 사용하도록 요구사항을 변경했습니다. 설계 문서는 선택 근거, 플랫폼별 dry-run 결과, 검증 범위와 미검증 항목을 기록합니다.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 0e7cd

Linux x86_64 selects CPU-only PyTorch, while other platforms retain the existing pin. No actionable merge-blocking risk is evident.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check Passed PR 설명은 작업 내용, 상세 설명, 검증 결과, 미검증 범위, 후속 계획, 리뷰 요구사항을 포함합니다. 템플릿의 필수 섹션을 대부분 충족하며 변경 목적과 수용 기준을 명확히 설명합니다.
Title check Passed 제목은 임베딩 서버의 torch를 플랫폼별로 조건부 고정하고 NVIDIA 패키지 재유입을 방지하는 핵심 변경을 명확하게 요약합니다.
Linked Issues check Passed 직접 연결된 #452의 코딩 요구사항을 충족합니다. backend/embedding-server/requirements.txt는 Linux x86_64에 torch==2.4.1+cpu, 그 외 플랫폼에 torch==2.4.1을 적용하고 CPU 인덱스를 유지합니다. 설계 문서는 결정, 재현, 검증, 미검증 범위를 기록합니다. 문서에 따르면 네 가지…
Out of Scope Changes check Passed 변경 사항은 #452의 의존성 고정 및 설계 문서 작성 범위에 있습니다. requirements.txt의 조건부 torch 고정과 관련 주석 변경은 요구사항 구현입니다. docs/design/kangcheolung-#452-embedding-torch-platform-marker.md는 이슈가 요구한 설계 문서입니다. README, Dockerf…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kangcheolung
kangcheolung merged commit f5ef0e3 into develop Oct 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔧 Chore 설정 변경

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Chore] 임베딩 서버 torch를 플랫폼별 조건부 고정으로 바꿔 CPU 저장소 장애 시 NVIDIA 패키지 재유입 방지

1 participant