Manage your machine’s resources using 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.
- Sign in to AWS.
- Select your name in the top right of the screen and select Switch roles.
- Under Account, you can select govuk-infrastructure-integration or 210287912431.
- Under Role, select govuk-datascienceusers.
- You can enter any text into Display name or leave this field empty.
- You can select any colour in Colour. Best practice is to select green for integration, amber for staging and red for production.
- Select Switch Role.
- Enter “Sagemaker” into the search field and select Amazon Sagemaker.
- 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
- Select Create notebook instance on the Notebook instances page.
- 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
- Select the Additional configuration menu to see more options.
- 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.
- In the Permissions and encryption section, set the IAM role to govuk-integration-data-science-role.
- 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
- Go to the Notebook instances page. You will see a table of existing AWS Sagemaker instances.
- In the Actions column of the instance you want to open, select Start. AWS will then find the resources for your instance.
- 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.
- Go to the Notebook instances page. You will see a table of existing AWS Sagemaker instances.
- 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.
- 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
- Double-click on the Name of your instance you’d like to edit. You now should see the settings for this instance.
- Select Edit for the Notebook instance settings and change any of the available options.
- Once you’ve edited your instance, select Update notebook instance.
You have edited your instance.