Creating a notebook in Vertex AI typically refers to setting up a Vertex AI Workbench instance, which is a powerful environment designed for machine learning development, providing access to JupyterLab notebooks. Once an instance is running, you can then create individual .ipynb
files within it.
Here’s a detailed guide on how to create a Vertex AI Workbench instance, which serves as your primary notebook environment:
How to Create a Notebook in Vertex AI?
To create a new notebook environment in Google Cloud's Vertex AI, you'll provision a Vertex AI Workbench instance. This process involves a few straightforward steps within the Google Cloud console.
What is Vertex AI Workbench?
Vertex AI Workbench is a fully managed, enterprise-ready environment for data scientists and machine learning engineers. It integrates deeply with other Vertex AI services, allowing you to develop, run, and manage your machine learning workflows efficiently using Jupyter notebooks.
Step-by-Step Guide to Creating a Vertex AI Workbench Instance
Follow these steps to set up your Vertex AI Workbench instance:
-
Open Your Google Cloud Project
- Navigate to the Google Cloud console and ensure you've selected the correct Google Cloud project where you want to create your notebook instance. If it's not already open, select your project from the project selector dropdown at the top of the console.
-
Go to Vertex AI Workbench Instances Page
- From the Google Cloud console's navigation menu (usually on the left), select Vertex AI > Workbench. This will take you directly to the Vertex AI Workbench Instances page.
-
Enable the Notebooks API (If Prompted)
- If you are creating an instance for the first time in your project, or if the API is not yet enabled, you might see a prompt to enable the Notebooks API. Click Enable to proceed. This API is essential for managing your Vertex AI Workbench instances.
-
Initiate New Instance Creation
- On the Vertex AI Workbench Instances page, locate and click the add_box Create new button. This action will open the "Create instance" page, where you'll configure your new notebook environment.
-
Configure Your Notebook Instance
-
On the "Create instance" page, you'll need to provide various details for your instance. These settings dictate the computing power, software environment, and security of your notebook.
-
Name: Give your instance a unique, descriptive name.
-
Region: Select the Google Cloud region closest to you or your data for optimal performance.
-
Environment: Choose the software environment for your notebook. Common options include:
- TensorFlow: For machine learning tasks using TensorFlow.
- PyTorch: For deep learning with PyTorch.
- Vanilla Debian: A general-purpose environment.
- Custom container: If you have a specific Docker container image you want to use.
-
Machine type: Select the appropriate CPU and RAM configuration based on your workload. For simple tasks, a
n1-standard-1
ore2-standard-2
might suffice. For intensive tasks, consider machine types with more vCPUs and memory. -
GPU: Optionally, add one or more GPUs if your machine learning models require accelerated computing.
-
Disk: Configure the boot disk type (standard or SSD) and size. You might also add a data disk for persistent storage.
-
Networking: Specify the network and subnetwork if you have particular networking requirements.
-
IAM Permissions: Ensure the service account associated with the instance has the necessary permissions to access other Google Cloud services (e.g., Cloud Storage, BigQuery).
-
-
Create and Launch
- After configuring all the necessary settings, click the Create button.
- The instance will begin provisioning, which might take a few minutes. Once it's ready, its status will change to "Running," and you'll see an Open JupyterLab link next to its name.
- Click Open JupyterLab to launch your new notebook environment and start coding!
Creating a New Notebook (.ipynb) File within JupyterLab
Once your Vertex AI Workbench instance is running and you've opened JupyterLab:
- Navigate to the File Menu: In the JupyterLab interface, look for the "File" menu at the top left.
- Select "New" > "Notebook": From the dropdown, choose New > Notebook.
- Choose a Kernel: A dialog box will appear asking you to "Select Kernel." Choose the appropriate kernel for your work (e.g., Python 3).
- Start Coding: A new, untitled notebook (
.ipynb
file) will open, ready for you to write and execute your code cells. Remember to save your notebook frequently.
Key Considerations for Notebook Creation
- Cost Management: Vertex AI Workbench instances incur costs based on their machine type, GPU usage, and disk storage. Remember to stop or delete instances when not in use to manage costs.
- Security: Ensure your instance's service account has the principle of least privilege – only grant the necessary permissions.
- Version Control: Integrate your notebooks with Git or other version control systems for collaborative development and tracking changes.
- Data Access: Plan how your notebook will access data stored in Google Cloud Storage, BigQuery, or other sources.
By following these steps, you can effectively create and manage your notebook environments within Vertex AI, enabling you to accelerate your machine learning development.