Integrate SOCI-indexed images with Studio example
You must reference the SOCI-indexed image tag to use SOCI-indexed images in Studio,
rather than the original container image tag. Use the tag you specified during the SOCI
conversion process (e.g., SOCI_IMAGE_TAG in the Create SOCI indexes with nerdctl and
SOCI CLI example).
Integrate SOCI-indexed images example
-
First set your variables for the Amazon CLI commands that follow. The following is an example of setting up your variables.
ACCOUNT_ID="111122223333" REGION="us-east-1" IMAGE_NAME="sagemaker-image-name" IMAGE_CONFIG_NAME="sagemaker-image-config-name" ROLE_ARN="your-role-arn" DOMAIN_ID="domain-id" SOCI_IMAGE_TAG="soci-indexed-image-tag"Variable definitions:
-
ACCOUNT_IDis your Amazon Web Services account ID -
REGIONis the Amazon Web Services Region of your Amazon ECR private registry -
IMAGE_NAMEis the name of your SageMaker image -
IMAGE_CONFIG_NAMEis the name of your SageMaker image configuration -
ROLE_ARNis the ARN of your execution role with the permissions listed in Required IAM permissions -
DOMAIN_IDis the domain IDNote
If you are attaching the image to a SageMaker Unified Studio project and you need clarification on which domain to use, see View the SageMaker AI domain details associated with your project.
-
SOCI_IMAGE_TAGis the tag of your SOCI-indexed image
-
-
Export your region:
export AWS_REGION=$REGION -
Create a SageMaker image:
aws sagemaker create-image \ --image-name "$IMAGE_NAME" \ --role-arn "$ROLE_ARN" -
Create a SageMaker Image Version using your SOCI index URI:
IMAGE_INDEX_URI="$ACCOUNT_ID.dkr.ecr.$REGION.amazonaws.com/$IMAGE_NAME:$SOCI_IMAGE_TAG" aws sagemaker create-image-version \ --image-name "$IMAGE_NAME" \ --base-image "$IMAGE_INDEX_URI" -
Create an application image configuration and update your Amazon SageMaker AI domain to include the custom image for your app. You can do this for Code Editor, based on Code-OSS, Visual Studio Code - Open Source (Code Editor) and JupyterLab applications. Choose the application option below to view the steps.
-
After you update your domain to include your custom image, you can create an application in Studio using your custom image. When you Launch a custom image in Studio ensure that you are using your custom image.