Skip to content

Update sample SageMaker lifecycles to latest #657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Starting with v1.31.6, this file will contain a record of major features and upd
- Modified the `%reset --snapshot` option to use the CreateGraphSnapshot API ([Link to PR](https://github.com/aws/graph-notebook/pull/654))
- Upgraded `setuptools` dependency to 70.x ([Link to PR](https://github.com/aws/graph-notebook/pull/649))
- 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))
- Updated sample SageMaker Lifecycle scripts ([Link to PR](https://github.com/aws/graph-notebook/pull/657))

## Release 4.5.0 (July 15, 2024)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,18 @@
sudo -u ec2-user -i <<'EOF'

echo "export GRAPH_NOTEBOOK_AUTH_MODE=DEFAULT" >> ~/.bashrc # set to IAM instead of DEFAULT if cluster is IAM enabled
echo "export GRAPH_NOTEBOOK_SERVICE=neptune-db" >> ~/.bashrc
echo "export GRAPH_NOTEBOOK_SERVICE=neptune-db" >> ~/.bashrc # set to neptune-graph for Neptune Analytics host
echo "export GRAPH_NOTEBOOK_HOST=CHANGE-ME" >> ~/.bashrc
echo "export GRAPH_NOTEBOOK_PORT=8182" >> ~/.bashrc
echo "export NEPTUNE_LOAD_FROM_S3_ROLE_ARN=" >> ~/.bashrc
echo "export AWS_REGION=cn-northwest-1" >> ~/.bashrc # modify region if needed

VERSION=""
for i in "$@"
do
case $i in
-v=*|--version=*)
VERSION="${i#*=}"
echo "set notebook version to ${VERSION}"
shift
;;
esac
done
NOTEBOOK_VERSION=""

source activate JupyterSystemEnv

echo "installing Python 3 kernel"
python3 -m ipykernel install --sys-prefix --name python3 --display-name "Python 3"
python3 -m ipykernel install --sys-prefix --name python3 --display-name "Neptune_Python3"

echo "installing python dependencies..."
pip uninstall NeptuneGraphNotebook -y # legacy uninstall when we used to install from source in s3
Expand All @@ -40,10 +30,10 @@ pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn "itables<=1.4.2"
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn "awswrangler"

if [[ ${VERSION} == "" ]]; then
if [[ ${NOTEBOOK_VERSION} == "" ]]; then
pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn graph-notebook
else
pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn graph-notebook==${VERSION}
pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn graph-notebook==${NOTEBOOK_VERSION}
fi

echo "installing nbextensions..."
Expand All @@ -53,7 +43,7 @@ echo "installing static resources..."
python -m graph_notebook.static_resources.install

echo "enabling visualization..."
if [[ ${VERSION//./} < 330 ]] && [[ ${VERSION} != "" ]]; then
if [[ ${NOTEBOOK_VERSION//./} < 330 ]] && [[ ${NOTEBOOK_VERSION} != "" ]]; then
jupyter nbextension install --py --sys-prefix graph_notebook.widgets
fi
jupyter nbextension enable --py --sys-prefix graph_notebook.widgets
Expand Down Expand Up @@ -93,7 +83,7 @@ AWS_REGION: ${AWS_REGION}"
--aws_region "${AWS_REGION}"

echo "Adding graph_notebook.magics to ipython config..."
if [[ ${VERSION//./} > 341 ]] || [[ ${VERSION} == "" ]]; then
if [[ ${NOTEBOOK_VERSION//./} > 341 ]] || [[ ${NOTEBOOK_VERSION} == "" ]]; then
/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/python -m graph_notebook.ipython_profile.configure_ipython_profile
else
echo "Skipping, unsupported on graph-notebook<=3.4.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,12 @@ echo "export GRAPH_NOTEBOOK_PORT=8182" >> ~/.bashrc
echo "export NEPTUNE_LOAD_FROM_S3_ROLE_ARN=" >> ~/.bashrc
echo "export AWS_REGION=us-west-2" >> ~/.bashrc # modify region if needed

VERSION=""
for i in "$@"
do
case $i in
-v=*|--version=*)
VERSION="${i#*=}"
echo "set notebook version to ${VERSION}"
shift
;;
esac
done
NOTEBOOK_VERSION=""

source activate JupyterSystemEnv

echo "installing Python 3 kernel"
python3 -m ipykernel install --sys-prefix --name python3 --display-name "Python 3"
python3 -m ipykernel install --sys-prefix --name python3 --display-name "Neptune_Python3"

echo "installing python dependencies..."
pip uninstall NeptuneGraphNotebook -y # legacy uninstall when we used to install from source in s3
Expand All @@ -40,10 +30,10 @@ pip install "nbclient<=0.7.0"
pip install "itables<=1.4.2"
pip install awswrangler

if [[ ${VERSION} == "" ]]; then
if [[ ${NOTEBOOK_VERSION} == "" ]]; then
pip install --upgrade graph-notebook
else
pip install --upgrade graph-notebook==${VERSION}
pip install --upgrade graph-notebook==${NOTEBOOK_VERSION}
fi

echo "installing nbextensions..."
Expand All @@ -53,7 +43,7 @@ echo "installing static resources..."
python -m graph_notebook.static_resources.install

echo "enabling visualization..."
if [[ ${VERSION//./} < 330 ]] && [[ ${VERSION} != "" ]]; then
if [[ ${NOTEBOOK_VERSION//./} < 330 ]] && [[ ${NOTEBOOK_VERSION} != "" ]]; then
jupyter nbextension install --py --sys-prefix graph_notebook.widgets
fi
jupyter nbextension enable --py --sys-prefix graph_notebook.widgets
Expand Down Expand Up @@ -93,7 +83,7 @@ AWS_REGION: ${AWS_REGION}"
--aws_region "${AWS_REGION}"

echo "Adding graph_notebook.magics to ipython config..."
if [[ ${VERSION//./} > 341 ]] || [[ ${VERSION} == "" ]]; then
if [[ ${NOTEBOOK_VERSION//./} > 341 ]] || [[ ${NOTEBOOK_VERSION} == "" ]]; then
/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/python -m graph_notebook.ipython_profile.configure_ipython_profile
else
echo "Skipping, unsupported on graph-notebook<=3.4.1"
Expand Down
Loading