From f1b7b0c1d55ea0f53c11006a8a3e9e5ee023589f Mon Sep 17 00:00:00 2001 From: happybell80 Date: Wed, 16 Jul 2025 09:44:24 +0900 Subject: [PATCH] Reorganize troubleshooting directory structure - Moved 20250715_github_migration_to_local.md to docs/troubleshooting/ - Added new file 20250715_rb8001_rb10508_integration.md with integration process documentation --- .../20250715_rb8001_rb10508_integration.md | 138 ++++++++++++++++++ .../20250715_github_migration_to_local.md | 76 ---------- 2 files changed, 138 insertions(+), 76 deletions(-) create mode 100644 docs/troubleshooting/20250715_rb8001_rb10508_integration.md delete mode 100644 troubleshooting/20250715_github_migration_to_local.md diff --git a/docs/troubleshooting/20250715_rb8001_rb10508_integration.md b/docs/troubleshooting/20250715_rb8001_rb10508_integration.md new file mode 100644 index 0000000..c0d3d40 --- /dev/null +++ b/docs/troubleshooting/20250715_rb8001_rb10508_integration.md @@ -0,0 +1,138 @@ +# RB8001과 RB10508_test 통합 프로세스 + +**날짜**: 2025-07-15 +**작업자**: Claude & happybell + +## 개요 + +로빙(RO-BEING) 프로젝트에서 rb8001과 rb10508_test 두 시스템을 통합하여 컨테이너 기반 존재 관리 시스템을 구축하는 과정에서 발생한 문제들과 해결 방법을 기록합니다. + +## 문제 상황 + +### 초기 목표 +- rb8001과 rb10508_test는 같은 목적이지만 코드가 다름 +- rb10508_test의 기능을 rb8001로 통합하여 8001 포트로 운영 +- 컨테이너 기반으로 레벨에 따른 동적 리소스 관리 +- 스탯/스킬/아이템 데이터는 외부 DB로 분리 + +### 발생한 문제들 + +**문제 1: 잘못된 접근 방식** +- Task Master PRD 파싱 결과 "새로운 환경 구축"으로 진행 +- 기존 리소스 확인 없이 새 파일 생성 시도 +- `/home/happybell/projects/ivada/docker-compose.yml` 등 불필요한 파일 생성 + +**문제 2: 기존 인프라 미파악** +- 서버에 이미 PostgreSQL, ChromaDB, Neo4j 설치되어 있음 +- nginx-deploy에 이미 운영 중인 설정 존재 +- 각 프로젝트별로 이미 완성된 Docker 설정 존재 + +## 해결 과정 + +### 1단계: 상황 재평가 + +```bash +# 기존 파일 확인 +find . -name "docker-compose.yml" -o -name ".env*" -o -name "nginx*" + +# 결과: +# - nginx-deploy/server-nginx-default (운영 중) +# - rb8001/docker-compose.yml +# - rb10508_test/docker-compose.yml +# - 각종 .env 파일들 +``` + +**발견사항**: +- nginx-deploy에서 이미 ro-being.com SSL 인증서 설정 완료 +- 현재 라우팅: `/` → 5173(frontend), `/api/` → 8000, `/rb10508/` → 10508 +- rb10508_test는 이미 완벽하게 작동하는 컨테이너와 Gitea Actions 보유 + +### 2단계: 접근 방식 변경 + +**기존 계획 (잘못됨)**: +1. 새로운 Docker Compose 환경 구축 +2. 모든 DB를 컨테이너로 설치 +3. 새로운 프로젝트 구조 생성 + +**수정된 계획 (올바름)**: +1. rb10508_test의 작동하는 코드를 rb8001로 복사 +2. 포트만 8001로 변경 +3. 서버의 기존 DB 활용 (컨테이너 X) +4. 스킬 패키지 분리는 나중에 (작동 확인 후) + +### 3단계: 실제 작업 수행 + +```bash +# 1. requirements.txt 통합 +cp /home/happybell/projects/ivada/rb10508_test/requirements.txt \ + /home/happybell/projects/ivada/rb8001/requirements.txt + +# 2. 확장된 디렉토리 구조 복사 +cp -r rb10508_test/app/skills rb8001/app/ +cp -r rb10508_test/app/stats rb8001/app/ +cp -r rb10508_test/app/utils rb8001/app/ + +# 3. 핵심 서비스 파일 복사 +cp rb10508_test/app/services/robing_brain.py rb8001/app/services/ +cp rb10508_test/app/services/chroma_service.py rb8001/app/services/ +cp rb10508_test/app/services/gemini_service.py rb8001/app/services/ +cp rb10508_test/app/services/slack_service.py rb8001/app/services/ + +# 4. Gitea Actions 설정 복사 +cp -r rb10508_test/.gitea rb8001/ +``` + +### 4단계: Docker Compose 수정 + +rb8001/docker-compose.yml 수정: +- 컨테이너 이름: `robeing-8001` +- 포트 매핑: `8001:8000` +- `network_mode: host` (서버 DB 접근용) +- 환경변수에 `ROBING_ID=8001` 추가 +- PostgreSQL 컨테이너 제거 (서버 DB 사용) + +## 주요 교훈 + +### 1. 기존 리소스 먼저 확인 +- 새로 만들기 전에 반드시 기존 파일과 설정 확인 +- `ls`, `find`, `cat` 명령으로 현재 상태 파악 + +### 2. 단계적 접근의 중요성 +- "작동하는 시스템" 먼저 만들기 +- 그 다음에 리팩토링과 개선 진행 +- 스킬 패키지 분리 같은 큰 변경은 나중에 + +### 3. 서버 환경 이해 +- Docker는 애플리케이션만 (DB는 서버에 직접 설치) +- `network_mode: host`로 서버 리소스 접근 +- 포트 충돌 주의 (8001은 ROBING_ID와 일치) + +## 다음 단계 + +1. **Gitea Actions 포트 변경**: 10508 → 8001 +2. **nginx 설정 추가**: `/rb8001/` 라우팅 추가 +3. **컨테이너 빌드 및 배포 테스트** +4. **정상 작동 확인 후 스킬 패키지 분리 작업** + +## 참고 명령어 + +```bash +# 컨테이너 빌드 및 실행 +cd rb8001 +docker compose up -d --build + +# 헬스체크 +curl http://localhost:8001/health + +# 로그 확인 +docker compose logs -f robeing-8001 + +# Gitea Actions 수동 실행 +# Gitea 웹 UI에서 Actions 탭 → Run workflow +``` + +## 관련 파일 +- `/home/happybell/projects/ivada/rb8001/docker-compose.yml` +- `/home/happybell/projects/ivada/rb8001/.gitea/workflows/cicd.yml` +- `/home/happybell/projects/ivada/nginx-deploy/server-nginx-default` +- Task Master 작업: `.taskmaster/tasks/tasks.json` \ No newline at end of file diff --git a/troubleshooting/20250715_github_migration_to_local.md b/troubleshooting/20250715_github_migration_to_local.md deleted file mode 100644 index 5088700..0000000 --- a/troubleshooting/20250715_github_migration_to_local.md +++ /dev/null @@ -1,76 +0,0 @@ -# GitHub Migration to Local Project - 20250715 - -## 문제 상황 -- admin@robeing-brains:~/github-migration에 있는 프로젝트 폴더들을 happybell80 사용자의 로컬 프로젝트로 이전 -- 각 폴더의 git remote URL에 기존 ivada_Ro-being 사용자의 토큰이 설정되어 있음 -- 일부 저장소는 Gitea에서 다른 이름으로 리다이렉트되거나 존재하지 않음 - -## 해결 과정 - -### 1. 폴더 복사 -```bash -# 각 폴더를 로컬로 복사 -cp -r /home/admin/github-migration/DOCS /home/happybell80/my_project/ -cp -r /home/admin/github-migration/admin_page /home/happybell80/my_project/ -cp -r /home/admin/github-migration/api-base /home/happybell80/my_project/ -cp -r /home/admin/github-migration/frontend-base /home/happybell80/my_project/ -cp -r /home/admin/github-migration/nginx-infra /home/happybell80/my_project/ -cp -r /home/admin/github-migration/test /home/happybell80/my_project/ -cp -r /home/admin/github-migration/test_front /home/happybell80/my_project/ -cp -r /home/admin/github-migration/test_meta-skill /home/happybell80/my_project/ - -# 추가 설정 파일들 복사 -cp /home/admin/BACKUP_TO_NAS_POLICY.md /home/happybell80/my_project/ -cp /home/admin/CLAUDE.md /home/happybell80/my_project/ -cp /home/admin/ROBING_ARCHITECTURE_PHILOSOPHY.md /home/happybell80/my_project/ -``` - -### 2. Git Remote 토큰 업데이트 -각 폴더에서 happybell80 사용자의 개인 액세스 토큰으로 변경: -```bash -# 예시: DOCS 폴더 -cd /home/happybell80/my_project/DOCS -git remote set-url origin https://happybell80:8676690e3b33291abfed9294c8d06044ec48d7a0@git.ro-being.com/ivada_Ro-being/docs.git -``` - -### 3. 저장소 상태 확인 및 정리 - -#### 성공한 저장소들: -- **DOCS**: 정상 pull 완료 -- **frontend-base**: 정상 pull 완료 (업데이트 있음) -- **nginx-infra**: 정상 pull 완료 -- **test_meta-skill**: 정상 pull 완료 - -#### 폴더명 변경 (리다이렉트): -- **api-base → rb8001**: Gitea에서 rb8001로 리다이렉트됨 -- **test → rb10508_test**: Gitea에서 rb10508_test로 리다이렉트됨 - -#### 리모트 제거 (저장소 없음): -- **admin_page**: 저장소가 존재하지 않아 remote 제거 -- **test_front**: 저장소가 존재하지 않아 remote 제거 - -### 4. 최종 명령어 예시 -```bash -# 폴더명 변경 -mv api-base rb8001 -mv test rb10508_test - -# 리모트 제거 -cd admin_page && git remote remove origin -cd test_front && git remote remove origin - -# 업데이트된 URL로 리모트 설정 -cd rb8001 && git remote set-url origin https://happybell80:TOKEN@git.ro-being.com/ivada_Ro-being/rb8001.git -cd rb10508_test && git remote set-url origin https://happybell80:TOKEN@git.ro-being.com/ivada_Ro-being/rb10508_test.git -``` - -## 결과 -- 총 8개 폴더 이전 완료 -- 6개 저장소 정상 연결 (4개 기존명, 2개 새명) -- 2개 저장소 리모트 제거 (존재하지 않음) -- 모든 저장소가 happybell80 사용자 토큰으로 업데이트됨 - -## 교훈 -1. 저장소 이전시 실제 Gitea 저장소명과 로컬 폴더명 일치 확인 필요 -2. 저장소 존재 여부 확인 후 리모트 설정 필요 -3. 개인 액세스 토큰 교체 시 모든 저장소 일괄 업데이트 필요 \ No newline at end of file