Vertex AI Workbench is a single development environment for the entire data science workflow. To set up an end-to-end notebook-based production environment, create JupyterLab instances with built-in integrations. If you are new to Vertex AI, learn more about Vertex AI Workbench.
This page describes the process of managing JupyterLab notebooks in Vertex AI Workbench, including creating and sharing notebooks and using notebooks to interact with Vertex AI services. This page also shows how to delete and update the JupyterLab instances that host your notebooks.
For information about backing up and restoring data, see Create a backup and restore notebook data.
Before you begin
Before using Vertex AI Workbench to manage notebooks, you must have a project ready to run Vertex AI services. For more information, see Set up a project for Vertex AI.
To get the permissions you need to manage notebook resources within a project namespace, ask your Project IAM Admin to grant you one of the following roles:
- Workbench Notebooks Admin (
workbench-notebooks-admin
): Get read and write access to all notebook resources in a project. You need this role to create JupyterLab notebooks. - Workbench Notebooks Viewer (
workbench-notebooks-viewer
): Get read-only access to all notebook resources in a project. You need this role to open JupyterLab notebooks.
For more information about these roles, see Prepare IAM permissions.
Create a JupyterLab notebook
This section describes configuring a JupyterLab instance in Vertex AI Workbench and creating a JupyterLab notebook in the instance.
After meeting the prerequisites, follow these steps to configure a JupyterLab instance and create a JupyterLab notebook:
- Sign in to the GDC console and select your project.
- In the navigation menu, click Vertex AI > Workbench.
- Click New notebook.
On the Create notebook page, enter values for the following fields:
- Notebook name: enter the name you want to give to your JupyterLab notebook. Vertex AI Workbench uses the name you choose to create a URL for accessing your notebook.
- Environment: select a Docker image for your JupyterLab instance. This image provides a baseline for deployment and typical machine learning (ML) packages.
- Cluster: select a Kubernetes cluster for your JupyterLab instance that meets your usage requirements. If a Kubernetes cluster isn't available, work with your administrator to add one or more clusters.
- CPUs / Memory: enter the amount of CPUs and RAM you need for your workloads. For CPU-intensive workloads, you can choose more than one CPU.
- GPUs: select the number of GPUs you need for your JupyterLab instance. In Distributed Cloud, a GPU is one NVIDIA Multi-Instance GPU (MIG) slice of an A100 Tensor Core GPU.
- Workspace volume: enter the storage size you need in GB.
Click Create.
Vertex AI Workbench configures the JupyterLab instance and creates your JupyterLab notebook. Save the notebook's URL for future access.
After you create a JupyterLab notebook in Vertex AI Workbench, open the integrated development environment (IDE) in the JupyterLab environment. For more information, see Open a JupyterLab notebook.
Open a JupyterLab notebook
Enter the URL of a JupyterLab notebook in a web browser to open it. If you don't know the URL, follow these steps to open the notebook:
- Sign in to the GDC console and select your project.
- In the navigation menu, click Vertex AI > Workbench.
- Find the JupyterLab notebook you want to open and click Open JupyterLab to open the JupyterLab instance IDE.
- If prompted to authenticate, follow the authentication steps for your identity provider.
- In the JupyterLab instance, open the JupyterLab notebook.
Share the URL of a JupyterLab notebook with other users so that they can open it too. The intended user must have the Workbench Notebooks Viewer role.
Use Vertex AI services from a JupyterLab notebook
Use client libraries to interact with a Vertex AI service from a JupyterLab notebook. Vertex AI client libraries let you programmatically make API calls to any Vertex AI service on Distributed Cloud.
Follow these steps to use a Vertex AI service from a JupyterLab notebook:
- Enable the corresponding Vertex AI API.
- Install the corresponding Vertex AI client library.
- Create a JupyterLab notebook.
- Open the JupyterLab notebook and use it to write code with the Vertex AI client libraries. For example, you can translate text using the Vertex AI Translation client library.
Delete a JupyterLab instance
Follow these steps to delete a JupyterLab instance:
- Sign in to the GDC console and select your project.
- In the navigation menu, click Vertex AI > Workbench.
- Find the notebook associated with the JupyterLab instance you want to delete.
- Select the checkbox of the JupyterLab notebook.
- Click Delete.
- In the Delete notebooks dialog, click Delete.
Update a JupyterLab instance
After your Infrastructure Operator (IO) updates Distributed Cloud, you can update your JupyterLab instances.
Follow these steps for each JupyterLab instance you want to update:
- Save the files from the JupyterLab instance you want to retain to a storage bucket. For more information, see Upload and download storage objects in projects.
- After the update, sign in to the GDC console and select your project.
- Configure a new JupyterLab instance. Vertex AI Workbench creates a JupyterLab instance with a new version of JupyterLab. For example, the new JupyterLab instance contains client library updates from Distributed Cloud.
- Copy the files from the storage bucket of the outdated JupyterLab instance to the new JupyterLab instance.
You can delete the previous version of your JupyterLab instance. For more information, see Delete a JupyterLab instance.