Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

execute-notebook-on-startup [Script doesn't work] #105

Open
dineshmane opened this issue Dec 29, 2022 · 1 comment
Open

execute-notebook-on-startup [Script doesn't work] #105

dineshmane opened this issue Dec 29, 2022 · 1 comment

Comments

@dineshmane
Copy link

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
@dmlause
Copy link
Contributor

dmlause commented Mar 12, 2024

Please raise a pull request for this issue with your fix and post it here, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants