Access Cloud Storage buckets and files in JupyterLab

This page shows you how to mount a Cloud Storage bucket to the JupyterLab interface of your Vertex AI Workbench instance so that you can browse files that are stored in Cloud Storage. You can also open and edit files that are compatible with JupyterLab, such as text files and notebook (IPYNB) files.

Overview

Vertex AI Workbench instances include a Cloud Storage integration that lets you mount a Cloud Storage bucket. This means you can browse the contents of the bucket and work with compatible files from within the JupyterLab interface.

You can access any of the Cloud Storage buckets and files that your instance has access to within the same project as your Vertex AI Workbench instance.

Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. Enable the Notebooks API.

    Enable the API

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Make sure that billing is enabled for your Google Cloud project.

  7. Enable the Notebooks API.

    Enable the API

Required roles

To ensure that your user account has the necessary permissions to mount a Cloud Storage bucket to a Vertex AI Workbench instance, ask your administrator to grant your user account the following IAM roles on the project:

For more information about granting roles, see Manage access.

Your administrator might also be able to give your user account the required permissions through custom roles or other predefined roles.

Required permission for enabling shared storage mounting

To enable shared storage mounting in your Vertex AI Workbench instance, ask your administrator to grant your Vertex AI Workbench instance's service account the storage.buckets.list permission on the project.

The storage.buckets.list permission is required for the Mount shared storage button to appear in the JupyterLab interface of your Vertex AI Workbench instance.

Create a bucket and a Vertex AI Workbench instance

You must have access to at least one Cloud Storage bucket in the same project as your Vertex AI Workbench instance.

  1. If you need to create a Cloud Storage bucket, see Create buckets.

  2. If you haven't already, create a Vertex AI Workbench instance in the same project as your Cloud Storage bucket.

Open JupyterLab

  1. In the Google Cloud console, go to the Instances page.

    Go to Instances

  2. Next to your Vertex AI Workbench instance's name, click Open JupyterLab.

    Your Vertex AI Workbench instance opens JupyterLab.

Mount a Cloud Storage bucket

To mount and then access a Cloud Storage bucket, do the following:

  1. In JupyterLab, make sure the  File Browser tab is selected.

  2. In the left sidebar, click the  Mount shared storage button. If you don't see the button, drag the right side of the sidebar to expand the sidebar until you see the button.

    The Mount shared storage button in the top right corner of the left sidebar

  3. In the Bucket name field, enter the Cloud Storage bucket name that you want to mount.

  4. Click Mount.

  5. Your Cloud Storage bucket appears as a folder in the File browser tab of the left sidebar. Double-click the folder to open it and browse the contents.

Troubleshoot

To find methods for diagnosing and resolving issues with mounting a Cloud Storage bucket to your instance, see Troubleshooting Vertex AI Workbench.

What's next