An Amazon SageMaker notebook instance is a fully managed machine learning (ML) Amazon Elastic Compute Cloud (Amazon EC2) compute instance that runs the Jupyter Notebook App. You use the notebook instance to create and manage Jupyter notebooks for preprocessing data and to train and deploy machine learning models.
To create a SageMaker notebook instance
-
Open the Amazon SageMaker console at https://console.aws.amazon.com/sagemaker/.
-
Choose Notebook instances, and then choose Create notebook instance.
-
On the Create notebook instance page, provide the following information (if a field is not mentioned, leave the default values):
-
For Notebook instance name, type a name for your notebook instance.
-
For Notebook Instance type, choose
ml.t2.medium
. This is the least expensive instance type that notebook instances support, and it suffices for this exercise. If aml.t2.medium
instance type isn't available in your current AWS Region, chooseml.t3.medium
. -
For Platform Identifier, choose a platform type to create the notebook instance on. This platform type dictates the Operating System and the JupyterLab version that your notebook instance is created with. For information about platform identifier type, see Amazon Linux 2 vs Amazon Linux notebook instances. For information about JupyterLab versions, see JupyterLab versioning.
-
For IAM role, choose Create a new role, and then choose Create role. This IAM role automatically gets permissions to access any S3 bucket that has
sagemaker
in the name. It gets these permissions through theAmazonSageMakerFullAccess
policy, which SageMaker attaches to the role. Note
If you want to grant the IAM role permission to access S3 buckets withoutsagemaker
in the name, you need to attach theS3FullAccess
policy or limit the permissions to specific S3 buckets to the IAM role. For more information and examples of adding bucket policies to the IAM role, see Bucket Policy Examples. -
Choose Create notebook instance.
In a few minutes, SageMaker launches an ML compute instance—in this case, a notebook instance—and attaches a 5 GB of Amazon EBS storage volume to it. The notebook instance has a preconfigured Jupyter notebook server, SageMaker and AWS SDK libraries, and a set of Anaconda libraries.
For more information about creating a SageMaker notebook instance, see Create a Notebook Instance.
-
If you want to change the ML compute instance type or the size of the Amazon EBS storage of a SageMaker notebook instance that's already created, you can edit the notebook instance settings.
To change and update the SageMaker Notebook instance type and the EBS volume
-
On the Notebook instances page in the SageMaker console, choose your notebook instance.
-
Choose Actions, choose Stop, and then wait until the notebook instance fully stops.
-
After the notebook instance status changes to Stopped, choose Actions, and then choose Update settings.
-
For Notebook instance type, choose a different ML instance type.
-
For Volume size in GB, type a different integer to specify a new EBS volume size. Note
EBS storage volumes are encrypted, so SageMaker can't determine the amount of available free space on the volume. Because of this, you can increase the volume size when you update a notebook instance, but you can't decrease the volume size. If you want to decrease the size of the ML storage volume in use, create a new notebook instance with the desired size.
-
-
At the bottom of the page, choose Update notebook instance.
-
When the update is complete, Start the notebook instance with the new settings.
For more information about updating SageMaker notebook instance settings, see Update a Notebook Instance.
The following tutorial video shows how to set up and use SageMaker notebook instances through the SageMaker console with advanced options, such as SageMaker lifecycle configuration and importing GitHub repositories. (Length: 26:04)
For complete documentation about SageMaker notebook instance, see Use Amazon SageMaker notebook Instances.