本頁面說明如何將 Cloud Storage bucket 掛接至 Gemini Enterprise Agent Platform Workbench 執行個體的 JupyterLab 介面,以便瀏覽儲存在 Cloud Storage 的檔案。您也可以開啟及編輯與 JupyterLab 相容的檔案,例如文字檔和筆記本 (IPYNB) 檔案。
總覽
Agent Platform Workbench 執行個體包含 Cloud Storage 整合功能,可讓您掛接 Cloud Storage bucket。也就是說,您可以在 JupyterLab 介面中瀏覽 bucket 內容,並使用相容的檔案。
在與 Agent Platform Workbench 執行個體相同的專案中,您可以存取執行個體有權存取的任何 Cloud Storage bucket 和檔案。
事前準備
- 登入 Google Cloud 帳戶。如果您未曾使用過 Google Cloud,歡迎建立帳戶,親自體驗實際使用我們產品的成效。新客戶還能獲得價值 $300 美元的免費抵免額,用於執行、測試及部署工作負載。
-
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 role
(
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, if it is not already enabled.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). 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 role
(
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, if it is not already enabled.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.
必要的角色
如要取得將 Cloud Storage bucket 掛接至 Agent Platform Workbench 執行個體所需的權限,請要求管理員授予您下列 IAM 角色:
- 專案的 Notebooks 執行者 (
roles/notebooks.runner) - Agent Platform Workbench 執行個體服務帳戶的 Storage 物件使用者 (
roles/storage.objectUser)
如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和組織的存取權」。
啟用共用儲存空間掛接所需的權限
如要在 Agent Platform Workbench 執行個體中啟用共用儲存空間掛接功能,請要求管理員將專案的 storage.buckets.list 權限授予 Agent Platform Workbench 執行個體的服務帳戶。
您必須具備 storage.buckets.list 權限,Agent Platform Workbench 執行個體的 JupyterLab 介面才會顯示「Mount shared storage」(掛接共用儲存空間) 按鈕。
建立 bucket 和 Agent Platform Workbench 執行個體
您必須有權存取至少一個 Cloud Storage bucket,且該 bucket 須與 Agent Platform Workbench 執行個體位於相同專案。- 如要建立 Cloud Storage bucket,請參閱「建立 bucket」。
- 如果尚未建立,請在 Cloud Storage bucket 所在的專案中,建立 Agent Platform Workbench 執行個體。
開啟 JupyterLab
-
前往 Google Cloud 控制台的「Instances」(執行個體) 頁面。
-
按一下 Agent Platform Workbench 執行個體名稱旁的「Open JupyterLab」(開啟 JupyterLab)。
Agent Platform Workbench 執行個體會開啟 JupyterLab。
掛接 Cloud Storage bucket
如要掛接並存取 Cloud Storage bucket,請按照下列步驟操作:
-
在 JupyterLab 中,確認已選取 「File Browser」(檔案瀏覽器) 分頁標籤。
-
按一下左側欄中的 「Mount shared storage」(掛接共用儲存空間) 按鈕。如果沒有看到這個按鈕,請拖曳側欄右側,展開側欄,直到看到按鈕為止。
-
在「Bucket name」(Bucket 名稱) 欄位中,輸入要掛接的 Cloud Storage bucket 名稱。
-
點選「Mount」。
-
Cloud Storage bucket 會顯示為左側側欄「File browser」(檔案瀏覽器) 分頁中的資料夾。按兩下資料夾即可開啟並瀏覽內容。
疑難排解
如要瞭解如何診斷及解決將 Cloud Storage bucket 掛接至執行個體的問題,請參閱「排解 Agent Platform Workbench 問題」。
後續步驟
進一步瞭解 Cloud Storage。