Manage Colab Enterprise runtime templates

Manage runtime templates

This page describes how to manage a Colab Enterprise runtime template, including the following tasks:

  • Edit a runtime template.
  • Delete a runtime template.

Required roles

To get the permissions that you need to manage a Colab Enterprise runtime template, ask your administrator to grant you the Colab Enterprise Admin ( roles/aiplatform.colabEnterpriseAdmin ) IAM role on the project. For more information about granting roles, see Manage access to projects, folders, and organizations .

You might also be able to get the required permissions through custom roles or other predefined roles .

Edit a runtime template

You can make changes to some of the specifications of your runtime template, including the Python version and encryption key configuration. Any changes made to the runtime template only apply to newly-created runtimes made from this template.

To edit a runtime template, you can use the Google Cloud console or the REST API.

Console

To edit a runtime template, do the following:

  1. In the Google Cloud console, go to the Colab Enterprise Runtime templatespage.

    Go to Runtime templates

  2. In the Region menu, select the region that contains your runtime template.

  3. In the ID column, click the ID number of the runtime template that you want to edit.

  4. Click Edit .

  5. In the Edit runtime template panel, make changes to the runtime template.

  6. Click Update .

REST

Before using any of the request data, make the following replacements:

  • REGION : the region where your runtime template is located.
  • PROJECT_ID : your project ID.
  • NOTEBOOK_RUNTIME_TEMPLATE_ID : the ID of your runtime template.
  • RELEASE_NAME : the release name of the image that you want to use. For example, py311 is the release name for the Python 3.11 image. To set the image to Latest , leave RELEASE_NAME empty.

HTTP method and URL:

PATCH https:// REGION 
-aiplatform.googleapis.com/v1/projects/ PROJECT_ID 
/locations/ REGION 
/notebookRuntimeTemplates/ NOTEBOOK_RUNTIME_TEMPLATE_ID 
?updateMask=software_config.colab_image.release_name

Request JSON body:

{
  softwareConfig: {
    colabImage: {
      releaseName: " RELEASE_NAME 
"
    }
  }
}

To send your request, choose one of these options:

curl

Save the request body in a file named request.json , and execute the following command:

curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https:// REGION -aiplatform.googleapis.com/v1/projects/ PROJECT_ID /locations/ REGION /notebookRuntimeTemplates/ NOTEBOOK_RUNTIME_TEMPLATE_ID ?updateMask=software_config.colab_image.release_name"

PowerShell

Save the request body in a file named request.json , and execute the following command:

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

Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https:// REGION -aiplatform.googleapis.com/v1/projects/ PROJECT_ID /locations/ REGION /notebookRuntimeTemplates/ NOTEBOOK_RUNTIME_TEMPLATE_ID ?updateMask=software_config.colab_image.release_name" | Select-Object -Expand Content
If successful, the response body contains an instance of Operation .

For information about available query parameters, see the notebookRuntimeTemplates.patch REST API documentation .

Delete a runtime template

To delete a runtime template, you can use the Google Cloud console, the gcloud CLI, or the REST API.

Console

To delete a runtime template, do the following:

  1. In the Google Cloud console, go to the Colab Enterprise Runtime templatespage.

    Go to Runtime templates

  2. In the Regionmenu, select the region that contains your runtime template.

  3. Select the runtime template that you want to delete.

  4. Click Delete.

  5. Click Confirm.

gcloud

Before using any of the command data below, make the following replacements:

  • RUNTIME_ID : the ID of your runtime.
  • PROJECT_ID : your project ID.
  • REGION : the region where your runtime is located.

Execute the following command:

Linux, macOS, or 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 

For more information about the command for deleting a runtime template from the command line, see the gcloud CLI documentation .

REST

Before using any of the request data, make the following replacements:

  • REGION : the region where your runtime is located.
  • PROJECT_ID : your project ID.
  • RUNTIME_ID : the ID of your runtime.

HTTP method and URL:

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

To send your request, choose one of these options:

curl

Execute the following command:

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

Execute the following command:

$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
If successful, the response body contains an instance of Operation .

For more information, see the notebookRuntimeTemplates.delete REST API documentation .

What's next

Create a Mobile Website
View Site in Mobile | Classic
Share by: