Skip to content

Commit

Permalink
Add conditional for launch script usage (aws#232)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Chin <[email protected]>
  • Loading branch information
michaelnchin and michaelnchin authored Dec 4, 2021
1 parent 6c3dddb commit fde208e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion additional-databases/sagemaker/install-graph-notebook-lc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ echo "export GRAPH_NOTEBOOK_PORT=8182" >> ~/.bashrc
echo "export NEPTUNE_LOAD_FROM_S3_ROLE_ARN=" >> ~/.bashrc
echo "export AWS_REGION=us-west-2" >> ~/.bashrc
VERSION=""
for i in "$@"
do
case $i in
-v=*|--version=*)
VERSION="${i#*=}"
echo "set notebook version to ${VERSION}"
shift
;;
esac
done
source activate JupyterSystemEnv
echo "installing Python 3 kernel"
Expand All @@ -32,7 +44,6 @@ mkdir -p ~/SageMaker/Neptune
cd ~/SageMaker/Neptune || exit
python -m graph_notebook.notebooks.install
chmod -R a+rw ~/SageMaker/Neptune/*
python -m graph_notebook.start_notebook --notebooks-dir ~/SageMaker/Neptune/*
source ~/.bashrc || exit
HOST=${GRAPH_NOTEBOOK_HOST}
Expand Down Expand Up @@ -60,6 +71,12 @@ AWS_REGION: ${AWS_REGION}"
--load_from_s3_arn "${LOAD_FROM_S3_ARN}" \
--aws_region "${AWS_REGION}"
if [[ ${VERSION//./} > 306 ]]; then
python -m graph_notebook.start_notebook --notebooks-dir ~/SageMaker/Neptune/*
else
echo "Skipping launch with start_notebook.py, unsupported on v3.0.6 and lower."
fi
source /home/ec2-user/anaconda3/bin/deactivate
echo "done."
Expand Down

0 comments on commit fde208e

Please sign in to comment.