TL;DR
Managed MLflow와 Amazon SageMaker AI Model Registry의 동기화 기능이 모델 등록 시 Model Package Group과 버전을 자동 생성하고 학습 지표, 평가 결과, 추론 사양, 계보까지 함께 전달합니다. 데이터 과학자는 MLflow에서 모델을 기록하고 등록한 뒤 alias로 staging을 요청하며, governance officer는 SageMaker Studio에서 지표와 계보를 확인하고 production 승인을 수행합니다. IAM 조건 키는 역할별 수명 주기 전환을 제한하고, 승인 이후 리소스 태그는 모델 그룹을 동결해 후속 변경을 막습니다. 이 글은 단일 AWS 계정 구성을 다루며, 다음 편에서는 AWS RAM을 활용한 계정 간 거버넌스로 확장합니다.
섹션별 상세
# Activate Model Registry sync when creating an MLflow app
aws sagemaker create-mlflow-app \
--name my-mlflow-app \
--artifact-store-uri s3:///mlflow \
--role-arn arn:aws:iam:::role/my-mlflow-app-role \
--model-registration-mode AutoModelRegistrationEnabled \
--region새 Managed MLflow 앱을 만들면서 Model Registry sync를 활성화하고 서비스 역할과 등록 모드를 지정합니다.
# Updating an existing MLflow app with Model Registry sync
aws sagemaker update-mlflow-app \
--arn \
--model-registration-mode AutoModelRegistrationEnabled \
--region이미 만든 MLflow 앱의 모델 등록 모드를 자동 동기화로 변경합니다.
import mlflow, sagemaker_mlflow
# Log the trained model during the run.
model_info = mlflow.sklearn.log_model(model, name="sklearn-model")
# Optionally log evaluation metrics
sagemaker_mlflow.evaluate(model_info, data=dataset, model_type="regressor")
# Optionally log an inference specification:
# enables direct deployment from the registry
sagemaker_mlflow.log_inference_specification(
model_info.model_id,
inference_specification=inference_spec
)
# Register the logged model:
# creates the Model Package Group and version automatically
mv = mlflow.register_model(f"models:/{model_info.model_id}", "my-model")학습 모델을 MLflow에 기록하고 평가 지표와 추론 사양을 선택적으로 첨부한 뒤 모델을 등록합니다.
client = mlflow.MlflowClient()
# Move a candidate to staging
client.set_registered_model_alias(
"my-model", "sagemakerlifecycle-staging-pending", version)등록된 모델 버전에 MLflow alias를 부여해 SageMaker AI Model Registry의 staging 대기 상태로 이동시킵니다.
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "DenyProductionPromotion",
"Effect": "Deny",
"Action": "sagemaker:UpdateModelPackage",
"Resource": "*",
"Condition": {
"StringEquals": {"sagemaker:ModelLifeCycle/stage": "production"}
}
}]
}데이터 과학자 역할이 모델을 production 단계로 직접 승격하지 못하도록 IAM 조건 키를 사용해 거부 정책을 설정합니다.







용어 해설
- 모델 레지스트리(Model Registry)
- — Model Registry는 학습과 평가를 마친 모델 버전의 메타데이터, 배포 정보, 승인 상태를 한곳에서 관리하는 저장소입니다. 모델 패키지와 버전을 등록하고 수명 주기 단계를 통제해 어떤 모델이 운영 환경으로 이동할 수 있는지 추적합니다. 이 글에서는 Amazon SageMaker AI Model Registry가 MLflow에서 전달된 모델을 검토·승인·감사하는 기준 저장소 역할을 맡습니다.
- 모델 계보(Model Lineage)
- — Model Lineage는 모델이 어떤 MLflow 실험과 학습 실행에서 만들어졌고 어떤 데이터셋, 컨테이너 이미지, 모델 그룹과 연결되는지 기록하는 관계 정보입니다. 등록된 모델의 출처와 변경 경로를 이어 주므로 거버넌스 담당자가 모델을 검토하고 감사할 때 수작업으로 맥락을 모을 필요가 줄어듭니다. 글에서는 MLflow 실험·모델 버전·컨테이너 이미지·Model Package Group 사이의 연결이 SageMaker AI Model Registry로 전달됩니다.
- IAM 조건 키(IAM condition key)
- — IAM condition key는 정책이 적용되는 요청의 속성을 검사해 특정 작업을 허용하거나 거부하는 접근 제어 조건입니다. 이 글에서는 sagemaker:ModelLifeCycle/stage와 sagemaker:ModelLifeCycle/stageStatus를 사용해 역할별 모델 수명 주기 전환을 제한합니다. 데이터 과학자는 staging까지만 이동할 수 있고 governance officer만 production 승인을 수행하도록 권한 경계를 만듭니다.
- 모델 패키지 그룹(Model Package Group)
- — Model Package Group은 동일한 모델 계열의 여러 Model Package version을 묶어 관리하는 SageMaker AI Model Registry 구조입니다. MLflow에서 모델을 등록하면 동기화 기능이 해당 그룹과 버전을 자동으로 생성하고, 각 버전에 학습 지표·평가 결과·추론 사양·계보를 연결합니다. 승인 후 그룹에 리소스 태그를 적용하면 추가 변경을 차단하는 동결 정책도 결합할 수 있습니다.
기술
- MLflow
- Managed MLflow
- Amazon SageMaker AI Model Registry
- SageMaker Studio
- sagemaker-mlflow
- AWS Identity and Access Management
- Amazon S3
- Amazon EventBridge
- AWS Resource Access Manager
- Jupyter notebook
- CI/CD
활용 사례
- MLflow에서 실험한 모델의 자동 등록
- 학습·평가 지표와 계보를 포함한 모델 검토
- IAM 역할별 staging·production 승격 통제
- 승인 모델의 변경 동결과 감사 추적
- SageMaker AI endpoint로의 승인 모델 배포
언급된 리소스
AI 요약 · 북마크 · 개인 피드 설정 — 무료
출처 · 인용 안내
인용 시 "요약 출처: AI Trends (aitrends.kr)"를 표기하고, 사실 확인은 원문 보기 기준으로 진행해 주세요. 자세한 기준은 운영 정책을 참고해 주세요.