Custom images with RStudio on SageMaker AI - Amazon SageMaker AI

Custom images with RStudio on SageMaker AI

A SageMaker AI image is a file that identifies language packages and other dependencies that are required to run RStudio on Amazon SageMaker AI. SageMaker AI uses these images to create an environment where you run RStudio. Amazon SageMaker AI provides a built-in RStudio image for you to use. If you need different functionality, you can bring your own custom images. This page gives information about key concepts for using custom images with RStudio on SageMaker AI. The process to bring your own image to use with RStudio on SageMaker AI takes three steps:

  1. Build a custom image from a Dockerfile and push it to a repository in Amazon Elastic Container Registry (Amazon ECR).

  2. Create a SageMaker AI image that points to a container image in Amazon ECR and attach it to your Amazon SageMaker AI domain.

  3. Launch a new session in RStudio with your custom image.

You can create images and image versions, and attach image versions to your domain, using the SageMaker AI control panel, the AWS SDK for Python (Boto3), and the AWS Command Line Interface (AWS CLI). You can also create images and image versions using the SageMaker AI console, even if you haven't onboarded to a domain.

The following topics show how to bring your own image to RStudio on SageMaker AI by creating, attaching, and launching a custom image.

Key terminology

The following section defines key terms for bringing your own image to use with RStudio on SageMaker AI.

  • Dockerfile: A Dockerfile is a file that identifies the language packages and other dependencies for your Docker image.

  • Docker image: The Docker image is a built Dockerfile. This image is checked into Amazon ECR and serves as the basis of the SageMaker AI image.

  • SageMaker AI image: A SageMaker AI image is a holder for a set of SageMaker AI image versions based on Docker images.

  • Image version: An image version of a SageMaker AI image represents a Docker image that is compatible with RStudio and stored in an Amazon ECR repository. Each image version is immutable. These image versions can be attached to a domain and used with RStudio on SageMaker AI.