diff --git a/mmv1/products/colab/NotebookExecution.yaml b/mmv1/products/colab/NotebookExecution.yaml index 6e832a2bd97c..fb6adea024bb 100644 --- a/mmv1/products/colab/NotebookExecution.yaml +++ b/mmv1/products/colab/NotebookExecution.yaml @@ -24,6 +24,10 @@ base_url: 'projects/{{project}}/locations/{{location}}/notebookExecutionJobs' self_link: 'projects/{{project}}/locations/{{location}}/notebookExecutionJobs/{{notebook_execution_job_id}}' immutable: true create_url: 'projects/{{project}}/locations/{{location}}/notebookExecutionJobs?notebook_execution_job_id={{notebook_execution_job_id}}' +timeouts: + insert_minutes: 60 + update_minutes: 20 + delete_minutes: 20 async: type: 'OpAsync' operation: @@ -57,6 +61,39 @@ samples: service_account: 'SERVICE_ACCT' ignore_read_extra: - direct_notebook_source.0.content + - name: 'colab_notebook_execution_workbench_runtime' + primary_resource_id: 'notebook-execution' + steps: + - name: 'colab_notebook_execution_workbench_runtime' + resource_id_vars: + bucket: 'my_bucket' + test_env_vars: + project_id: 'PROJECT_NAME' + service_account: 'SERVICE_ACCT' + ignore_read_extra: + - direct_notebook_source.0.content + - name: 'colab_notebook_execution_workbench_runtime_vm' + primary_resource_id: 'notebook-execution' + steps: + - name: 'colab_notebook_execution_workbench_runtime_vm' + resource_id_vars: + bucket: 'my_bucket' + test_env_vars: + project_id: 'PROJECT_NAME' + service_account: 'SERVICE_ACCT' + ignore_read_extra: + - direct_notebook_source.0.content + - name: 'colab_notebook_execution_workbench_runtime_vm_name' + primary_resource_id: 'notebook-execution' + steps: + - name: 'colab_notebook_execution_workbench_runtime_vm_name' + resource_id_vars: + bucket: 'my_bucket' + test_env_vars: + project_id: 'PROJECT_NAME' + service_account: 'SERVICE_ACCT' + ignore_read_extra: + - direct_notebook_source.0.content - name: 'colab_notebook_execution_full' min_version: beta primary_resource_id: 'notebook-execution' @@ -213,6 +250,62 @@ properties: type: String description: 'The name of the subnetwork that this runtime is in.' diff_suppress_func: 'tpgresource.CompareSelfLinkRelativePaths' + - name: shieldedInstanceConfig + type: NestedObject + # GCP API does not return shieldedInstanceConfig in GET responses for NotebookExecutionJob. + ignore_read: true + description: 'Optional. Shielded VM configuration.' + properties: + - name: enableIntegrityMonitoring + type: Boolean + description: 'Optional. Defines whether the instance has integrity monitoring enabled. Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. Enabled by default.' + - name: enableSecureBoot + type: Boolean + description: 'Optional. Defines whether the instance has Secure Boot enabled. Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. Disabled by default.' + - name: enableVtpm + type: Boolean + description: 'Optional. Defines whether the instance has the vTPM enabled. Enabled by default.' + - name: workbenchRuntime + type: NestedObject + # GCP API does not return workbenchRuntime in GET responses for NotebookExecutionJob. + ignore_read: true + description: 'Configuration for a Workbench Instances-based environment.' + properties: + - name: customContainerImage + type: NestedObject + description: 'Optional. Custom container image for the Workbench instance.' + exactly_one_of: + - workbench_runtime.0.custom_container_image + - workbench_runtime.0.vm_image + properties: + - name: repository + type: String + description: 'The path to the container image repository. For example: gcr.io/{project_id}/{imageName}' + - name: tag + type: String + description: 'The tag of the container image. If not specified, this defaults to the latest tag.' + - name: vmImage + type: NestedObject + description: 'Optional. Custom Compute Engine VM image for the Workbench instance.' + exactly_one_of: + - workbench_runtime.0.custom_container_image + - workbench_runtime.0.vm_image + properties: + - name: family + type: String + exactly_one_of: + - workbench_runtime.0.vm_image.0.family + - workbench_runtime.0.vm_image.0.name + description: 'Optional. Use this VM image family to find the image; the newest image in this family will be used.' + - name: name + type: String + exactly_one_of: + - workbench_runtime.0.vm_image.0.family + - workbench_runtime.0.vm_image.0.name + description: 'Optional. Use VM image name to find the image.' + - name: project + type: String + description: 'The name of the Google Cloud project that this VM image belongs to. Format: {project_id}' - name: 'gcsOutputUri' required: true type: String diff --git a/mmv1/templates/terraform/samples/services/colab/colab_notebook_execution_custom_env.tf.tmpl b/mmv1/templates/terraform/samples/services/colab/colab_notebook_execution_custom_env.tf.tmpl index bd5f449bfe09..daff81fead22 100644 --- a/mmv1/templates/terraform/samples/services/colab/colab_notebook_execution_custom_env.tf.tmpl +++ b/mmv1/templates/terraform/samples/services/colab/colab_notebook_execution_custom_env.tf.tmpl @@ -78,6 +78,12 @@ resource "google_colab_notebook_execution" "{{$.PrimaryResourceId}}" { network = google_compute_network.my_network.id subnetwork = google_compute_subnetwork.my_subnetwork.id } + + shielded_instance_config { + enable_integrity_monitoring = true + enable_secure_boot = true + enable_vtpm = true + } } gcs_output_uri = "gs://${google_storage_bucket.output_bucket.name}" diff --git a/mmv1/templates/terraform/samples/services/colab/colab_notebook_execution_workbench_runtime.tf.tmpl b/mmv1/templates/terraform/samples/services/colab/colab_notebook_execution_workbench_runtime.tf.tmpl new file mode 100644 index 000000000000..00df309e14db --- /dev/null +++ b/mmv1/templates/terraform/samples/services/colab/colab_notebook_execution_workbench_runtime.tf.tmpl @@ -0,0 +1,77 @@ +resource "google_storage_bucket" "output_bucket" { + name = "{{index $.ResourceIdVars "bucket"}}" + location = "US" + force_destroy = true + uniform_bucket_level_access = true +} + +resource "google_colab_notebook_execution" "{{$.PrimaryResourceId}}" { + display_name = "Notebook execution workbench runtime" + location = "us-central1" + + direct_notebook_source { + content = base64encode(<