使用交互式端点的自定义内核映像 - Amazon EMR
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

使用交互式端点的自定义内核映像

您可以为交互式端点自定义 Docker 映像并运行自定义的基本内核映像,以便确保在从 Amazon EMR Studio 运行交互式工作负载时应用程序拥有正确的依赖项。要创建交互式端点并将其连接到自定义 Docker 映像,请执行以下步骤。

注意

您只能覆盖基本映像。您无法添加新的内核映像类型。

  1. 创建并发布自定义 Docker 映像。基本镜像包含 Spark 运行时,以及随之运行的 Notebook 内核。要创建映像,您可以按照 如何自定义 Docker 镜像 中的步骤 1 到 4 操作。在步骤 1 中,Docker 文件中的基本映像 URI 必须使用 notebook-spark 来代替 spark

    ECR-registry-account.dkr.ecr.Region.amazonaws.com/notebook-spark/container-image-tag

    有关如何选择 Amazon Web Services 区域 和容器镜像标签的更多信息,请参阅如何选择基础映像 URI 的详细信息

  2. 创建可与自定义映像配合使用的交互式端点。

    1. 使用以下内容创建 JSON 文件 custom-image-managed-endpoint.json。此示例使用了 Amazon EMR 发行版 6.9.0。

      { "name": "endpoint-name", "virtualClusterId": "virtual-cluster-id", "type": "JUPYTER_ENTERPRISE_GATEWAY", "releaseLabel": "emr-6.9.0-latest", "executionRoleArn": "execution-role-arn", "configurationOverrides": { "applicationConfiguration": [ { "classification": "jupyter-kernel-overrides", "configurations": [ { "classification": "python3", "properties": { "container-image": "123456789012.dkr.ecr.us-west-2.amazonaws.com/custom-notebook-python:latest" } }, { "classification": "spark-python-kubernetes", "properties": { "container-image": "123456789012.dkr.ecr.us-west-2.amazonaws.com/custom-notebook-spark:latest" } } ] } ] } }
    2. 按如下示例所示,使用该 JSON 文件中指定的配置来创建交互式端点。有关更多信息,请参阅 使用 create-managed-endpoint 命令创建交互式端点

      aws emr-containers create-managed-endpoint --cli-input-json custom-image-managed-endpoint.json
  3. 通过 EMR Studio 连接到交互式端点。有关更多信息和要完成的步骤,请参阅 Worksho Amazon p Studio 文档中 EKS 上的 Amazon EMR 部分中的 “从 Studio 连接”。