콘텐츠로 이동

3-8. 모델 배포 흐름 확인

3-8 Demo의 판단 질문은 모델이 어디에서 와서 어디까지 배포 확인됐는가입니다. 수강생은 MLflow, Git, Argo CD, KServe, endpoint 응답을 한 줄로 연결해 봅니다.

이 Demo는 “명령이 성공했다”를 확인하는 시간이 아닙니다. 어떤 모델을 배포하려 했는지, 어떤 파일이 배포 기준인지, 실제 클러스터에 반영됐는지, endpoint가 응답하는지 나누어 확인합니다.

단계 확인할 것 의미
MLflow models:/risk-classifier@candidate 어떤 모델을 배포하는가
Git Argo CD Application, KServe InferenceService 어떤 파일이 배포 기준인가
Argo CD diff, sync, health Git의 배포 파일이 반영됐는가
KServe Ready, URL, predictor 상태 모델 endpoint가 준비됐는가
응답 request_id, score, prediction 실제 요청 결과를 추적할 수 있는가

3-8-1. 배포 파일 확인

배포 파일 확인은 클러스터가 없어도 실행 가능한 첫 단계입니다. 이 스크립트는 tta-aiqa에 있는 Argo CD Application 파일, Kustomize overlay, KServe InferenceService, observability ConfigMap을 확인합니다. 파일이 아직 tta-aiqa에 없다면 이 단계는 실행 결과가 아니라 실습 자산 보강 필요 상태입니다.

cd ../tta-aiqa
demos/ch03_docker_kubernetes/scripts/setup_argocd_gitops.sh check
실행 환경 예상 결과 보고서 표현
manifest 파일 없음 실행하지 않음 tta-aiqa에 GitOps/KServe 자산 추가 필요
kubectl, kustomize 모두 없음 파일 inspection 완료 배포 파일 구조만 확인
kubectl만 있음 Argo CD Application client dry-run 확인 Application manifest shape 확인
kustomize 있음 dev overlay render 확인 KServe manifest render 확인
전체 클러스터 있음 다음 단계에서 Application 등록과 sync 가능 실제 배포 확인으로 진행

이 단계의 실패는 대부분 경로 문제나 도구 미설치입니다. 파일이 없거나 경로가 틀리면 course artifact 문제이고, 도구가 없으면 live 검증 blocker입니다.

3-8-2. Argo CD sync 확인

Argo CD sync는 Git의 배포 파일을 클러스터에 반영하는 단계입니다. 이 단계는 실제 클러스터와 Argo CD 로그인, repository credential, KServe 설치, model storage가 필요합니다.

cd ../tta-aiqa
demos/ch03_docker_kubernetes/scripts/setup_argocd_gitops.sh connect
demos/ch03_docker_kubernetes/scripts/setup_argocd_gitops.sh sync

확인할 출력은 명령 성공 여부만이 아닙니다. argocd app diff에서 어떤 차이가 있었는지, argocd app sync가 어떤 resource를 적용했는지, argocd app wait가 sync와 health 조건을 만족했는지 봅니다.

Argo CD 확인값 의미 아직 부족한 확인
Application 등록 Argo CD가 Git source와 destination을 알게 됨 repo credential과 sync 성공 여부
diff 확인 변경 범위를 확인함 차이가 의도한 변경인지 검토
sync 성공 Git 파일이 cluster에 반영됨 KServe Ready와 endpoint response
health 확인 Argo CD가 resource health를 정상으로 봄 모델 응답 field와 운영 로그

Argo CD가 sync에 성공해도 모델 응답이 정상이라는 뜻은 아닙니다. sync는 배포 반영 확인이고, endpoint response와 로그는 실행 확인입니다.

3-8-3. KServe endpoint 상태 확인

KServe 상태 확인은 serving resource가 실제 endpoint로 준비됐는지 보는 단계입니다.

cd ../tta-aiqa
demos/ch03_docker_kubernetes/scripts/check_kserve_endpoint.sh

KServe status에서 봐야 할 것은 Ready 상태와 predictor 관련 event입니다. model storage가 없거나 runtime image pull이 실패하면 Argo CD sync는 됐더라도 endpoint는 준비되지 않습니다.

상태 판단 next action
Ready=True KServe resource가 트래픽 받을 준비 상태로 보임 /predict와 로그 확인
storage 오류 모델 artifact 접근 불가 model store owner가 storageUri와 권한 확인
runtime 오류 serving runtime 또는 image 문제 platform owner가 runtime과 image pull 확인
ingress 오류 endpoint 접근 경로 문제 platform/network owner가 ingress 확인

실패는 실습 실패가 아니라 확인 결과입니다. 어떤 단계에서 막혔는지와 다음 확인 담당자를 남기면 됩니다.

3-8-4. 4장으로 넘길 확인 결과

3장의 최종 산출물은 배포 성공 선언이 아니라 4장으로 넘기는 확인 결과입니다. 확인된 것과 미확인인 것을 나란히 둡니다.

확인 항목 값 예시 상태
model_uri models:/risk-classifier@candidate inspection 확인
gitops_path demos/ch03_docker_kubernetes/gitops/overlays/dev inspection 확인 또는 자산 추가 필요
argocd_app ai-quality-risk-classifier live 또는 inspection
kserve_resource InferenceService/ai-quality-risk-classifier-dev live 또는 inspection
response_fields request_id, model_version, score, threshold, prediction, latency_ms, validation_failure 4장에서 확인 필요

보고서 문장은 다음처럼 마무리합니다.

`models:/risk-classifier@candidate` 모델은 GitOps 경로 `demos/ch03_docker_kubernetes/gitops/overlays/dev`에 KServe 배포 파일로 선언되어 있습니다.
이번 실행에서 Argo CD sync와 KServe Ready는 [확인/미확인] 상태이며, endpoint 응답과 로그 필드는 4장에서 확인합니다.