Reputation: 13481
I'm unable to get Sagemaker Lifecycle Configuration to create a plain .txt
file in the directory with my jupyter notebooks when the sagemaker notebook starts.
In the future I'll add text to this file, but creating the file is the first step.
Start notebook script:
#!/bin/bash
set -e
touch filename.txt
Note: I have edited my notebook to add this lifecycle configuration.
But when the notebook starts and I open it, the file does not exist. Is this possible?
Upvotes: 1
Views: 803
Reputation: 312
The working directory of the Lifecycle Configuration script is "/" and Jupyter starts up from the "/home/ec2-user/SageMaker" directory. So, if you create a file outside "/home/ec2-user/SageMaker", it will not be visible inside the Jupyter file browser.
To address this, you can modify your script to
touch /home/ec2-user/SageMaker/filename.txt
Thanks for using Amazon SageMaker!
Upvotes: 1
Reputation: 501
You are creating the file in the root directory.
Use the terminal option of your notebook to explore
Upvotes: 1