

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 创建和运行 Feature Store 特征处理器管道
<a name="feature-store-feature-processor-create-execute-pipeline"></a>

功能处理器 SDK 可 APIs 将您的特征处理器定义提升为完全托管的 SageMaker AI 管道。有关 Pipelines 的更多信息，请参阅 [管道概述](pipelines-overview.md)。要将您的功能处理器定义转换为 SageMaker AI Pipeline，请将 `to_pipeline` API 与您的特征处理器定义一起使用。您可以计划功能处理器定义的执行，通过 CloudWatch 指标对其进行操作监控，并将其与之集成 EventBridge 以充当事件源或订阅者。有关监控使用 Pipelines 创建的管道的更多信息，请参阅 [监控 Amazon SageMaker 功能商店功能处理器管道](feature-store-feature-processor-monitor-pipeline.md)。

要查看特征处理器管道，请参阅[从管理控制台查看管道执行情况](feature-store-use-with-studio.md#feature-store-view-feature-processor-pipeline-executions-studio)。

如果您的函数也用 `@remote` 装饰器进行修饰，则它的配置将会传输到特征处理器管道。可以使用 `@remote` 装饰器指定高级配置，例如计算实例类型和数量、运行时依赖项、网络和安全配置。

以下示例使用`to_pipeline`和`execute` APIs。

```
from sagemaker.feature_store.feature_processor import (
    execute, to_pipeline, describe, TransformationCode
)

pipeline_name="feature-processor-pipeline"
pipeline_arn = to_pipeline(
    pipeline_name=pipeline_name,
    step=transform,
    transformation_code=TransformationCode(s3_uri="s3://bucket/prefix"),
)

pipeline_execution_arn = execute(
    pipeline_name=pipeline_name
)
```

从语义上讲，`to_pipeline` API 是一项更新插入操作。如果管道已经存在，它会对其进行更新；否则，它会创建一个管道。

`to_pipeline`API 可以选择接受引用包含功能处理器定义的文件的 Amazon S3 URI，将其与功能处理器管道相关联，以跟踪转换函数及其在其 SageMaker AI 机器学习谱系中的版本。

要检索账户中包含每个特征处理器管道的列表，可以使用 `list_pipelines` API。随后向 `describe` API 返回与特征处理器管道相关的详细信息，包括但不限于管道和计划详细信息。

以下示例使用`list_pipelines`和`describe` APIs。

```
from sagemaker.feature_store.feature_processor import list_pipelines, describe

feature_processor_pipelines = list_pipelines()

pipeline_description = describe(
    pipeline_name = feature_processor_pipelines[0]
)
```