Schedule a notebook run
This page shows you how to schedule a notebook run in Colab Enterprise.
Overview
You can schedule a notebook to run immediately one time, or on a recurring schedule.
When you schedule the notebook run, you select a runtime template. Colab Enterprise uses this runtime template to create the runtime that runs your notebook.
The runtime needs specific permissions to run the notebook's code and access Google Cloud services and APIs.
If your runtime template configuration has end-user credentials enabled, then the runtime uses the permissions associated with your user credentials.
If end-user credentials aren't enabled, you must specify a service account when you schedule the notebook run. Colab Enterprise uses this service account's credentials to run your notebook.
For more information, see Required roles for running the notebook.
After Colab Enterprise completes the notebook run, the results are stored in a shareable Cloud Storage bucket.
Limitations
Colab Enterprise runtimes use Compute Engine quota. See the Compute Engine Allocation quotas page.
Before you begin
- 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.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Vertex AI, Dataform, and Compute Engine APIs.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Vertex AI, Dataform, and Compute Engine APIs.
Required roles for scheduling the notebook run
To ensure that your user account has the necessary permissions to schedule a notebook run in Colab Enterprise, ask your administrator to grant your user account the following IAM roles on the project:
-
Colab Enterprise User (
roles/aiplatform.colabEnterpriseUser
) -
Storage Admin (
roles/storage.admin
)
For more information about granting roles, see Manage access.
Your administrator might also be able to give your user account the required permissions through custom roles or other predefined roles.
Required roles for running the notebook
The principal that runs the notebook needs specific permissions. The principal is either your user account or a service account that you specify, as described in the overview.
To ensure that the principal has the necessary permissions to run a notebook in Colab Enterprise, ask your administrator to grant the principal the following IAM roles:
-
Code Viewer (
roles/dataform.codeViewer
) on the notebook -
Logs Writer (
roles/logging.logWriter
) on the project -
Monitoring Metric Writer (
roles/monitoring.metricWriter
) on the project -
Storage Legacy Bucket Writer (
roles/storage.legacyBucketWriter
) on the notebook -
Storage Legacy Object Reader (
roles/storage.legacyObjectReader
) on the output bucket
For more information about granting roles, see Manage access.
These predefined roles contain the permissions required to run a notebook in Colab Enterprise. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
The following permissions are required to run a notebook in Colab Enterprise:
-
dataform.locations.list
on the notebook -
dataform.repositories.computeAccessTokenStatus
on the notebook -
dataform.repositories.fetchHistory
on the notebook -
dataform.repositories.fetchRemoteBranches
on the notebook -
dataform.repositories.get
on the notebook -
dataform.repositories.getIamPolicy
on the notebook -
dataform.repositories.list
on the notebook -
dataform.repositories.queryDirectoryContents
on the notebook -
dataform.repositories.readFile
on the notebook -
logging.logEntries.create
on the project -
logging.logEntries.route
on the project -
monitoring.metricDescriptors.create
on the project -
monitoring.metricDescriptors.get
on the project -
monitoring.metricDescriptors.list
on the project -
monitoring.monitoredResourceDescriptors.get
on the project -
monitoring.monitoredResourceDescriptors.list
on the project -
monitoring.timeSeries.create
on the project -
resourcemanager.projects.get
on the project -
resourcemanager.projects.list
on the project -
storage.buckets.get
on the notebook -
storage.managedFolders.create
on the notebook -
storage.managedFolders.delete
on the notebook -
storage.managedFolders.get
on the notebook -
storage.managedFolders.list
on the notebook -
storage.multipartUploads.abort
on the notebook -
storage.multipartUploads.create
on the notebook -
storage.multipartUploads.list
on the notebook -
storage.multipartUploads.listParts
on the notebook -
storage.objects.create
on the notebook -
storage.objects.delete
on the notebook -
storage.objects.get
on the notebook -
storage.objects.list
on the notebook -
storage.objects.restore
on the notebook -
storage.objects.setRetention
on the notebook
Your administrator might also be able to give the principal these permissions with custom roles or other predefined roles.
Schedule a notebook run
To schedule a notebook run, complete the following steps. These steps cover both scheduling runs and creating a one-time notebook run.
-
In the Google Cloud console, go to the Colab Enterprise Notebooks page.
-
In the Region menu, select the region that contains your notebook.
-
Next to a notebook, click the
Notebook actions menu and select Schedule. -
In the Schedule name field, enter a name for your schedule.
-
Click the Runtime template list, and select a runtime template. The runtime template determines the specifications of the runtime that runs your notebook.
-
Under Run schedule, select one of the following:
-
One-off starts to run your notebook as soon as you submit the notebook run.
-
Recurring lets you schedule the notebook run for specific intervals of time. If you select this option, complete the scheduling dialog to set the schedule.
-
-
Next to the Cloud Storage output location field, click Browse to open the Select folder dialog.
-
Select a Cloud Storage bucket. Or, to create a bucket, click Create new bucket and complete the dialog.
-
If you selected a runtime template without end-user credentials enabled, the dialog includes a Service account field. In the Service account field, enter a service account's email address.
-
Click Submit
One-off notebook runs start immediately. Scheduled notebook runs start automatically on the schedule that you set.
In the Google Cloud console, you can view your schedules on the Schedules tab. You can view results from the completed notebook runs on the Execution jobs tab.
View results
To view results from the completed notebook runs:
-
In the Google Cloud console, go to the Colab Enterprise Execution jobs page.
-
Next to the notebook run that you want to view results for, click View result.
A read-only panel opens that shows the results of the notebook run.
-
To close the panel, click Close.
Delete results
To delete a result from one of your notebook runs, do the following:
-
In the Google Cloud console, go to the Colab Enterprise Execution jobs page.
-
Select the notebook run that you want to delete the result for.
-
Click
Delete. -
To confirm the deletion, click Confirm.
Share a notebook run's results
You can share notebook run results by providing access to the Cloud Storage bucket that contains your notebook run. Providing this access also grants users access to any other resources in the same Cloud Storage bucket (see Security considerations).
For more information, see the Cloud Storage Sharing and collaboration page.
Security considerations
Your notebook run results are stored as notebook (IPYNB) files in a Cloud Storage bucket. Consider the following when you grant access to this bucket:
Anyone with access to the bucket can see the notebook file's code and the results of the notebook run.
Anyone with the ability to change the contents of the bucket can change the contents of the notebook file.
View schedule details
You can view information about a schedule, including:
- The Cloud Storage bucket that the schedule stores results in.
- The start and end time.
- The frequency.
To view schedule details, do the following:
-
In the Google Cloud console, go to the Colab Enterprise Schedules page.
-
Click the name of a schedule.
The Schedule details page opens.
-
To go back to the Schedules page, click
Back to previous page.
Pause, resume, or delete a schedule
To pause, resume, or delete a schedule, do the following:
-
In the Google Cloud console, go to the Colab Enterprise Schedules page.
-
Select a schedule.
-
Click
Pause, Resume, or Delete.
What's next
Learn more about runtimes and runtime templates.
Learn how to create a runtime template.
Learn more about accessing Google Cloud services and APIs in your notebook.