本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
在 Studio 中建立和連接生命週期組態
下一節提供 AWS CLI 命令來建立生命週期組態、在建立新使用者設定檔時連接生命週期組態,以及在更新使用者設定檔時連接生命週期組態。如需在 Studio 中建立和連接生命週期組態的先決條件和一般步驟,請參閱生命週期組態建立。
使用 create-studio-lifecycle-config 命令建立 Studio 生命週期組態時,請務必將 studio-lifecycle-config-app-type 指定為 。以下範例顯示如何為您的程式碼編輯器應用程式建立新的 Studio 生命週期組態。CodeEditor
aws sagemaker create-studio-lifecycle-config \ --studio-lifecycle-config-namemy-code-editor-lcc\ --studio-lifecycle-config-content $LCC_CONTENT \ --studio-lifecycle-config-app-typeCodeEditor
記下傳回之新建立之生命週期組態的 ARN。連接生命週期組態時,請在 CodeEditorAppSettings 的 LifecycleConfigArns 清單內提供此 ARN。
您可以在建立使用者設定檔或網域時連接生命週期組態。以下範例示範如何建立連接生命週期組態的新使用者描述檔。您也可以使用 create-domain
# Create a new UserProfile aws sagemaker create-user-profile \ --domain-iddomain-id\ --user-profile-nameuser-profile-name\ --user-settings '{ "CodeEditorAppSettings": { "LifecycleConfigArns": [lifecycle-configuration-arn-list] } }'
或者,您也可以在更新使用者設定檔或網域時連接生命週期組態。以下範例展示如何更新已連接生命週期組態的使用者設定檔。您也可以使用 update-domain
# Update a UserProfile aws sagemaker update-user-profile \ --domain-iddomain-id\ --user-profile-nameuser-profile-name\ --user-settings '{ "CodeEditorAppSettings": { "LifecycleConfigArns": [lifecycle-configuration-arn-list] } }'