使用第三方憑證建立執行個體

本頁說明如何使用第三方憑證,建立 Gemini Enterprise Agent Platform Workbench 執行個體。

總覽

您可以使用員工身分聯盟提供的第三方憑證,建立及管理 Gemini Enterprise Agent Platform Workbench 執行個體。員工身分聯盟會使用外部身分識別資訊提供者 (IdP),透過 Proxy 授予一組使用者 Agent Platform Workbench 執行個體的存取權。

如要授予 Agent Platform Workbench 執行個體的存取權,請將工作團隊集區主體指派給 Agent Platform Workbench 執行個體的服務帳戶。

事前準備

  1. 登入 Google Cloud 帳戶。如果您未曾使用過 Google Cloud,歡迎建立帳戶,親自體驗實際使用我們產品的成效。新客戶還能獲得價值 $300 美元的免費抵免額,用於執行、測試及部署工作負載。
  2. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Notebooks API, if it is not already enabled.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. 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.

    Enable the API

  5. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. Enable the Notebooks API, if it is not already enabled.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. 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.

    Enable the API

  8. 使用員工身分集區設定 IdP。

建立執行個體所需的角色

為確保工作團隊集區主體具備建立 Agent Platform Workbench 執行個體的必要權限,請要求管理員將專案的 Notebooks 管理員 (roles/notebooks.admin) IAM 角色授予工作團隊集區主體。如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和組織的存取權」。

管理員或許也能透過自訂角色或其他預先定義的角色,將必要權限授予工作團隊集區主體。

使用第三方憑證所需的角色

工作團隊集區主體必須具備特定權限,才能存取 Agent Platform Workbench 執行個體的服務帳戶。

為確保員工集區主體具備必要權限,能使用具備第三方憑證的 Agent Platform Workbench 執行個體,請要求管理員將下列 IAM 角色授予您建立執行個體時指定的服務帳戶上的員工集區主體:

如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和組織的存取權」。

管理員或許也能透過自訂角色或其他預先定義的角色,將必要權限授予工作團隊集區主體。

使用第三方憑證建立執行個體

為確保 Agent Platform Workbench 執行個體包含 byoid.googleusercontent.com 網域,請務必執行下列任一操作:

  • 使用 Google Cloud員工身分聯盟控制台建立執行個體。

  • 建立執行個體時,請使用 enable_third_party_identity 旗標。

您可以使用Google Cloud 控制台或 gcloud CLI,透過第三方憑證建立 Gemini Enterprise Agent Platform Workbench:

控制台

  1. 使用工作團隊集區提供者登入 Google Cloud 控制台。

    前往控制台

  2. 前往 Google Cloud 控制台的「Instances」(執行個體) 頁面。

    前往「Instances」(執行個體) 頁面

  3. 按一下「 建立新項目」。

  4. 在「New instance」對話方塊中,按一下「Advanced options」。

  5. 在「Create instance」(建立執行個體) 對話方塊的「IAM and security」(IAM 與安全性) 部分,執行下列操作:

    1. 確認已選取「服務帳戶」。

    2. 清除「Use default Compute Engine service account」(使用預設 Compute Engine 服務帳戶),然後在「Service account email」(服務帳戶電子郵件) 欄位中,輸入與工作團隊主體相關聯的服務帳戶電子郵件地址。

  6. 點選「建立」。

    Agent Platform Workbench 會建立執行個體,並自動啟動。執行個體可供使用時,Agent Platform Workbench 會啟用「Open JupyterLab」(開啟 JupyterLab) 連結。

gcloud

請按照 IAM 指南,使用員工身分集區驗證 gcloud CLI。

使用下列任何指令資料前,請先替換以下項目:

  • INSTANCE_NAME:Agent Platform Workbench 執行個體的名稱,開頭須為英文字母,後面最多可接 62 個小寫英文字母、數字或連字號 (-),但結尾不得為連字號
  • PROJECT_ID:專案 ID
  • LOCATION:執行個體所在的可用區
  • VM_IMAGE_PROJECT:VM 映像檔所屬 Google Cloud 專案的 ID,格式為:projects/IMAGE_PROJECT_ID
  • VM_IMAGE_NAME:完整映像檔名稱;如要查看特定版本的映像檔名稱,請參閱「尋找特定版本」
  • MACHINE_TYPE:執行個體 VM 的機型
  • METADATA:要套用至這個執行個體的自訂中繼資料。舉例來說,如要指定開機後指令碼,可以使用 post-startup-script 中繼資料標記,格式如下:"--metadata=post-startup-script=gs://BUCKET_NAME/hello.sh"
  • SERVICE_ACCOUNT_EMAIL:與工作團隊主體相關聯的服務帳戶電子郵件地址

執行下列指令:

Linux、macOS 或 Cloud Shell

gcloud workbench instances create INSTANCE_NAME \
    --project=PROJECT_ID \
    --location=LOCATION \
    --vm-image-project=VM_IMAGE_PROJECT \
    --vm-image-name=VM_IMAGE_NAME \
    --machine-type=MACHINE_TYPE \
    --metadata=METADATA \
    --service-account-email=SERVICE_ACCOUNT_EMAIL \
    --enable-third-party-identity 

Windows (PowerShell)

gcloud workbench instances create INSTANCE_NAME `
    --project=PROJECT_ID `
    --location=LOCATION `
    --vm-image-project=VM_IMAGE_PROJECT `
    --vm-image-name=VM_IMAGE_NAME `
    --machine-type=MACHINE_TYPE `
    --metadata=METADATA `
    --service-account-email=SERVICE_ACCOUNT_EMAIL `
    --enable-third-party-identity 

Windows (cmd.exe)

gcloud workbench instances create INSTANCE_NAME ^
    --project=PROJECT_ID ^
    --location=LOCATION ^
    --vm-image-project=VM_IMAGE_PROJECT ^
    --vm-image-name=VM_IMAGE_NAME ^
    --machine-type=MACHINE_TYPE ^
    --metadata=METADATA ^
    --service-account-email=SERVICE_ACCOUNT_EMAIL ^
    --enable-third-party-identity 

如要進一步瞭解如何透過指令列建立執行個體,請參閱 gcloud CLI 說明文件。

Agent Platform Workbench 會建立執行個體,並自動啟動。執行個體可供使用時,Agent Platform Workbench 會在 Google Cloud 控制台啟用「Open JupyterLab」(開啟 JupyterLab) 連結。

使用第三方憑證存取 JupyterLab

新的 Gemini Enterprise Agent Platform Workbench 執行個體會建立兩個獨立的 Proxy 網址,網域如下:

  • byoid.googleusercontent.com:這個網域僅供透過員工身分集區驗證的使用者使用。這個值會儲存在執行個體的中繼資料欄位 proxy-byoid-url。這個中繼資料值會在 Google Cloud員工身分聯盟控制台 (console.cloud.google/) 中啟用「Open JupyterLab」連結。

  • googleusercontent.com:這個網域僅供使用預設 Google 第一方驗證進行驗證的使用者使用。其值會儲存在執行個體的中繼資料欄位 proxy-url。這項中繼資料值會啟用Google Cloud 控制台 (console.cloud.google.com) 中的「Open JupyterLab」(開啟 JupyterLab) 連結。

後續步驟

  • 如要進一步瞭解用於佈建筆記本的第三方主體,請參閱「員工身分聯盟」。