本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
使用启动代码编辑器应用程序 Amazon CLI
要通过 Amazon Command Line Interface (Amazon CLI) 配置和访问您的代码编辑器集成开发环境,必须创建代码编辑器空间。在执行以下步骤先决条件之前,请务必先满足要求。使用以下步骤创建和运行代码编辑器空间。
创建和运行代码编辑器空间
使用 Amazon Identity and Access Management (IAM) 或 Amazon IAM Identity Center 身份验证访问空间。有关使用访问空间的更多信息 Amazon CLI,请参阅使用 Amazon Command Line Interface中的访问空间亚马逊 SageMaker Studio 空间。
创建应用程序并
app-type
使用以下命令指定CodeEditor
为。如果您在创建代码编辑器应用程序时使用 GPU 实例类型,则还必须使用基于 GPU 的图像。
aws sagemaker create-app \ --domain-id
domain-id
\ --space-namespace-name
\ --app-typeCodeEditor
\ --app-namedefault
\ --resource-spec "SageMakerImageArn=arn:aws:sagemaker:region
:account-id
:image/sagemaker-distribution-cpu
"有关可用代码编辑器镜像 ARN 的更多信息,请参阅代码编辑器应用程序实例和图像。
代码编辑器应用程序投入使用后,使用预签名 URL 启动该应用程序。您可以使用
describe-app
API 来检查您的应用程序是否处于运行状态。使用create-presigned-domain-url
API 创建预签名网址:aws sagemaker create-presigned-domain-url \ --domain-id
domain-id
\ --space-namespace-name
\ --user-profile-nameuser-profile-name
\ --session-expiration-duration-in-seconds43200
\ --landing-uriapp:CodeEditor:
打开生成的 URL 以开始在您的代码编辑器应用程序中工作。