Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notebooks - add args + promote some args to GA #6243

Merged
merged 8 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions mmv1/products/notebooks/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ objects:
- UNSPECIFIED_NIC_TYPE
- VIRTIO_NET
- GVNIC
min_version: beta
- !ruby/object:Api::Type::NestedObject
name: 'reservationAffinity'
description: |
Expand All @@ -317,7 +316,6 @@ objects:
description: |
Corresponds to the label values of reservation resource.
item_type: Api::Type::String
min_version: beta
- !ruby/object:Api::Type::String
name: 'state'
description: |
Expand All @@ -342,6 +340,7 @@ objects:
- PD_STANDARD
- PD_SSD
- PD_BALANCED
- PD_EXTREME
description: |
Possible disk types for notebook instances.
- !ruby/object:Api::Type::Integer
Expand All @@ -357,6 +356,7 @@ objects:
- PD_STANDARD
- PD_SSD
- PD_BALANCED
- PD_EXTREME
description: |
Possible disk types for notebook instances.
- !ruby/object:Api::Type::Integer
Expand Down Expand Up @@ -902,6 +902,11 @@ objects:
name: "installGpuDriver"
description: |
Install Nvidia Driver automatically.
- !ruby/object:Api::Type::Boolean
name: "upgradeable"
output: true
description: |
Bool indicating whether an newer image is available in an image family.
- !ruby/object:Api::Type::String
name: "customGpuDriverPath"
description: |
Expand All @@ -913,6 +918,30 @@ objects:
Path to a Bash script that automatically runs after a notebook instance
fully boots up. The path must be a URL or
Cloud Storage path (gs://path-to-file/file-name).
- !ruby/object:Api::Type::Enum
name: 'postStartupScriptBehavior'
values:
- POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED
- RUN_EVERY_START
- DOWNLOAD_AND_RUN_EVERY_START
description: |
Behavior for the post startup script.
- !ruby/object:Api::Type::Array
name: 'kernels'
description: |
Use a list of container images to use as Kernels in the notebook instance.
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
name: 'repository'
description: |
The path to the container image repository.
For example: gcr.io/{project_id}/{imageName}
required: true
- !ruby/object:Api::Type::String
name: 'tag'
description: |
The tag of the container image. If not specified, this defaults to the latest tag.
- !ruby/object:Api::Type::NestedObject
name: "metrics"
description: |
Expand Down
14 changes: 14 additions & 0 deletions mmv1/products/notebooks/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,20 @@ overrides: !ruby/object:Overrides::ResourceOverrides
region_override: "us-central1"
vars:
runtime_name: "notebooks-runtime-container"
- !ruby/object:Provider::Terraform::Examples
name: "notebook_runtime_kernels"
primary_resource_id: "runtime_container"
primary_resource_name: "fmt.Sprintf(\"tf-test-notebooks-runtime-container%s\", context[\"random_suffix\"])"
region_override: "us-central1"
vars:
runtime_name: "notebooks-runtime-kernel"
- !ruby/object:Provider::Terraform::Examples
name: "notebook_runtime_script"
primary_resource_id: "runtime_container"
primary_resource_name: "fmt.Sprintf(\"tf-test-notebooks-runtime-container%s\", context[\"random_suffix\"])"
region_override: "us-central1"
vars:
runtime_name: "notebooks-runtime-script"
description: |
{{description}}

Expand Down
25 changes: 25 additions & 0 deletions mmv1/templates/terraform/examples/notebook_runtime_kernels.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
resource "google_notebooks_runtime" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]["runtime_name"] %>"
location = "us-central1"
access_config {
access_type = "SINGLE_USER"
runtime_owner = "[email protected]"
}
software_config {
kernels {
repository = "gcr.io/deeplearning-platform-release/base-cpu"
tag = "latest"
}
}
virtual_machine {
virtual_machine_config {
machine_type = "n1-standard-4"
data_disk {
initialize_params {
disk_size_gb = "100"
disk_type = "PD_STANDARD"
}
}
}
}
}
22 changes: 22 additions & 0 deletions mmv1/templates/terraform/examples/notebook_runtime_script.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
resource "google_notebooks_runtime" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]["runtime_name"] %>"
location = "us-central1"
access_config {
access_type = "SINGLE_USER"
runtime_owner = "[email protected]"
}
software_config {
post_startup_script_behavior = "RUN_EVERY_START"
}
virtual_machine {
virtual_machine_config {
machine_type = "n1-standard-4"
data_disk {
initialize_params {
disk_size_gb = "100"
disk_type = "PD_STANDARD"
}
}
}
}
}