更新 A SageMaker I 分发映像 - 亚马逊 SageMaker AI
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

更新 A SageMaker I 分发映像

重要

本主题假设您已经创建了空间,并赋予了用户访问该空间的权限。有关更多信息,请参阅 让用户访问空间

更新您已经创建的 JupyterLab 空间,以使用最新版本的 SageMaker 分发映像来访问最新功能。您可以使用 Studio 用户界面或 Amazon Command Line Interface (Amazon CLI) 来更新图像。

以下章节提供了有关更新映像的信息。

更新图像涉及重新启动用户 JupyterLab 空间。使用以下步骤使用最新图像更新用户 JupyterLab 空间。

更新映像(用户界面)
  1. 打开 Studio。有关打开 Studio 的信息,请参阅 启动亚马逊 SageMaker Studio

  2. 选择 JupyterLab

  3. 选择您的用户 JupyterLab 空间。

  4. 选择停止空间

  5. 在 “图像” 中,选择 A SageMaker I 分发映像的更新版本。要获取最新映像,请选择 最新

  6. 选择运行空间

本节假设您已安装了 Amazon Command Line Interface (Amazon CLI)。有关安装的信息 Amazon CLI,请参阅安装或更新到最新版本的 Amazon CLI

要更新映像,您必须为用户空间执行以下操作:

  1. 删除 JupyterLab 应用程序

  2. 更新空间

  3. 创建应用程序

重要

在开始更新映像之前,您必须准备好以下信息:

  • 域 ID — 您的用户的 Amazon A SageMaker I 域名的 ID。

  • 应用程序类型 — JupyterLab.

  • 应用程序名称:默认。

  • 空间名称:为空间指定的名称。

  • 实例类型-您用于运行应用程序的 Amazon EC2 实例类型。例如,ml.t3.medium

  • SageMaker AI Image ARN — A SageMaker I 分发映像的 Amazon 资源名称 (ARN)。您可以通过将sagemaker-distribution-cpusagemaker-distribution-gpu指定为资源标识符来提供最新版本的 SageMaker AI 分布映像。

要删除 JupyterLab 应用程序,请运行以下命令:

aws sagemaker delete-app \ --domain-id your-user's-domain-id --app-type JupyterLab \ --app-name default \ --space-name name-of-your-user's-space

要更新用户空间,请运行以下命令:

aws sagemaker update-space \ --space-name name-of-your-user's-space \ --domain-id your-user's-domain-id

如果你成功更新了空间,你将在响应ARN中看到空格:

{ "SpaceArn": "arn:aws:sagemaker:Amazon Web Services 区域:111122223333:space/your-user's-domain-id/name-of-your-user's-space" }

要创建应用程序,请运行以下命令:

aws sagemaker create-app \ --domain-id your-user's-domain-id \ --app-type JupyterLab \ --app-name default \ --space-name name-of-your-user's-space \ --resource-spec "InstanceType=instance-type,SageMakerImageArn=arn:aws:sagemaker:Amazon Web Services 区域:555555555555:image/sagemaker-distribution-resource-identifier"