I can start/stop Sagemaker notebooks with boto3, but how do run the jupyter notebooks or .py scripts inside?
This is something I'll run from a local environment or lambda (but that's no problem).
Start Sagemaker notebook instance:
import boto3
client = boto3.client('sagemaker')
client.start_notebook_instance(
NotebookInstanceName='sagemaker-notebook-name'
)
In the UI I would just click "Open Jupyter", then run a notebook or a .py script inside it.
But I want to do it programmatically with boto3 or other.
My file inside is called lemmatize-input-data.ipynb.
This must be possible but I'm unsure how?
I also tried:
In a "start notebook" lifecycle configuration script, after creating a simpler test file called test_script.ipynb to be certain it wasn't something advanced in my jupyter notebook that caused the error.
set -e
jupyter nbconvert --execute test_script.ipynb
But got the error:
[NbConvertApp] WARNING | pattern 'test_script.ipynb' matched no files
