forked from aws/graph-notebook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create README.md How to launch graph-notebook using lifecycle configurations * Add files via upload * Update README.md * Update README.md * Update README.md * Create Notebook Step * Delete Create-Notebook-Instance.png * Create Notebook with Lifecycle * Update README.md * Delete install-graph-notebook-lc.sh * Lifecycle config script
- Loading branch information
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Launching graph-notebook using Amazon SageMaker | ||
You can easily launch instances of graph-notebook on Amazon SageMaker by using a lifecycle configuration. To learn more about lifecycle configurations and how to create one, see [documentation](https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html). | ||
|
||
Use the sample lifecycle configuration in this folder, [`install-graph-notebook-lc.sh`](install-graph-notebook-lc.sh) or create your own shell script. | ||
|
||
After you create a lifecycle configuration on SageMaker, you can create new notebook instances by specifying a saved lifecycle configuration: | ||
|
||
 |
68 changes: 68 additions & 0 deletions
68
additional-databases/sagemaker/install-graph-notebook-lc.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/bin/bash | ||
|
||
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_HOST=CHANGE-ME" >> ~/.bashrc | ||
echo "export GRAPH_NOTEBOOK_PORT=8182" >> ~/.bashrc | ||
echo "export NEPTUNE_LOAD_FROM_S3_ROLE_ARN=" >> ~/.bashrc | ||
echo "export AWS_REGION=us-west-2" >> ~/.bashrc | ||
source activate JupyterSystemEnv | ||
echo "installing Python 3 kernel" | ||
python3 -m ipykernel install --sys-prefix --name python3 --display-name "Python 3" | ||
echo "installing python dependencies..." | ||
pip uninstall NeptuneGraphNotebook -y # legacy uninstall when we used to install from source in s3 | ||
pip install --upgrade graph-notebook | ||
echo "installing nbextensions..." | ||
python -m graph_notebook.nbextensions.install | ||
echo "installing static resources..." | ||
python -m graph_notebook.static_resources.install | ||
echo "enabling visualization..." | ||
jupyter nbextension install --py --sys-prefix graph_notebook.widgets | ||
jupyter nbextension enable --py --sys-prefix graph_notebook.widgets | ||
mkdir -p ~/SageMaker/Neptune | ||
cd ~/SageMaker/Neptune || exit | ||
python -m graph_notebook.notebooks.install | ||
chmod -R a+rw ~/SageMaker/Neptune/* | ||
source ~/.bashrc || exit | ||
HOST=${GRAPH_NOTEBOOK_HOST} | ||
PORT=${GRAPH_NOTEBOOK_PORT} | ||
AUTH_MODE=${GRAPH_NOTEBOOK_AUTH_MODE} | ||
SSL=${GRAPH_NOTEBOOK_SSL} | ||
IAM_CREDENTIALS_PROVIDER=${GRAPH_NOTEBOOK_IAM_PROVIDER} | ||
LOAD_FROM_S3_ARN=${NEPTUNE_LOAD_FROM_S3_ROLE_ARN} | ||
if [[ ${SSL} -eq "" ]]; then | ||
SSL="True" | ||
fi | ||
echo "Creating config with | ||
HOST: ${HOST} | ||
PORT: ${PORT} | ||
AUTH_MODE: ${AUTH_MODE} | ||
SSL: ${SSL} | ||
IAM_CREDENTIALS_PROVIDER: ${IAM_CREDENTIALS_PROVIDER} | ||
AWS_REGION: ${AWS_REGION}" | ||
/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/python -m graph_notebook.configuration.generate_config \ | ||
--host "${HOST}" \ | ||
--port "${PORT}" \ | ||
--auth_mode "${AUTH_MODE}" \ | ||
--ssl "${SSL}" \ | ||
--iam_credentials_provider "${IAM_CREDENTIALS_PROVIDER}" \ | ||
--load_from_s3_arn "${LOAD_FROM_S3_ARN}" \ | ||
--aws_region "${AWS_REGION}" | ||
source /home/ec2-user/anaconda3/bin/deactivate | ||
echo "done." | ||
EOF |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.