Description of changes:
x flag added to the set command to increase verbosity in logs.
Script will test importing boto3 from /usr/bin/python which is successful for Amazon Linux 1 notebooks but fails for Amazon Linux 2 currently. If it fails (as expected on Amazon Linux 2) it will try again with /usr/bin/python3 (which has boto3 installed for both Amazon Linux 1 and Amazon Linux 2). If that fails it will exit with error. The cron task is set to use whichever is successful.
Python output from cron redirected to /var/log/jupyter.log. This makes the output from the script viewable in CloudWatch logs for the instance allowing for easier debugging.
Testing Done
[x] Notebook Instance created successfully with the Lifecycle Configuration
[x] Notebook Instance stopped and started successfully
[ ] Documentation in the script around any network access requirements
[ ] Documentation in the script around any IAM permission requirements
[x] CLI commands used to validate functionality on the instance
[ ] New script link and description added to README.md
# On Amazon Linux 1 notebook
/usr/bin/python -c "import boto3"
/usr/bin/python3 -c "import boto3"
# On Amazon Linux 2 notebook
/usr/bin/python -c "import boto3"
/usr/bin/python3 -c "import boto3"
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Issue #, if available: 82
Description of changes: x flag added to the set command to increase verbosity in logs.
Script will test importing boto3 from
/usr/bin/python
which is successful for Amazon Linux 1 notebooks but fails for Amazon Linux 2 currently. If it fails (as expected on Amazon Linux 2) it will try again with/usr/bin/python3
(which has boto3 installed for both Amazon Linux 1 and Amazon Linux 2). If that fails it will exit with error. The cron task is set to use whichever is successful.Python output from cron redirected to
/var/log/jupyter.log
. This makes the output from the script viewable in CloudWatch logs for the instance allowing for easier debugging.Testing Done
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.