Skip to main content

Installing the required tools

Before getting started with SageMaker HyperPod, we will configure our environment with the required tools.

Install the AWS CLI
note

The AWS CLI comes pre-installed on AWS CloudShell.

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install --update
Configure AWS Credentials

Please refer to this documentation to understand the different ways to acquire AWS Credentials to use AWS CLI.

For simplicity and to demonstrate the process of configuring AWS credentials for the CLI, we are going to use long-term access keys for designated IAM Users.

Important

To maintain a proper security posture we recommend either using short-term credentials or setting up AWS IAM Identity Center (formerly AWS SSO) for short-term credentials.

1. Acquire AWS access long-term credentials

Please visit this documentation to learn how to acquire these credentials from the AWS console.

2. Configure AWS CLI

Using the credentials you fetched above, use aws configure to add the credentials to your terminal. See configure aws credentials for more details.

aws configure
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: us-west-2
Default output format [None]: json

3. Set AWS Region

Next you can set the environment variable for AWS_REGION to ensure it points to the region where you intend to stand up your infrastructure. AWS CLI provides command line arguments as documented here to override certain variables.

export AWS_REGION=us-west-2

For more information on the aws configure cli command please refer to this CLI reference documentation

Install Kubectl (for EKS only)

You will use kubectl throughout the workshop to interact with the EKS cluster Kubernetes API server. The following commands correspond with Linux installations. See the Kubernetes documentation for official steps on how to install kubectl.

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
# If valid, output is kubectl: OK
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

Note: If you do not have root access on the target system, you can still install kubectl to the ~/.local/bin directory:

chmod +x kubectl
mkdir -p ~/.local/bin
mv ./kubectl ~/.local/bin/kubectl
# and then append (or prepend) ~/.local/bin to $PATH

Test to ensure the version you installed is up-to-date:

kubectl version --client
Install Helm (for EKS only)

Helm is a package manager for Kubernetes that will be used to install various dependencies using Charts, which bundle together all the resources needed to deploy an application to a Kubernetes cluster.

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
Install eksctl (for EKS only)

You can use eksctl to create an IAM OIDC provider and install CSI drivers. The following commands correspond with Unix installations. See the eksctl documentation for alternative installation options.

# for ARM systems, set ARCH to: `arm64`, `armv6` or `armv7`
ARCH=amd64
PLATFORM=$(uname -s)_$ARCH
curl -sLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz"
# (Optional) Verify checksum
curl -sL "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_checksums.txt" | grep $PLATFORM | sha256sum --check
tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp && rm eksctl_$PLATFORM.tar.gz
sudo mv /tmp/eksctl /usr/local/bin
Install Terraform

If you plan to use Terraform to deploy the workshop infrastructure, see the Terraform documentation for installation instructions.