일괄 처리 엔드포인트는 실제 구현(배포)에서 인터페이스(엔드포인트)를 분리하고 사용자가 엔드포인트의 기본 구현을 제공하는 배포를 결정할 수 있게 해줍니다. 일괄 처리 엔드포인트의 파이프라인 구성 요소 배포를 통해 사용자는 파이프라인 대신 파이프라인 구성 요소를 배포할 수 있으므로 MLOps 실행을 간소화하려는 조직에서 재사용 가능한 자산을 더 효과적으로 활용할 수 있습니다.
일괄 처리 엔드포인트는 파이프라인이 아니라 파이프라인 구성 요소를 배포합니다. 구성 요소는 엔드포인트에서 배포되는 자산의 소스 제어를 위한 보다 안정적인 방법을 제안합니다. 다음과 같이 파이프라인 정의를 파이프라인 구성 요소로 변환할 수 있습니다.
pipeline_component = pipeline().component
가장 좋은 방법은 파이프라인 구성 요소를 등록하여 작업 영역이나 공유 레지스트리 내에서 중앙 집중식으로 버전 관리를 유지할 수 있도록 하는 것입니다.
ml_client.components.create(pipeline_component)
그런 다음 모든 파이프라인 배포를 호스팅하는 엔드포인트를 만들어야 합니다.
endpoint_name = "PipelineEndpointTest"
endpoint = BatchEndpoint(
name=endpoint_name,
description="A hello world endpoint for component deployments",
)
ml_client.batch_endpoints.begin_create_or_update(endpoint)
파이프라인 구성 요소에 대한 배포를 만듭니다.
deployment_name = "hello-batch-dpl"
deployment = BatchPipelineComponentDeployment(
name=deployment_name,
description="A hello world deployment with a single step.",
endpoint_name=endpoint.name,
component=pipeline_component
)
ml_client.batch_deployments.begin_create_or_update(deployment)
하지만 일괄 처리 엔드포인트는 파이프라인이나 모델을 운영하는 배포를 호스팅할 수 있다는 점에 유의해야 합니다. 파이프라인을 호스팅하는 모든 배포 목록을 가져오려면 다음과 같이 하면 됩니다.
all_deployments = []
for endpoint in all_endpoints:
all_deployments.extend(ml_client.batch_deployments.list(endpoint_name=endpoint.name))
all_pipeline_deployments = filter(all_endpoints, lamdba x: x is BatchPipelineComponentDeployment)
REST API 사용
호출 URL의 REST API를 사용하여 엔드포인트에서 작업을 만들 수 있습니다. 호출이 v1에서 v2로 어떻게 변경되었는지 확인하려면 다음 예를 참조하세요.