Skip to content

Commit fba675a

Browse files
authored
Update sample SageMaker lifecycles to latest (#657)
* Update sample SageMaker lifecycles to latest * update changelog
1 parent 1c88411 commit fba675a

File tree

3 files changed

+14
-33
lines changed

3 files changed

+14
-33
lines changed

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Starting with v1.31.6, this file will contain a record of major features and upd
99
- Modified the `%reset --snapshot` option to use the CreateGraphSnapshot API ([Link to PR](https://github.com/aws/graph-notebook/pull/654))
1010
- Upgraded `setuptools` dependency to 70.x ([Link to PR](https://github.com/aws/graph-notebook/pull/649))
1111
- Experimental support for Python 3.11 ([PR #1](https://github.com/aws/graph-notebook/pull/645)) ([PR #2](https://github.com/aws/graph-notebook/pull/656))
12+
- Updated sample SageMaker Lifecycle scripts ([Link to PR](https://github.com/aws/graph-notebook/pull/657))
1213

1314
## Release 4.5.0 (July 15, 2024)
1415

additional-databases/sagemaker/sagemaker-notebook-lifecycle/install-graph-notebook-lc-cn.sh

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,18 @@
33
sudo -u ec2-user -i <<'EOF'
44
55
echo "export GRAPH_NOTEBOOK_AUTH_MODE=DEFAULT" >> ~/.bashrc # set to IAM instead of DEFAULT if cluster is IAM enabled
6-
echo "export GRAPH_NOTEBOOK_SERVICE=neptune-db" >> ~/.bashrc
6+
echo "export GRAPH_NOTEBOOK_SERVICE=neptune-db" >> ~/.bashrc # set to neptune-graph for Neptune Analytics host
77
echo "export GRAPH_NOTEBOOK_HOST=CHANGE-ME" >> ~/.bashrc
88
echo "export GRAPH_NOTEBOOK_PORT=8182" >> ~/.bashrc
99
echo "export NEPTUNE_LOAD_FROM_S3_ROLE_ARN=" >> ~/.bashrc
1010
echo "export AWS_REGION=cn-northwest-1" >> ~/.bashrc # modify region if needed
1111
12-
VERSION=""
13-
for i in "$@"
14-
do
15-
case $i in
16-
-v=*|--version=*)
17-
VERSION="${i#*=}"
18-
echo "set notebook version to ${VERSION}"
19-
shift
20-
;;
21-
esac
22-
done
12+
NOTEBOOK_VERSION=""
2313
2414
source activate JupyterSystemEnv
2515
2616
echo "installing Python 3 kernel"
27-
python3 -m ipykernel install --sys-prefix --name python3 --display-name "Python 3"
17+
python3 -m ipykernel install --sys-prefix --name python3 --display-name "Neptune_Python3"
2818
2919
echo "installing python dependencies..."
3020
pip uninstall NeptuneGraphNotebook -y # legacy uninstall when we used to install from source in s3
@@ -40,10 +30,10 @@ pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna
4030
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn "itables<=1.4.2"
4131
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn "awswrangler"
4232
43-
if [[ ${VERSION} == "" ]]; then
33+
if [[ ${NOTEBOOK_VERSION} == "" ]]; then
4434
pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn graph-notebook
4535
else
46-
pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn graph-notebook==${VERSION}
36+
pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn graph-notebook==${NOTEBOOK_VERSION}
4737
fi
4838
4939
echo "installing nbextensions..."
@@ -53,7 +43,7 @@ echo "installing static resources..."
5343
python -m graph_notebook.static_resources.install
5444
5545
echo "enabling visualization..."
56-
if [[ ${VERSION//./} < 330 ]] && [[ ${VERSION} != "" ]]; then
46+
if [[ ${NOTEBOOK_VERSION//./} < 330 ]] && [[ ${NOTEBOOK_VERSION} != "" ]]; then
5747
jupyter nbextension install --py --sys-prefix graph_notebook.widgets
5848
fi
5949
jupyter nbextension enable --py --sys-prefix graph_notebook.widgets
@@ -93,7 +83,7 @@ AWS_REGION: ${AWS_REGION}"
9383
--aws_region "${AWS_REGION}"
9484
9585
echo "Adding graph_notebook.magics to ipython config..."
96-
if [[ ${VERSION//./} > 341 ]] || [[ ${VERSION} == "" ]]; then
86+
if [[ ${NOTEBOOK_VERSION//./} > 341 ]] || [[ ${NOTEBOOK_VERSION} == "" ]]; then
9787
/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/python -m graph_notebook.ipython_profile.configure_ipython_profile
9888
else
9989
echo "Skipping, unsupported on graph-notebook<=3.4.1"

additional-databases/sagemaker/sagemaker-notebook-lifecycle/install-graph-notebook-lc.sh

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,12 @@ echo "export GRAPH_NOTEBOOK_PORT=8182" >> ~/.bashrc
99
echo "export NEPTUNE_LOAD_FROM_S3_ROLE_ARN=" >> ~/.bashrc
1010
echo "export AWS_REGION=us-west-2" >> ~/.bashrc # modify region if needed
1111
12-
VERSION=""
13-
for i in "$@"
14-
do
15-
case $i in
16-
-v=*|--version=*)
17-
VERSION="${i#*=}"
18-
echo "set notebook version to ${VERSION}"
19-
shift
20-
;;
21-
esac
22-
done
12+
NOTEBOOK_VERSION=""
2313
2414
source activate JupyterSystemEnv
2515
2616
echo "installing Python 3 kernel"
27-
python3 -m ipykernel install --sys-prefix --name python3 --display-name "Python 3"
17+
python3 -m ipykernel install --sys-prefix --name python3 --display-name "Neptune_Python3"
2818
2919
echo "installing python dependencies..."
3020
pip uninstall NeptuneGraphNotebook -y # legacy uninstall when we used to install from source in s3
@@ -40,10 +30,10 @@ pip install "nbclient<=0.7.0"
4030
pip install "itables<=1.4.2"
4131
pip install awswrangler
4232
43-
if [[ ${VERSION} == "" ]]; then
33+
if [[ ${NOTEBOOK_VERSION} == "" ]]; then
4434
pip install --upgrade graph-notebook
4535
else
46-
pip install --upgrade graph-notebook==${VERSION}
36+
pip install --upgrade graph-notebook==${NOTEBOOK_VERSION}
4737
fi
4838
4939
echo "installing nbextensions..."
@@ -53,7 +43,7 @@ echo "installing static resources..."
5343
python -m graph_notebook.static_resources.install
5444
5545
echo "enabling visualization..."
56-
if [[ ${VERSION//./} < 330 ]] && [[ ${VERSION} != "" ]]; then
46+
if [[ ${NOTEBOOK_VERSION//./} < 330 ]] && [[ ${NOTEBOOK_VERSION} != "" ]]; then
5747
jupyter nbextension install --py --sys-prefix graph_notebook.widgets
5848
fi
5949
jupyter nbextension enable --py --sys-prefix graph_notebook.widgets
@@ -93,7 +83,7 @@ AWS_REGION: ${AWS_REGION}"
9383
--aws_region "${AWS_REGION}"
9484
9585
echo "Adding graph_notebook.magics to ipython config..."
96-
if [[ ${VERSION//./} > 341 ]] || [[ ${VERSION} == "" ]]; then
86+
if [[ ${NOTEBOOK_VERSION//./} > 341 ]] || [[ ${NOTEBOOK_VERSION} == "" ]]; then
9787
/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/python -m graph_notebook.ipython_profile.configure_ipython_profile
9888
else
9989
echo "Skipping, unsupported on graph-notebook<=3.4.1"

0 commit comments

Comments
 (0)