0) Windows 쪽
- Docker Desktop 실행
- (필요시) Settings → Resources → WSL Integration (Ubuntu-22.04 ON) / GPU Enabled 확인
 - 오른쪽 하단 고래 아이콘이 Running 인지 확인
 
 
WSL(Ubuntu) 터미널 열기
wsl.exe

WSL(Ubuntu) 터미널 열기
wsl.exe
공통 점검
- Docker 연결 Ok??
 
docker version

- GPU OK?!! (CUDA11.6 이미지)
 
docker run --rm --gpus all nvidia/cuda:11.6.2-base-ubuntu20.04 nvidia-smi

- 둘 다 정상 출력이면 다음 단계로 진행
 
1) Repository 최신화 + 작업 Branch 재개
- clone한 dir로 이동
 
cd ~/hybrid-mlops-demo  
git status
git fetch --all
git checkout dev
git pull origin dev

- 방금 작업하던 브랜치로 이동
 
git checkout feature/airflow-hybrid-dag
git pull origin feature/airflow-hybrid-dag
2) MLflow UI 띄우기
cd ~/hybrid-mlops-demo
./mlflow/run_mlflow.sh

→ http://localhost:5000 접속 확인

3) Ray Serve (GPU 자동 감지) 컨테이너 띄우기
- docker compose 실행 테스트
 
cd ~/hybrid-mlops-demo
docker compose build ray-inference
docker compose up -d ray-inference

정상 실행 결과 :
[+] Building 16.3s (9/9) FINISHED
[+] Running 1/1
 ✔ Container ray-inference  Started

- Health Check
 
curl -s <http://127.0.0.1:8000/healthz>

- 추론
 
curl -s -X POST <http://127.0.0.1:8000/inference> \\
  -H 'Content-Type: application/json' \\
  -d '{"input":[10,20,30,40]}'

- Metric
 
curl -s <http://127.0.0.1:8000/metrics> | head
4) Airflow 올리고 DAG 실행
- 최초 세팅 시 한 번만 받았던 docker-compose.yaml이 있다면
 
cd ~/hybrid-mlops-demo/airflow
docker compose up -d
- 컨테이너 상태 확인
- 웹 접속: http://localhost:8080 (airflow / airflow)
 - DAG 이름: hybrid_train_and_infer
 - UI에서 Trigger → 그래프에서 두 태스크 성공 확인
 - MLflow UI(http://localhost:5000)에도 실험 기록(accuracy 등) 찍혔는지
 
 
docker compose ps
DAG 파일 경로 리마인드 :
~/hybrid-mlops-demo/airflow/dags/train_and_call_infer.py
Airflow Container가 위 경로를 Mount하도록 되어 있어야 합니다.
5) PR 생성 → dev로 Merge
5-1. 변경사항 커밋 (필요 시)
git status
# 수정/추가한 게 있으면
git add airflow/dags/train_and_call_infer.py
git commit -m "feat(airflow): add hybrid DAG (onprem train -> cloud inference via Ray)"
git push -u origin feature/airflow-hybrid-dag
5-2. GitHub에서 PR 생성
- base: dev, compare: feature/airflow-hybrid-dag
 - eg. feat(airflow): hybrid DAG (onprem train -> cloud inference via Ray)
 
5-3. Merge 타이밍
- Airflow DAG 수동 Trigger 성공 + MLflow 기록 + Ray 추론 응답 확인 완료 → dev로 Merge
 - main은 배포 때만 Merge
 
https://github.com/daeun-ops/hybrid-mlops-demo
GitHub - daeun-ops/hybrid-mlops-demo
Contribute to daeun-ops/hybrid-mlops-demo development by creating an account on GitHub.
github.com
'DevOps' 카테고리의 다른 글
| [MLOps] MinIO 파일 감지 자동화: Airflow S3 센서로 Ray Serve를 실행하는 완벽 가이드 (0) | 2025.10.31 | 
|---|---|
| [MLOps] Hybrid Demo : GPU Inference → Metrics → Grafana Dashboard 실시간 연결하기 (0) | 2025.10.31 | 
| [MLOps]Ray Serve GPU 자동 감지 + Dockerize + Compose (0) | 2025.10.27 | 
| [MlOps]Observability 맛보기: FastAPI·Ray Log를 Local에서 살펴보기 (0) | 2025.10.26 | 
| [MlOps] Airflow 학습 DAG부터 Ray Serve 추론, Minikube까지 (0) | 2025.10.26 |