使用 Google Cloud 控制台建立 Colab Enterprise 筆記本

瞭解如何使用 Google Cloud 控制台建立 Colab Enterprise 筆記本,並在預設執行階段中執行筆記本內含的程式碼。本頁面也會說明如何重新命名、匯入及刪除筆記本。

事前準備

  1. 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.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. Enable the Vertex AI, Dataform, and Compute Engine APIs.

    Enable the APIs

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Make sure that billing is enabled for your Google Cloud project.

  7. Enable the Vertex AI, Dataform, and Compute Engine APIs.

    Enable the APIs

  8. 必要的角色

    如要取得建立 Colab Enterprise 筆記本並在執行階段執行該筆記本程式碼所需的權限,請要求管理員授予您專案的「Colab Enterprise 使用者」(roles/aiplatform.colabEnterpriseUser) IAM 角色。如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和機構的存取權」。

    您或許還可透過自訂角色或其他預先定義的角色取得必要權限。

建立筆記本

如要透過 Google Cloud 控制台建立 Colab Enterprise 筆記本,請按照下列步驟操作:
  1. 在 Google Cloud 控制台中,前往 Colab Enterprise 的「My notebooks」頁面。

    前往「我的筆記本」

  2. 在「Region」選單中,選取要建立筆記本的區域。

  3. 按一下 「New notebook」

    Vertex AI 會建立並開啟筆記本。

完成本文件所述工作後,您可以刪除已建立的資源,避免繼續計費。詳情請參閱「清除所用資源」。

在預設執行階段中執行程式碼

如要在預設執行階段執行 Colab Enterprise 筆記本的程式碼,請執行下列操作:

  1. 在 Google Cloud 控制台中,前往 Colab Enterprise 的「My notebooks」頁面。

    前往「我的筆記本」

  2. 在「Region」選單中,選取含有筆記本的區域。

  3. 按一下要開啟的筆記本。

  4. 將滑鼠游標懸停在要執行的程式碼儲存格上,然後按一下 「Run cell」(執行儲存格) 按鈕。

  5. 如果這是您第一次連結啟用最終使用者憑證的執行階段,系統會顯示「Sign in」對話方塊。

    如要授予 Colab Enterprise 存取使用者憑證的權限,請完成下列步驟:

    1. 在「登入」對話方塊中,按一下您的使用者帳戶。

    2. 選取「查看、編輯、設定及刪除您的 Google Cloud 資料...」,即可授予 Colab Enterprise 存取您的使用者憑證。

      核取方塊位於「查看、編輯、設定及刪除您的 Google Cloud 資料,以及查看您 Google 帳戶的電子郵件地址」旁。
    3. 按一下「繼續」

執行階段啟動後,Colab Enterprise 會連線至執行階段,並執行儲存格中的程式碼。

重新命名筆記本

如要重新命名 Colab Enterprise 筆記本,請按照下列步驟操作:
  1. 在 Google Cloud 控制台中,前往 Colab Enterprise 的「My notebooks」頁面。

    前往「我的筆記本」

  2. 在「Region」選單中,選取含有筆記本的區域。

  3. 在要重新命名的筆記本旁,按一下 「Actions」選單,然後選取「Rename」

  4. 在「Rename notebook」對話方塊中變更筆記本名稱,然後按一下「Rename」

匯入筆記本

如要將筆記本匯入 Colab Enterprise,請按照下列步驟操作:
  1. 在 Google Cloud 控制台中,前往 Colab Enterprise 的「My notebooks」頁面。

    前往「我的筆記本」

  2. 在「Region」選單中,選取要匯入筆記本的區域。

  3. 按一下 「匯入」

  4. 在「Import notebooks」對話方塊中,選取「Import source」

  5. 如果您選取了:

    • 電腦:前往電腦並選取要匯入的 Notebook 檔案。
    • Cloud Storage,前往 Cloud Storage 並選取一個 Notebook。
    • 網址:輸入要匯入的 Notebook 檔案網址。
  6. 如要新增其他筆記本,請按一下 「新增筆記本」

  7. 新增要匯入的筆記後,請按一下「Import」

    Colab Enterprise 會匯入筆記本檔案。

清除所用資源

如要避免系統向您的 Google Cloud 帳戶收取您在本頁所用資源的費用,請按照下列步驟操作。

如要避免系統向您的 Google Cloud 帳戶收取本教學課程所用資源的費用,請刪除含有相關資源的專案,或者保留專案但刪除個別資源。

刪除專案

  1. In the Google Cloud console, go to the Manage resources page.

    Go to Manage resources

  2. In the project list, select the project that you want to delete, and then click Delete.
  3. In the dialog, type the project ID, and then click Shut down to delete the project.

刪除筆記本

如要刪除 Colab Enterprise 筆記本,請按照下列步驟操作:
  1. 在 Google Cloud 控制台中,前往 Colab Enterprise 的「My notebooks」頁面。

    前往「我的筆記本」

  2. 在「Region」選單中,選取含有要刪除的筆記本的區域。

  3. 在要刪除的筆記本旁,按一下 「Actions」選單,然後選取 「Delete notebook」

  4. 在「Delete notebook」對話方塊中,按一下「Confirm」

後續步驟