Skip to main content
Last updated: 29 Jul 2021

Manage your machine's resources with AWS Sagemaker

You may find that you reach your local machine’s resource limit when running intensive tasks and/or when using large datasets, or that computations are taking a long time. You should use AWS Sagemaker to manage these resource issues.

The following documentation applies to on-demand notebook instances.

AWS Sagemaker lets you create instances with different numbers of virtual CPUs and memory at a cost. See the documentation on AWS Sagemaker pricing for more information.

Access AWS Sagemaker

Before you start, you must have set up your AWS account.

  1. Sign in to AWS.
  2. Select your name in the top right of the screen and select Switch roles.
  3. Under Account, you can select select govuk-infrastructure-integration or 210287912431.
  4. Under Role, select govuk-datascienceusers.
  5. You can enter any text into Display name or leave this field empty.
  6. You can select any colour in Colour. Best practice is to select green for integration, amber for staging and red for production.
  7. Select Switch Role.
  8. Enter “Sagemaker” into the search field and select Amazon Sagemaker.
  9. In the left hand navigation, select Notebook and then Notebook instances.

You have now accessed AWS Sagemaker. You can:

  • create a new instance
  • open or close an existing instance
  • edit an existing instance

Create a new instance

  1. Select Create notebook instance on the Notebook instances page.
  2. In the Notebook instance setting section:
    • enter a valid Notebook instance name
    • choose an appropriate instance type depending on the amount of resources you require
  3. Select the Additional configuration menu to see more options.
  4. The Volume size in GB field defines the amount of storage available on your Sagemaker instance. Set this to a reasonable amount for storing data on your instance locally to the notebook. If you change this amount in future, you may lose any existing code and data on your instance.
  5. In the Permissions and encryption section, set the IAM role to govuk-integration-data-science-role.
  6. Select Create notebook instance.

You are now ready to use your newly created instance.

For more information on creating a new instance, see the AWS documentation on creating an Amazon SageMaker Notebook Instance.

Open an existing instance

  1. Go to the Notebook instances page. You will see a table of existing AWS Sagemaker instances.
  2. In the Actions column of the instance you want to open, select Start. AWS will then find the resources for your instance.
  3. When the Status of your instance shows InService, select the Open Jupyter or Open JupyterLab as needed to open the Jupyter or JupyterLab instance.

You have opened your instance.

Close an existing instance

When you have finished with an instance, you should close that instance to minimise costs.

  1. Go to the Notebook instances page. You will see a table of existing AWS Sagemaker instances.
  2. Select the radio button next to the name of the instance you want to close. To the right of the Notebook instances title, the Actions drop-down menu should become accessible.
  3. In this drop-down menu, select Stop, and wait for the instance status to change to Stopped.

You have closed your instance.

Edit an existing AWS Sagemaker instance

  1. Double-click on the Name of your instance you’d like to edit. You now should see the settings for this instance.
  2. Select Edit for the Notebook instance settings and change any of the available options.
  3. Once you’ve edited your instance, select Update notebook instance.

You have edited your instance.