This repository was archived by the owner on May 22, 2025. It is now read-only.
This repository was archived by the owner on May 22, 2025. It is now read-only.
execute-notebook-on-startup [Script doesn't work] #105
Open
Description
Hi,
I tried to execute the script given at https://github.com/aws-samples/amazon-sagemaker-notebook-instance-lifecycle-config-samples/blob/master/scripts/execute-notebook-on-startup/on-start.sh
found two error while running:
environment not found
jupyter nbconvert cmd didn't run as expected due to one missing argument.
Attaching the correct script.
#!/bin/bash
set -e
# OVERVIEW
# This script executes an existing Notebook file on the instance during start using nbconvert(https://github.com/jupyter/nbconvert)
# PARAMETERS
ENVIRONMENT=python3
NOTEBOOK_FILE=/home/ec2-user/SageMaker/MyNotebook.ipynb
source /home/ec2-user/anaconda3/bin/activate "$ENVIRONMENT"
jupyter nbconvert --to notebook --ExecutePreprocessor.kernel_name=python3 --execute "$NOTEBOOK_FILE"
source /home/ec2-user/anaconda3/bin/deactivate
Metadata
Metadata
Assignees
Labels
No labels