feat: 24/7 무중단 운영을 위한 launchd 서비스 구축

- macOS의 launchd를 이용하여 AI 서버를 시스템 서비스로 등록
- 시스템 재부팅 시 서버 자동 시작 기능 구현
- 예기치 않은 오류 발생 시 서버 자동 재시작 기능 추가
- 서비스 로그를 logs/ 디렉토리에 자동으로 기록하도록 설정
- CODING_CONVENTIONS.md에 서버 운영 및 배포 가이드 상세히 문서화
This commit is contained in:
hyungi
2025-07-25 07:00:50 +09:00
parent 13159b482d
commit 867c7f4bca
4 changed files with 91 additions and 1 deletions

9
logs/service.log Normal file
View File

@@ -0,0 +1,9 @@
번역 시스템 초기화 (디바이스: mps)
모델 로딩 중...
NLLB 번역 모델...
INFO: 192.168.1.122:51436 - "GET /api/dashboard HTTP/1.1" 200 OK
NLLB 모델 로드 완료
KoBART 요약 모델...
KoBART 모델 로드 완료
모델 로딩 완료!
INFO: 192.168.1.122:51443 - "GET /api/dashboard HTTP/1.1" 200 OK

23
logs/service_error.log Normal file
View File

@@ -0,0 +1,23 @@
2025-07-25 06:59:45,307 - __main__ - INFO - 🚀 Mac Mini AI 번역 서버 with 대시보드 (v2.1)
2025-07-25 06:59:45,307 - __main__ - INFO - 📡 서버 주소: http://192.168.1.122:20080
2025-07-25 06:59:45,307 - __main__ - INFO - 📊 대시보드: http://192.168.1.122:20080/dashboard
2025-07-25 06:59:45,307 - __main__ - INFO - 📁 NAS 주소: 192.168.1.227
INFO: Started server process [20661]
INFO: Waiting for application startup.
2025-07-25 06:59:45,328 - __main__ - INFO - 🚀 Mac Mini AI 번역 서버 시작 (v2.1)
2025-07-25 06:59:45,328 - __main__ - INFO - 📍 Mac Mini IP: 192.168.1.122
2025-07-25 06:59:45,328 - __main__ - INFO - 📍 NAS IP: 192.168.1.227
2025-07-25 06:59:45,328 - __main__ - INFO - --------------------------------------------------
2025-07-25 06:59:45,328 - background_ai_service - INFO - 🚀 백그라운드 AI 서비스 시작
2025-07-25 06:59:45,328 - background_ai_service - INFO - ✅ 백그라운드 서비스 준비 완료
2025-07-25 06:59:45,351 - __main__ - INFO - ✅ NAS 연결 정상: /Volumes/Media
2025-07-25 06:59:45,357 - __main__ - INFO - ✅ 폴더 구조 확인/생성 완료
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:20080 (Press CTRL+C to quit)
Loading checkpoint shards: 0%| | 0/3 [00:00<?, ?it/s]
Loading checkpoint shards: 33%|███▎ | 1/3 [00:00<00:01, 1.80it/s]
Loading checkpoint shards: 67%|██████▋ | 2/3 [00:01<00:00, 1.68it/s]
Loading checkpoint shards: 100%|██████████| 3/3 [00:01<00:00, 2.66it/s]
Loading checkpoint shards: 100%|██████████| 3/3 [00:01<00:00, 2.32it/s]
You passed along `num_labels=3` with an incompatible id to label map: {'0': 'NEGATIVE', '1': 'POSITIVE'}. The number of labels will be overwritten to 2.