AWS neptune documentation change
Summary
Updated documentation for JupyterLab 4 migration, added detailed migration methods (fresh install, S3 transfer, EFS, EBS), and revised notebook creation steps
Security assessment
The changes include IAM role configuration guidance and a lifecycle script with security-related environment variables (GRAPH_NOTEBOOK_SSL=True, IAM auth mode). While these improve security documentation, there's no evidence they address a specific disclosed vulnerability.
Diff
diff --git a/neptune/latest/userguide/graph-notebooks.md b/neptune/latest/userguide/graph-notebooks.md index 1bbeb9806..843b4d5d1 100644 --- a//neptune/latest/userguide/graph-notebooks.md +++ b//neptune/latest/userguide/graph-notebooks.md @@ -5 +5 @@ -Using Neptune workbenchEnabling CloudWatch logsLocal hostingMigrating to JupyterLab 3Setting up Neptune notebooks manually +Using Neptune workbenchEnabling CloudWatch logsLocal hostingMigrating to JupyterLab 4PrerequisitesLifecycle configurationSynchronizing from a snapshotAfter notebook creationCreate the notebookSetting up Neptune notebooks manually @@ -17 +17 @@ By using the AWS CloudFormation template to set up your Neptune database, and th -Neptune notebooks, managed through Amazon SageMaker AI AI, is not currently available in the Asia Pacific (Malaysia) (ap-southeast-5) region. However, you can still deploy Neptune notebooks through alternative non-managed options. Refer to Setting up Neptune notebooks manually for deploying notebooks manually. +Neptune notebooks, managed through Amazon SageMaker AI, is not currently available in the Asia Pacific (Malaysia) (ap-southeast-5) region. However, you can still deploy Neptune notebooks through alternative non-managed options. Refer to Setting up Neptune notebooks manually for deploying notebooks manually. @@ -36 +36 @@ When creating a Neptune notebook instance, you are provided with two options for -Neptune offers `T3` and `T4g` instance types that you can get started with for less than $0.10 per hour. You are billed for workbench resources through Amazon SageMaker AI, separately from your Neptune billing. See [the Neptune pricing page](https://aws.amazon.com/neptune/pricing/). Jupyter and JupyterLab notebooks created on the Neptune workbench all use an Amazon Linux 2 and JupyterLab 3 environment. For more information about JupyterLab notebook support, see the [Amazon SageMaker AI documentation](https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-jl.html). +Neptune offers `T3` and `T4g` instance types that you can get started with for less than $0.10 per hour. You are billed for workbench resources through Amazon SageMaker AI, separately from your Neptune billing. See [the Neptune pricing page](https://aws.amazon.com/neptune/pricing/). Jupyter and JupyterLab notebooks created on the Neptune workbench all use an Amazon Linux 2 and JupyterLab 4 environment. For more information about JupyterLab notebook support, see the [Amazon SageMaker AI documentation](https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-jl.html). @@ -55 +55 @@ You can create a Jupyter or JupyterLab notebook using the Neptune workbench in t - 4. In the **Cluster** list, choose your Neptune DB cluster. If you don't yet have a DB cluster, choose **Create cluster** to create one. + 4. Choose **Database** as the Neptune service. @@ -57 +57 @@ You can create a Jupyter or JupyterLab notebook using the Neptune workbench in t - 5. Select a **Notebook instance type**. + 5. In the **Cluster** list, choose your Neptune DB cluster. If you don't yet have a DB cluster, choose **Create cluster** to create one. @@ -59 +59 @@ You can create a Jupyter or JupyterLab notebook using the Neptune workbench in t - 6. Give your notebook a name, and optionally a description. + 6. Select a **Notebook instance type**. @@ -61 +61,3 @@ You can create a Jupyter or JupyterLab notebook using the Neptune workbench in t - 7. Unless you already created an AWS Identity and Access Management (IAM) role for your notebooks, choose **Create an IAM role** , and enter an IAM role name. + 7. Give your notebook a name, and optionally a description. + + 8. Unless you already created an AWS Identity and Access Management (IAM) role for your notebooks, choose **Create an IAM role** , and enter an IAM role name. @@ -67 +69 @@ If you do choose to re-use an IAM role created for a previous notebook, the role - 8. Choose **Create notebook**. The creation process may take 5 to 10 minutes before everything is ready. + 9. Choose **Create notebook**. The creation process may take 5 to 10 minutes before everything is ready. @@ -69 +71 @@ If you do choose to re-use an IAM role created for a previous notebook, the role - 9. After your notebook is created, select it and then choose **Open Jupyter** or **Open JupyterLab**. + 10. After your notebook is created, select it and then choose **Open Jupyter** or **Open JupyterLab**. @@ -295 +297,112 @@ Once you have a local Blazegraph instance running, you can integrate it with you -## Migrating your Neptune notebooks from Jupyter to JupyterLab 3 +## Migrating Neptune notebooks to JupyterLab 4.x + +This section outlines various approaches for migrating your Neptune notebooks to JupyterLab 4.x and newer Amazon Linux environments. For detailed information about JupyterLab versioning, see [Amazon SageMaker AI JupyterLab Versioning](https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-jl.html). + +### Migration approaches + +#### Fresh installation + +If you don't need to preserve existing workspace files or configurations, you can: + + 1. Create a new notebook instance running JupyterLab 4.x (notebook-al2-v3) + + 2. Verify the new setup works as expected + + 3. Stop and delete your old notebook instance + + + + +#### File transfer migration + +This method uses your local system or Amazon S3 as intermediate storage. + +###### Best for + + * [ Direct internet access through Amazon SageMaker AI networking configuration](https://docs.aws.amazon.com/sagemaker/latest/dg/appendix-notebook-and-internet-access.html#appendix-notebook-and-internet-access-default). + + * A moderate volume of data to migrate + + * Specific files to preserve rather than entire workspace configurations. + + + + +##### Method 1: Using JupyterLab UI + +###### Best for + + * Small number of files + + * Selective file migration + + * Prefer simple drag-and-drop operations + + + + +###### Steps + + 1. Download files from source JupyterLab instance: + + * Navigate and select the files you want to migrate to the new instance in JupyterLab + + * Right-click and select **Download** + + 2. Upload to new JupyterLab instance: + + * Use the upload button in JupyterLab and select all files that you want to copy to the new instance + + * (Or) drag and drop files directly + + + + +##### Method 2: Using Amazon S3 + +###### Best for + + * Large number of files + + * Preserving your folder structures + + * Bulk migrations + + + + +###### Prerequisites + +Ensure that the role associated with the notebook has appropriate permissions to upload and access the Amazon S3 bucket: + + + { + "Effect": "Allow", + "Action": ["s3:PutObject", "s3:GetObject", "s3:ListBucket"], + "Resource": ["arn:aws:s3:::your-bucket-name/*", "arn:aws:s3:::your-bucket-name"] + } + +###### Note + +[AWS CLI](https://docs.aws.amazon.com/https://awscli.amazonaws.com/v2/documentation/api/latest/index.html) should be pre-installed on SageMaker AI notebooks. + +###### Steps + + 1. Open a terminal in JupyterLab or type the terminal commands in a notebook cell with `!` prefix. + + 2. Copy files from your old JupyterLab instance to S3 using either [Amazon S3 cp](https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html) or [Amazon S3 sync](https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html) CLI commands: + + # using AWS s3 cp + aws s3 cp /home/ec2-user/SageMaker/your-folder s3://your-bucket/backup/ --recursive + + # (OR) using AWS s3 sync + aws s3 sync /home/ec2-user/SageMaker/your-folder s3://your-bucket/backup/ + + 3. Copy files from S3 to your new JupyterLab instance: + + # using AWS s3 cp + aws s3 cp s3://your-bucket/backup/ /home/ec2-user/SageMaker/your-folder --recursive + + # (OR) using AWS s3 sync + aws s3 sync s3://your-bucket/backup/ /home/ec2-user/SageMaker/your-folder + @@ -297 +410,20 @@ Once you have a local Blazegraph instance running, you can integrate it with you -Neptune notebooks created prior to December 21, 2022 use the Amazon Linux 1 environment. You can migrate older Jupyter notebooks created before that date to the new Amazon Linux 2 environment with JupyterLab 3 by taking the steps described in this AWS blog post: [Migrate your work to an Amazon SageMaker notebook instance with Amazon Linux 2](https://aws.amazon.com/blogs/machine-learning/migrate-your-work-to-amazon-sagemaker-notebook-instance-with-amazon-linux-2/). + + +###### Note + +Use `sync` for maintaining folder structures and incremental updates and `cp` for one-time transfers. + +#### Amazon EFS migration + +###### Best for + + * [ VPC-only](https://docs.aws.amazon.com/sagemaker/latest/dg/appendix-notebook-and-internet-access.html#appendix-notebook-and-internet-access-default-vpc) networking configuration + + * Large data volumes + + + + +###### Steps + +Follow the [Mount an EFS file system to an Amazon SageMaker AI notebook](https://aws.amazon.com/blogs/machine-learning/mount-an-efs-file-system-to-an-amazon-sagemaker-notebook-with-lifecycle-configurations/) blog to use an Amazon EFS file system with your notebook instances. @@ -301 +433,40 @@ In addition, there are also a few more steps that apply specifically to migratin -### Neptune-specific prerequisites + 1. During [ Neptune notebook creation in the console ](https://docs.aws.amazon.com/neptune/latest/userguide/graph-notebooks.html#graph-notebooks-workbench), select **Create a new lifecycle configuration** under Lifecycle configuration + + 2. In the template lifecycle config, append your Amazon EFS mount command (`sudo mount -t nfs ...`) after the install.sh script + + + + +This ensures your Amazon EFS filesystem is automatically mounted each time your notebook instance starts or restarts. For troubleshooting mount issues, refer to [Amazon EFS troubleshooting document](https://docs.aws.amazon.com/efs/latest/ug/troubleshooting.html). + +###### Advantages + + * Seamless access to files across instances + + * Direct file access without intermediary transfers + + * Efficient handling of large datasets + + + + +#### Amazon EBS volume migration + +###### Best for when you need to preserve + + * Complete workspace configurations + + * Hidden files + + * System settings