Skip to content

Commit 04e906a

Browse files
committed
colab: add workbench_runtime support to google_colab_notebook_execution
1 parent 67c69ea commit 04e906a

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

mmv1/products/colab/NotebookExecution.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ base_url: 'projects/{{project}}/locations/{{location}}/notebookExecutionJobs'
2424
self_link: 'projects/{{project}}/locations/{{location}}/notebookExecutionJobs/{{notebook_execution_job_id}}'
2525
immutable: true
2626
create_url: 'projects/{{project}}/locations/{{location}}/notebookExecutionJobs?notebook_execution_job_id={{notebook_execution_job_id}}'
27+
timeouts:
28+
insert_minutes: 60
2729
async:
2830
type: 'OpAsync'
2931
operation:
@@ -70,6 +72,11 @@ samples:
7072
test_env_vars:
7173
project_id: 'PROJECT_NAME'
7274
service_account: 'SERVICE_ACCT'
75+
# Vertex AI GetNotebookExecutionJob API does not return workbenchRuntime in read responses.
76+
ignore_read_extra:
77+
- workbench_runtime.0.vm_image.0.project
78+
- workbench_runtime.0.vm_image.0.family
79+
- workbench_runtime.0.vm_image.0.name
7380
- name: 'colab_notebook_execution_dataform'
7481
min_version: beta
7582
primary_resource_id: 'notebook-execution'
@@ -229,3 +236,33 @@ properties:
229236
- execution_user
230237
- service_account
231238
description: 'The service account to run the execution as.'
239+
- name: 'workbenchRuntime'
240+
type: NestedObject
241+
# Vertex AI GetNotebookExecutionJob API does not return workbenchRuntime in read responses.
242+
ignore_read: true
243+
description: 'Configuration for a Workbench Instances-based environment.'
244+
properties:
245+
- name: 'vmImage'
246+
type: NestedObject
247+
description: |
248+
Definition of a custom Compute Engine virtual machine image for starting
249+
a notebook execution with the environment installed directly on the VM.
250+
properties:
251+
- name: 'project'
252+
type: String
253+
required: true
254+
description: |
255+
The name of the Google Cloud project that this VM image belongs to.
256+
Format: `{project_id}`
257+
- name: 'name'
258+
type: String
259+
description: 'Use this VM image name to find the image.'
260+
exactly_one_of:
261+
- workbench_runtime.0.vm_image.0.name
262+
- workbench_runtime.0.vm_image.0.family
263+
- name: 'family'
264+
type: String
265+
description: 'Use this VM image family to find the image; the newest image in this family will be used.'
266+
exactly_one_of:
267+
- workbench_runtime.0.vm_image.0.name
268+
- workbench_runtime.0.vm_image.0.family

mmv1/templates/terraform/samples/services/colab/colab_notebook_execution_full.tf.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ resource "google_colab_notebook_execution" "{{$.PrimaryResourceId}}" {
8080
gcs_output_uri = "gs://${google_storage_bucket.output_bucket.name}"
8181
notebook_runtime_template_resource_name = "projects/${google_colab_runtime_template.my_runtime_template.project}/locations/${google_colab_runtime_template.my_runtime_template.location}/notebookRuntimeTemplates/${google_colab_runtime_template.my_runtime_template.name}"
8282

83+
workbench_runtime {
84+
vm_image {
85+
project = "cloud-notebooks-managed"
86+
family = "workbench-instances-2603"
87+
}
88+
}
89+
8390
depends_on = [
8491
google_storage_bucket_object.notebook,
8592
google_storage_bucket.output_bucket,

0 commit comments

Comments
 (0)