Build a custom AMI
The following page explains how to build a custom Amazon Machine Image (AMI) using Amazon SageMaker HyperPod base AMIs. You begin by selecting a base AMI, and then you create your own customized AMI using any of the common methods for creating new images, such as the Amazon CLI.
Select a SageMaker HyperPod base AMI
You can select a SageMaker HyperPod base AMI through one of the following methods.
Amazon console selection
You can select public SageMaker HyperPod AMIs through the Amazon console or by
using the DescribeImages
API call. SageMaker HyperPod AMIs are public
and visible in every Amazon Web Services account. You can find them in the Amazon EC2 AMI
catalog by applying a filter to search for public AMIs owned by Amazon.
To find SageMaker HyperPod AMIs in the console:
-
Sign in to the Amazon EC2 console.
-
In the left navigation pane, choose AMIs.
-
For the Image type dropdown, select Public images.
-
In the search bar filters, set the Owner alias filter to
amazon
. -
Search for AMIs prefixed as HyperPod EKS and select the AMI (preferably latest) that works for your use case. For instance, you can choose an AMI between Kubernetes 1.31 versus Kubernetes 1.30.
Fetch latest public AMI ID through the Amazon CLI
If you want to always use the latest release public AMI, it is more efficient to use the public SageMaker HyperPod SSM parameter that contains the value of the latest AMI ID released by SageMaker HyperPod.
The following example shows how to retrieve the latest AMI ID using the Amazon CLI:
aws ssm get-parameter \ --name "/aws/service/sagemaker-hyperpod/ami/x86_64/eks-1.31-amazon-linux-2/latest/ami-id" \ --region us-west-2 \ --query "Parameter.Value" \ --output text
Note
Replace the parameter name with the corresponding Kubernetes version
as required. For example, if you want to use Kubernetes 1.30, use the
following parameter:
/aws/service/hyperpod/ami/x86_64/eks-1.30-amazon-linux-2/latest/ami-id
.
Build your custom AMI
After you have selected a SageMaker HyperPod public AMI, use that as the base AMI to build your own custom AMI with one of the following methods. Note that this is not an exhaustive list for building AMIs. You can use any method of your choice for building AMIs. SageMaker HyperPod does not have any specific recommendation.
-
Amazon Management Console: You can launch an Amazon EC2 instance using the SageMaker HyperPod AMI, make desired customizations, and then create an AMI from that instance.
-
Amazon CLI: You can also use the
aws ec2 create-image
command to create an AMI from an existing Amazon EC2 instance after performing the customization. -
HashiCorp Packer: Packer is an open-source tool from HashiCorp that enables you to create identical machine images for multiple platforms from a single source configuration. It supports creating AMIs for Amazon, as well as images for other cloud providers and virtualization platforms.
-
Image Builder: EC2 Image Builder is a fully managed Amazon service that makes it easier to automate the creation, maintenance, validation, sharing, and deployment of Linux or Windows Server images. For more information, see the EC2 Image Builder User Guide.