Skip to content

How to create a JupyterLab 4 Notebook for a Neptune instance

0

Hello all. I was recently notified by AWS:

On June 30, 2025, Amazon SageMaker will deprecate Notebook Instances running on the JupyterLab 1 and JupyterLab 3 platforms. Effective on this date, customers will no longer be able to create new or restart stopped JupyterLab 1 and JupyterLab 3 Notebook Instances. To ensure you have a secure and supported environment, we strongly recommend migrating your workloads to the new JupyterLab 4 Notebook Instances (platform identifier notebook-al2-v3) before June 30, 2025 [1][2].

My 3 instances (for dev, tst, prd) were created from the the Neptune service console – they allow to create Notebooks, which are being created in SageMaker for you. Here’s the issue:

When creating a Notebook from the Neptune console (as I did in the past) it does not allow to select a Platform Identifier (i.e. JupyterLab 4) and it is created on JupyterLab 3 as before.

When creating directly in SageMaker, Platform Identifier can be selected to JupyterLab 4, however, I could not find a way to create a matching Notebook for the Neptune DBs. These notebooks remain unlinked to my Neptune DB instances.

How can this be resolved one way or the other?

Thanks! Mor

asked a year ago650 views

1 Answer
0

To create a JupyterLab 4 Notebook for a Neptune instance, you'll need to take a slightly different approach than what you've been doing previously. Here's how you can achieve this:

  1. Create the notebook instance directly in Amazon SageMaker:

    • Open the Amazon SageMaker console.
    • Navigate to "Notebook" and then "Notebook instances".
    • Choose "Create notebook instance".
    • Give your notebook a name, preferably prefixed with "aws-neptune-" (e.g., "aws-neptune-my-jupyterlab4-notebook").
    • Under "Platform identifier", select "notebook-al2-v3" which corresponds to JupyterLab 4.
    • Configure other settings as needed.
  2. Set up the notebook for Neptune:

    • In the "Additional configuration" section, create a new lifecycle configuration.
    • Name the configuration (you can use the same name as your notebook instance).
    • In the lifecycle configuration script, add the necessary export commands for Neptune ML, such as:
      echo "export NEPTUNE_ML_ROLE_ARN=<your Neptune ML IAM role ARN>" >> ~/.bashrc
      echo "export NEPTUNE_EXPORT_API_URI=<your export service URI>" >> ~/.bashrc
      
    • Replace the placeholders with your actual Neptune ML IAM role ARN and export service URI.
  3. Configure IAM permissions:

    • Ensure that the IAM role associated with your notebook instance has the necessary permissions for Neptune.
    • You may need to add an inline policy to the role, granting permissions for CloudWatch, S3, and SageMaker actions required for Neptune operations.
  4. After creating the notebook instance, you can install the Neptune-specific libraries and configure the connection to your Neptune database within your notebooks.

By following these steps, you'll have a JupyterLab 4 notebook instance that can work with your Neptune databases. While it's not created directly from the Neptune console, this approach allows you to use the latest JupyterLab version while still maintaining the necessary configurations for Neptune integration.

Remember to update any existing scripts or configurations that might be affected by the upgrade to JupyterLab 4, as there have been some package version changes that could impact certain functionalities.
Sources
JupyterLab versioning - Amazon SageMaker AI
Creating a new Neptune Analytics notebook using the AWS Management Console - Neptune Analytics
Manually configuring a Neptune notebook for Neptune ML - Amazon Neptune

answered a year ago

EXPERT

reviewed a year ago

  • Taking the above AI-generated protocol and trying to make it work was in vain. ChatGPT and myself have reached the following conclusions after several hours of work:

    Where We Stand

    • JupyterLab 4.x introduces breaking changes: Many older extensions and configurations (e.g., jupyter-labextension install) are deprecated or restructured.
    • graph-notebook appears outdated: The graph-notebook package might not yet fully support JupyterLab 4.x.
    • Lifecycle script runs successfully, but:
      • Magics (%%oc, %status) are not registered.
      • Dependency conflicts (e.g., ipykernel) and deprecations persist.
      • The notebook instance works with JupyterLab but fails with Jupyter (500 error).

    Unfortunately there is no way I can raise the attention of the relevant AWS teams to this issue, as I'm not on a support plan. I'm hoping the deadline for upgrading to JupyterLab 4 in June will not leave us Neptune customers without any workable solution!

  • We are aware of the deprecation date and this is a known issue. The underlying library that we use to support integration with Neptune, called Graph-Notebook, has an open Issue where we are tracking this issue. I would suggest following that issue to track when we have a release that supports JupyterLab 4 - https://github.com/aws/graph-notebook/issues/689

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.