Mengelola runtime

Halaman ini menjelaskan cara mengelola runtime Colab Enterprise, termasuk tugas berikut:

  • Mulai runtime.
  • Menghentikan runtime.
  • Memutuskan koneksi dari runtime.
  • Hubungkan kembali ke runtime.
  • Ubah runtime yang terhubung ke Anda.
  • Menghapus runtime.

Peran yang diperlukan

Untuk mendapatkan izin yang Anda perlukan untuk mengelola runtime Colab Enterprise, minta administrator untuk memberi Anda peran IAM Colab Enterprise User (roles/aiplatform.colabEnterpriseUser) di project. Untuk mengetahui informasi selengkapnya tentang cara memberikan peran, lihat Mengelola akses ke project, folder, dan organisasi.

Anda mungkin juga bisa mendapatkan izin yang diperlukan melalui peran khusus atau peran bawaan lainnya.

Memulai runtime

Untuk memulai runtime, Anda dapat menggunakan Google Cloud konsol, gcloud CLI, atau REST API.

Konsol

Untuk memulai runtime:

  1. Di Google Cloud console, buka halaman Runtimes Colab Enterprise.

    Buka Runtime

  2. Di menu Region, pilih region yang berisi runtime Anda.

  3. Pilih runtime yang ingin Anda mulai.

  4. Klik Mulai.

gcloud

Sebelum menggunakan salah satu data perintah di bawah, lakukan penggantian berikut:

  • RUNTIME_ID: ID runtime Anda.
  • PROJECT_ID: project ID Anda.
  • REGION: region tempat runtime Anda berada.

Jalankan perintah berikut:

Linux, macOS, atau Cloud Shell

gcloud colab runtimes start RUNTIME_ID \
    --project=PROJECT_ID \
    --region=REGION

Windows (PowerShell)

gcloud colab runtimes start RUNTIME_ID `
    --project=PROJECT_ID `
    --region=REGION

Windows (cmd.exe)

gcloud colab runtimes start RUNTIME_ID ^
    --project=PROJECT_ID ^
    --region=REGION

Untuk mengetahui informasi selengkapnya tentang perintah untuk membuat template runtime dari command line, lihat dokumentasi gcloud CLI.

REST

Sebelum menggunakan salah satu data permintaan, lakukan penggantian berikut:

  • REGION: region tempat runtime Anda berada.
  • PROJECT_ID: project ID Anda.
  • RUNTIME_ID: ID runtime Anda.

Metode HTTP dan URL:

POST https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/notebookRuntimes/RUNTIME_ID:start

Untuk mengirim permintaan Anda, pilih salah satu opsi berikut:

curl

Jalankan perintah berikut:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d "" \
"https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/notebookRuntimes/RUNTIME_ID:start"

PowerShell

Jalankan perintah berikut:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-Uri "https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/notebookRuntimes/RUNTIME_ID:start" | Select-Object -Expand Content
Jika berhasil, isi respons akan berisi instance Operation.

Untuk informasi selengkapnya, lihat dokumentasi notebookRuntimes.start REST API.

Menghentikan runtime

Untuk menghentikan runtime, Anda dapat menggunakan gcloud CLI atau REST API.

gcloud

Sebelum menggunakan salah satu data perintah di bawah, lakukan penggantian berikut:

  • RUNTIME_ID: ID runtime Anda.
  • PROJECT_ID: project ID Anda.
  • REGION: region tempat runtime Anda berada.

Jalankan perintah berikut:

Linux, macOS, atau Cloud Shell

gcloud colab runtimes stop RUNTIME_ID \
    --project=PROJECT_ID \
    --region=REGION

Windows (PowerShell)

gcloud colab runtimes stop RUNTIME_ID `
    --project=PROJECT_ID `
    --region=REGION

Windows (cmd.exe)

gcloud colab runtimes stop RUNTIME_ID ^
    --project=PROJECT_ID ^
    --region=REGION

Untuk mengetahui informasi selengkapnya tentang perintah untuk menghentikan runtime dari command line, lihat dokumentasi gcloud CLI.

REST

Sebelum menggunakan salah satu data permintaan, lakukan penggantian berikut:

  • REGION: region tempat runtime Anda berada.
  • PROJECT_ID: project ID Anda.
  • RUNTIME_ID: ID runtime Anda.

Metode HTTP dan URL:

POST https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/notebookRuntimes/RUNTIME_ID:start

Untuk mengirim permintaan Anda, pilih salah satu opsi berikut:

curl

Jalankan perintah berikut:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d "" \
"https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/notebookRuntimes/RUNTIME_ID:start"

PowerShell

Jalankan perintah berikut:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-Uri "https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/notebookRuntimes/RUNTIME_ID:start" | Select-Object -Expand Content
Jika berhasil, isi respons akan berisi instance Operation.

Untuk informasi selengkapnya, lihat dokumentasi notebookRuntimes.stop REST API.

Memutuskan koneksi dari runtime

Untuk memutuskan koneksi dari runtime:

  1. Di Google Cloud console, buka halaman Notebook saya Colab Enterprise.

    Buka Notebook saya

  2. Di menu Region, pilih region yang berisi notebook Anda.

  3. Buka notebook yang ingin Anda putuskan hubungannya dari runtime.

  4. Di toolbar header, klik Runtime > Kelola sesi. Jika Anda tidak melihat toolbar header, klik  Alihkan visibilitas header.

  5. Di panel Sesi aktif, klik tombol  Akhiri sesi.

  6. Klik Hentikan.

Menghubungkan kembali ke runtime

Untuk menghubungkan kembali ke runtime:

  1. Di Google Cloud console, buka halaman Notebook saya Colab Enterprise.

    Buka Notebook saya

  2. Di menu Region, pilih region yang berisi notebook Anda.

  3. Buka notebook yang baru-baru ini terputus dari runtime.

  4. Di sudut kanan atas notebook, klik Hubungkan kembali.

    Jika runtime yang sebelumnya terhubung ke notebook masih berjalan, Colab Enterprise akan terhubung ke runtime tersebut. Jika runtime tersebut tidak lagi berjalan, runtime akan terhubung ke runtime default.

Mengubah runtime

Untuk mengubah runtime yang terhubung:

  1. Di Google Cloud console, buka halaman Notebook saya Colab Enterprise.

    Buka Notebook saya

  2. Di menu Region, pilih region yang berisi notebook Anda.

  3. Buka notebook yang terhubung ke runtime.

  4. Di pojok kanan atas notebook, klik  Opsi koneksi tambahan > Ubah jenis runtime.

  5. Selesaikan dialog untuk menghubungkan ke runtime.

Menghapus runtime

Untuk menghapus runtime, Anda dapat menggunakan konsol Google Cloud , gcloud CLI, atau REST API.

Konsol

Untuk menghapus runtime:

  1. Di Google Cloud console, buka halaman Runtimes Colab Enterprise.

    Buka Runtime

  2. Di menu Region, pilih region yang berisi runtime Anda.

  3. Pilih runtime yang ingin dihapus.

  4. Klik  Delete.

  5. Klik Konfirmasi.

gcloud

Sebelum menggunakan salah satu data perintah di bawah, lakukan penggantian berikut:

  • RUNTIME_ID: ID runtime Anda.
  • PROJECT_ID: project ID Anda.
  • REGION: region tempat runtime Anda berada.

Jalankan perintah berikut:

Linux, macOS, atau Cloud Shell

gcloud colab runtimes delete RUNTIME_ID \
    --project=PROJECT_ID \
    --region=REGION

Windows (PowerShell)

gcloud colab runtimes delete RUNTIME_ID `
    --project=PROJECT_ID `
    --region=REGION

Windows (cmd.exe)

gcloud colab runtimes delete RUNTIME_ID ^
    --project=PROJECT_ID ^
    --region=REGION

Untuk mengetahui informasi selengkapnya tentang perintah untuk membuat template runtime dari command line, lihat dokumentasi gcloud CLI.

REST

Sebelum menggunakan salah satu data permintaan, lakukan penggantian berikut:

  • REGION: region tempat runtime Anda berada.
  • PROJECT_ID: project ID Anda.
  • RUNTIME_ID: ID runtime Anda.

Metode HTTP dan URL:

DELETE https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/notebookRuntimes/RUNTIME_ID

Untuk mengirim permintaan Anda, pilih salah satu opsi berikut:

curl

Jalankan perintah berikut:

curl -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/notebookRuntimes/RUNTIME_ID"

PowerShell

Jalankan perintah berikut:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method DELETE `
-Headers $headers `
-Uri "https://REGION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/notebookRuntimes/RUNTIME_ID" | Select-Object -Expand Content
Jika berhasil, isi respons akan berisi instance Operation.

Untuk informasi selengkapnya, lihat dokumentasi notebookRuntimes.delete REST API.

Langkah berikutnya