Skip to content

aws-samples/sagemaker-studio-apps-lifecycle-config-examples

SageMaker Studio Lifecycle Configuration examples

Overview

A collection of sample scripts customizing SageMaker Studio applications using lifecycle configurations.

Lifecycle Configurations (LCCs) provide a mechanism to customize SageMaker Studio applications via shell scripts that are executed at application bootstrap. For further information on how to use lifecycle configurations with SageMaker Studio applications, please refer to the AWS documentation:

Warning The sample scripts in this repository are designed to work with SageMaker Studio JupyterLab and Code Editor applications. If you are using SageMaker Studio Classic, please refer to https://github.com/aws-samples/sagemaker-studio-lifecycle-config-examples

Sample Scripts

  • auto-stop-idle - Automatically shuts down JupyterLab applications that have been idle for a configurable time.
  • auto-stop-idle - Automatically shuts down Code Editor applications that have been idle for a configurable time.

Common scripts

These scripts will work with both SageMaker JupyterLab and SageMaker Code Editor apps. Note that if you want the script to be available across both apps, you will need to set them as an LCC script for both apps.

  • ebs-s3-backup-restore - This script backs up content in a user space's EBS volume (user's home directory under /home/sagemaker-user) to an S3 bucket that's specified on the script, optionally on a schedule. If the user profile is tagged with a SM_EBS_RESTORE_TIMESTAMP tag, then the script will restore the backup files into the user's home directory, in addition to backups.

Developing LLCs for SageMaker Studio applications

For best practices, please check DEVELOPMENT.

License

This project is licensed under the MIT-0 License.

Authors

Giuseppe A. Porcelli - Principal, ML Specialist Solutions Architect - Amazon SageMaker
Spencer Ng - Software Development Engineer - Amazon SageMaker
Durga Sury - Senior ML Specialist Solutions Architect - Amazon SageMaker