建立特定版本的由使用者管理的筆記本執行個體
本頁說明如何根據特定深度學習 VM 映像檔版本建立由使用者管理的筆記本執行個體。
為什麼要建立特定版本
為確保使用者管理的 Notebook 執行個體具備與程式碼或應用程式相容的軟體,您可能需要建立特定版本。
由使用者管理的筆記本執行個體是使用深度學習 VM 映像檔建立而成。深度學習 VM 映像檔會經常更新,預先安裝的軟體和套件版本也會因版本而異。
如要進一步瞭解特定深度學習 VM 版本,請參閱深度學習 VM 版本資訊。
建立特定版本的由使用者管理的筆記本執行個體後,即可升級。升級執行個體會更新預先安裝的軟體和套件。詳情請參閱「升級使用者自行管理的筆記本執行個體環境」。
事前準備
如要建立由使用者管理的筆記本執行個體,您必須先擁有Google Cloud 專案,並為該專案啟用 Notebooks API。- 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. Roles required to select or create a project - Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
- 
      Create a project: To create a project, you need the Project Creator
      (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
 
- 
  
    Verify that billing is enabled for your Google Cloud project. 
- 
  
  
    
      Enable the Notebooks API. Roles required to enable APIs To enable APIs, you need the Service Usage Admin IAM role ( roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.
- 
    
    
      In the Google Cloud console, on the project selector page, select or create a Google Cloud project. Roles required to select or create a project - Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
- 
      Create a project: To create a project, you need the Project Creator
      (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
 
- 
  
    Verify that billing is enabled for your Google Cloud project. 
- 
  
  
    
      Enable the Notebooks API. Roles required to enable APIs To enable APIs, you need the Service Usage Admin IAM role ( roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.
- 如果您打算搭配 GPU 使用使用者管理的 Notebook 執行個體,請查看 Google Cloud Google Cloud 控制台中的配額頁面,確保專案有足夠的 GPU。如果配額頁面未列出 GPU,或您需要額外的 GPU 配額,請要求增加配額。請參閱 Compute Engine 資源配額頁面的「要求提高配額」一節。
- 
  
  筆記本管理員 (roles/notebooks.admin)
- 
  
  服務帳戶使用者 (roles/iam.serviceAccountUser)
- 找出要取得映像檔名稱的深度學習 VM 版本號碼。版本號碼會列在深度學習 VM 版本資訊中。 發行號碼的格式為 - M,後面接著發行號碼,例如- M79。
- 如要列出特定深度學習 VM 版本的映像檔名稱,請執行下列指令。 - gcloud compute images list --project="deeplearning-platform-release" \ --format="value(name)" \ --filter="labels.release=RELEASE_NUMBER" \ --show-deprecated - 將 - RELEASE_NUMBER替換為深度學習 VM 版本號碼,例如- M79。
- 找出要使用的圖片名稱。 
- 執行下列 - gcloud notebooks指令:- gcloud notebooks instances create INSTANCE_NAME \ --vm-image-project="deeplearning-platform-release" \ --vm-image-name=VM_IMAGE_NAME \ --machine-type=MACHINE_TYPE \ --location=LOCATION - 更改下列內容: 
- 從Google Cloud 控制台存取執行個體。 
- 進一步瞭解如何升級使用者管理的筆記本執行個體,確保執行個體只會在您準備就緒時升級。 
- 在新建立的由使用者管理的筆記本執行個體上安裝依附元件。 
- 如要進一步瞭解深度學習 VM 執行個體,請參閱深度學習 VM 說明文件。 
- 瞭解如何監控使用者自行管理的筆記本執行個體健康狀態。 
必要的角色
如果您建立了專案,您在專案中就擁有「擁有者」(roles/owner) IAM 角色,略過本節,直接建立由使用者管理的筆記本執行個體。如果您不是專案建立者,請繼續閱讀本節內容。
如要取得建立 Vertex AI Workbench 使用者管理筆記本執行個體所需的權限,請要求管理員授予您專案的下列 IAM 角色:
如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和機構的存取權」。
找出所需版本
如要根據特定深度學習 VM 版本建立使用者管理的筆記本執行個體,您必須知道要使用的特定深度學習 VM 版本映像檔名稱。
每個深度學習 VM 版本都包含許多不同映像檔的更新,且版本中的每個映像檔都有自己的映像檔名稱。
如要找出所需圖片的名稱,請按照下列步驟操作:
透過指令列建立特定版本
如要透過指令列建立特定版本的使用者管理型 Notebooks 執行個體,請完成下列步驟: