Create a new notebook instance

An AI Platform Notebooks (JupyterLab) instance is a Deep Learning virtual machine instance with the latest machine learning and data science libraries pre-installed, with the option to include Nvidia GPUs for hardware acceleration.

Before you begin

Follow the steps in Before you begin to create a Google Cloud (Google Cloud) project and enable the AI Platform Notebooks API.

Create an AI Platform Notebooks instance with default properties

To create an AI Platform Notebooks instance with default properties, complete the following steps. To specify properties for your instance, see Create an AI Platform Notebooks instance with specific properties.
  1. Go to the AI Platform Notebooks page in the Google Cloud Console.

    Go to the AI Platform Notebooks page

  2. Click New Instance, select an instance type, and then choose whether to include a GPU.

  3. If you choose to include a GPU, you must select the option to Install NVIDIA GPU driver automatically for me. You can adjust the number of GPUs later if you need to. For information on adjusting the number of GPUs, see Manage hardware accelerators for a notebook.

  4. Click Create.

  5. AI Platform Notebooks creates a new instance based on your selected framework. An Open JupyterLab link becomes active when it's ready to use.

Create an AI Platform Notebooks instance with specific properties

If you prefer to create an instance with properties other than those provided by the default instance types, you can create a new instance and specify your preferred properties.

To create an AI Platform Notebooks instance and specify the properties for your instance, follow these steps:

  1. Go to the AI Platform Notebooks page in the Google Cloud Console.

    Go to the AI Platform Notebooks page

  2. Click New Instance, and then select Customize instance.

    Create new AI Platform Notebooks instance with options

  3. On the New notebook instance page, provide the following information for your new instance:

    • Instance name - provide a name for your new instance.
    • Region - select a region for the new instance. Select the region that is geographically closest to you for best network performance.
    • Zone - select a zone within the region that you selected.
    • Environment - select the environment and operating system that you want to use.
    • Machine type - select the number of CPUs and amount of RAM for your new instance. AI Platform Notebooks provides monthly cost estimates for each machine type that you select.
    • GPUs - select the GPU type and Number of GPUs for your new instance. For information about the different GPUS, see GPUs on Compute Engine.

      Select the option to Install NVIDIA GPU driver automatically for me.

      You can modify the GPU type and number of GPUs for your instance after it is created. For more information, see Manage hardware accelerators for a notebook.

  4. If you want to change the default boot disk settings or encryption settings, expand the Boot disk section and complete the following steps:

    1. Select the Boot disk type and Boot disk size in GB that you want. See Storage options to learn more about disk types.

    2. Under Encryption, select Customer-managed key to use customer-managed encryption. Select the customer-managed key that you want to use, or enter the resource ID for your customer-managed key. The resource ID for your customer-managed key looks like this:

      projects/project-id/locations/global/keyRings/name-of-key-ring/cryptoKeys/name-of-key

      You can retrieve a resource ID by running the following gcloud command in Cloud Shell, or any terminal where Cloud SDK is installed.

      gcloud kms keys list --location global --keyring name-of-key-ring

      If necessary, click Grant to give your service account permissions to encrypt and decrypt using this key.

      Learn about customer-managed encryption keys and how to use customer-managed encryption keys to encrypt specific objects. Then create your own customer-managed encryption key.

  5. If you want to change network settings, such as to select a Virtual Private Cloud, disable proxy access, or disable the external IP address, complete the following steps:

    1. Expand the Networking section.

    2. Select either Networks in this project or Networks shared with me.

    3. On the Network menu, select the network that you want. You can select a VPC network, as long as the network has Private Google Access enabled or can access the internet.

    4. On the Subnetwork menu, select the subnetwork that you want.

    5. If you want to disable the external IP address, set the External IP menu to None.

    6. If you want to disable proxy access, clear the checkbox next to Allow proxy access when it's available.

  6. If you want to grant access to all users who have access to a specific Compute Engine service account or to a specific user, expand the Permission section and complete one of the following steps:

    • To grant access to a specific service account, click the Access to JupyterLab menu, and select Other service account. Then fill out the Service account field. Learn more about service accounts.

    • To grant access to a single user, click the Access to JupyterLab menu, and select Single user only. Then fill out the User email field.

  7. Click Create.

  8. AI Platform Notebooks creates a new instance based on your specified properties. An Open JupyterLab link becomes active when it's ready to use.

Create an AI Platform Notebooks instance from the command line

You can also create an AI Platform Notebooks instance from the command line with the gcloud beta notebooks command.

  1. From Cloud Shell or any terminal where Cloud SDK is installed, first define some environment variables for your new instance. Replace the following with details for the instance you'd like to create. Find the list of available VM image families here.

    export INSTANCE_NAME="example-instance"
    export VM_IMAGE_PROJECT="deeplearning-platform-release"
    export VM_IMAGE_FAMILY="tf2-2-3-cpu"
    export MACHINE_TYPE="n1-standard-4"
    export LOCATION="us-central1-b"
    
  2. To create your instance, run:

    gcloud beta notebooks instances create $INSTANCE_NAME \
      --vm-image-project=$VM_IMAGE_PROJECT \
      --vm-image-family=$VM_IMAGE_FAMILY \
      --machine-type=$MACHINE_TYPE --location=$LOCATION
    
  3. You should now be able to access your instance from the AI Platform Notebooks console.

To see all available commands for creating an instance from the command line, look at the gcloud docs.

Determine who has access to the JupyterLab instance

Unless you granted access to a specific service account or a single user, anyone that has editor permissions to your Google Cloud project can access the notebook.

If you granted access to a specific service account, anyone who has access to that service account can access the JupyterLab instance. Note that you will not have access to the JupyterLab instance unless you also have access to the specified service account.

If you granted access to a single user, that user is the only one who has access to the JupyterLab instance. Note that you will not have access yourself.

Open the notebook

Complete these steps to open a notebook instance:
  1. On the AI Platform Notebooks page in the Google Cloud Console, click Open JupyterLab to open the notebook.

  2. AI Platform Notebooks opens your notebook.

Troubleshooting

If you encounter a problem when you create a notebook, see Troubleshooting notebooks for help with common issues.