Set up idle shutdown
The following sections show how to set up idle shutdown from either the console or using the AWS CLI. Idle shutdown can be set at either the domain or user profile level.
Prerequisites
To use idle shutdown with your application, you must complete the following prerequisites.
-
Ensure that your application is using the SageMaker Distribution (SMD) version 2.0. You can select this version during application creation or update the image version of the application after creation. For more information, see Update the SageMaker AI Distribution Image .
-
For applications built with custom images, idle shutdown is supported if your custom image is created with SageMaker Distribution (SMD) version 2.0 or later as the base image. If the custom image is created with a different base image, then you must install the jupyter-activity-monitor-extension >= 0.3.1
extension on the image and attach the image to your Amazon SageMaker AI domain for JupyterLab applications. For more information about custom images for JupyterLab applications, see Provide users with access to custom images. For more information about custom images for Code Editor applications, see Environment customization using custom images.
From the Console
The following sections show how to enable idle shutdown from the console.
Add when creating a new domain
-
Create a domain by following the steps in Use custom setup for Amazon SageMaker AI
-
When configuring the application settings in the domain, navigate to either the Code Editor or JupyterLab section.
-
Select Enable idle shutdown.
-
Enter a default idle shutdown time in minutes. This values defaults to
10,080
if no value is entered. -
(Optional) Select Allow users to set custom idle shutdown time to allow users to modify the idle shutdown time.
-
Enter a maximum value that users can set the default idle shutdown time to. You must enter a maximum value. The minimum value is set by Amazon SageMaker AI and must be
60
.
-
Add to an existing domain
Note
If idle shutdown is set when applications are running, they must be restarted for idle shutdown settings to take effect.
-
Navigate to the domain.
-
Choose the App Configurations tab.
-
From the App Configurations tab, navigate to either the Code Editor or JupyterLab section.
-
Select Edit.
-
Select Enable idle shutdown.
-
Enter a default idle shutdown time in minutes. This values defaults to
10,080
if no value is entered. -
(Optional) Select Allow users to set custom idle shutdown time to allow users to modify the idle shutdown time.
-
Enter a maximum value that users can set the default idle shutdown time to. You must enter a maximum value. The minimum value is set by Amazon SageMaker AI and must be
60
.
-
-
Select Submit.
Add when creating a new user profile
-
Add a user profile by following the steps at Add user profiles
-
When configuring the application settings for the user profile, navigate to either the Code Editor or JupyterLab section.
-
Select Enable idle shutdown.
-
Enter a default idle shutdown time in minutes. This values defaults to
10,080
if no value is entered. -
(Optional) Select Allow users to set custom idle shutdown time to allow users to modify the idle shutdown time.
-
Enter a maximum value that users can set the default idle shutdown time to. You must enter a maximum value. The minimum value is set by Amazon SageMaker AI and must be
60
.
-
-
Select “Save Changes”.
Add to an existing user profile
Note: If idle shutdown is set when applications are running, they must be restarted for idle shutdown settings to take effect.
-
Navigate to the user profile.
-
Choose the App Configurations tab.
-
From the App Configurations tab, navigate to either the Code Editor or JupyterLab section.
-
Select Edit.
-
Idle shutdown settings will show domain settings by default if configured for the domain.
-
Select Enable idle shutdown.
-
Enter a default idle shutdown time in minutes. This values defaults to
10,080
if no value is entered. -
(Optional) Select Allow users to set custom idle shutdown time to allow users to modify the idle shutdown time.
-
Enter a maximum value that users can set the default idle shutdown time to. You must enter a maximum value. The minimum value is set by Amazon SageMaker AI and must be
60
.
-
-
Select Save Changes.
From the AWS CLI
The following sections show how to enable idle shutdown using the AWS CLI.
Domain
The following command shows how to enable idle shutdown when updating an existing domain. To add
idle shutdown for a new domain, use the create-domain
command instead.
Note
If idle shutdown is set when applications are running, they must be restarted for idle shutdown settings to take effect.
aws sagemaker update-domain --region
region
--domain-iddomain-id
\ --default-user-settings file://default-user-settings.json ## default-user-settings.json example { "JupyterLabAppSettings": { "AppLifecycleManagement": { "IdleSettings": { "LifecycleManagement": "Enabled", "IdleTimeoutMinutes": 60, "MaxIdleTimeoutInMinutes":maximum user customizable value
, "MinIdleTimeoutInMinutes":minimum user customizable value
} } }
User profile
The following command shows how to enable idle shutdown when updating an existing user profile. To
add idle shutdown for a new user profile, use the create-user-profile
command
instead.
Note
If idle shutdown is set when applications are running, they must be restarted for idle shutdown settings to take effect.
aws sagemaker update-user-profile --region
region
--domain-iddomain-id
\ --user-profile-nameuser-profile-name
--user-settings file://user-settings.json ## user-settings.json example { "JupyterLabAppSettings": { "AppLifecycleManagement": { "IdleSettings": { "LifecycleManagement": "Enabled", "IdleTimeoutMinutes": 60, "MaxIdleTimeoutInMinutes":maximum user customizable value
, "MinIdleTimeoutInMinutes":minimum user customizable value
} } }