copy the contents of a Sagemaker notebook instance to an S3 bucket from AWS CLI

1

How to copy the contents of a Sagemaker notebook instance to an S3 bucket from AWS CLI, before deleting the instance ? Please suggest !

Thanks!

rgr1985
질문됨 일 년 전2454회 조회
1개 답변
4

The following article can give you an idea about it

https://aws.amazon.com/blogs/machine-learning/migrate-your-work-to-amazon-sagemaker-notebook-instance-with-amazon-linux-2/

Your steps are

Create a Snapshot

aws sagemaker stop-notebook-instance --notebook-instance-name <your-notebook-instance-name>

Stop Notebook instance

aws sagemaker describe-notebook-instance --notebook-instance-name <your-notebook-instance-name>

Create a SageMaker Notebook Instance lifecycle configuration script that copies the contents of the instance to an S3 bucket

#!/bin/bash
set -e
aws s3 sync /home/ec2-user/SageMaker/ s3://<your-s3-bucket>/path/to/backup/

Create a SageMaker Notebook Instance Lifecycle Configuration


aws sagemaker create-notebook-instance-lifecycle-config --notebook-instance-lifecycle-config-name <your-lifecycle-config-name> --on-start Content=$(base64 copy-to-s3-script.sh)

Attach the config

aws sagemaker update-notebook-instance --notebook-instance-name <your-notebook-instance-name> --lifecycle-config-name <your-lifecycle-config-name>

Start the notebook

aws sagemaker start-notebook-instance --notebook-instance-name <your-notebook-instance-name>

profile picture
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠