Create a user-managed notebooks instance with a custom container
You can create a user-managed notebooks instance based on a custom container. Using a custom container lets you customize a user-managed notebooks environment for your specific needs. The container must be accessible to your Google Cloud service account and expose a service on port 8080. We recommend creating a container derived from a Deep Learning Containers image, because those images are already configured to be compatible with user-managed notebooks.
How custom container kernels are updated
Vertex AI Workbench pulls the latest container image for your kernel:
When you create your instance.
When you upgrade your instance.
When you start your instance.
The custom container kernel doesn't persist when your instance is stopped, so each time your instance is started, Vertex AI Workbench pulls the latest version of the container image.
If your instance is running when a new version of a container is released, your instance's kernel isn't updated until you stop and start your instance.
Before you begin
Before you can create a user-managed notebooks instance, you must have a Google Cloud project and enable the Notebooks API for that project.- 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.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Notebooks API.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Notebooks API.
- If you plan to use GPUs with your user-managed notebooks instance, check the quotas page in the Google Cloud console to ensure that you have enough GPUs available in your project. If GPUs are not listed on the quotas page, or you require additional GPU quota, you can request a quota increase. See Requesting an increase in quota on the Compute Engine Resource quotas page.
Required roles
If you created the project, you have the
Owner (roles/owner
) IAM role on the project,
which includes all required permissions. Skip this section and
start creating your user-managed notebooks instance. If you didn't
create the project yourself, continue in this section.
To ensure that your user account has the necessary permissions to create a Vertex AI Workbench user-managed notebooks instance, ask your administrator to grant your user account the following IAM roles on the project:
-
Notebooks Admin (
roles/notebooks.admin
) -
Service Account User (
roles/iam.serviceAccountUser
)
For more information about granting roles, see Manage access to projects, folders, and organizations.
Your administrator might also be able to give your user account the required permissions through custom roles or other predefined roles.
Make sure your custom container is ready
Make sure you have a custom container that is accessible to your Google Cloud service account. For information about how to create a custom container from a Deep Learning Containers image, see Creating a derivative container.
Create an instance with a custom container
To create a user-managed notebooks instance with a custom container, complete the following steps:
In the Google Cloud console, go to the User-managed notebooks page. Or go to notebook.new (https://notebook.new) and skip the next step.
Click
Create new.Click Advanced options.
On the Create instance page, in the Details section, provide the following information for your new instance:
- Name: a name for your new instance
- Region and Zone: Select a region and zone for the new instance. For best network performance, select the region that is geographically closest to you. See the available user-managed notebooks locations.
In the Environment section, in the Environment field, select Custom container.
In the Docker container image field, add a Docker container image in one of the following ways:
- Enter a Docker container image path. For example,
to use a TensorFlow 2.12 container image with accelerators from
Deep Learning Containers,
enter
us-docker.pkg.dev/deeplearning-platform-release/gcr.io/tf-cpu.2-12.py310
. - Click Select to add a Docker container image from Artifact Registry. Then on the Artifact Registry tab where your container image is stored, change the project to the project that includes your container image, and select your container image.
- Enter a Docker container image path. For example,
to use a TensorFlow 2.12 container image with accelerators from
Deep Learning Containers,
enter
Make the rest of your selections, or leave them on their default setting. For more information about these settings, see Create a user-managed notebooks instance with specific properties.
Click Create. Vertex AI Workbench creates a user-managed notebooks instance for you, based on your custom container.
What's next
- Read about how to push container images to Artifact Registry. If the container images you push to Artifact Registry are derived from a Deep Learning Containers image, you can use these container images when creating user-managed notebooks instances.
- Learn more about modifying your custom containers by reading Best practices for writing Dockerfiles.