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

Runtime patch #6137

Merged
merged 27 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
01d455f
Add projects.locations.runtimes.patch
m-mayran Jun 15, 2022
bfbb99f
Add projects.locations.runtimes.patch
m-mayran Jun 15, 2022
8df426b
Add tests for Workbench Runtime updates.
m-mayran Jun 16, 2022
84a7b79
Add tests for Workbench Runtime updates.
m-mayran Jun 16, 2022
086be95
Remove default value for enableHealthMonitoring
m-mayran Jun 23, 2022
edadcfe
Remove default value for enableHealthMonitoring
m-mayran Jun 23, 2022
9dc565e
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 11, 2022
a8a470e
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 11, 2022
5811c1f
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 11, 2022
0eb0ed7
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 11, 2022
f73695d
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 11, 2022
01b1a49
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 11, 2022
02b677b
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 11, 2022
e3949e8
Update mmv1/third_party/terraform/tests/resource_notebooks_runtime_te…
m-mayran Jul 11, 2022
973d3dc
Update mmv1/third_party/terraform/tests/resource_notebooks_runtime_te…
m-mayran Jul 11, 2022
6c1f9b6
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 11, 2022
eeab6a1
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 11, 2022
b8943fb
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 12, 2022
d92072f
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 12, 2022
0705e16
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 13, 2022
9b3b2eb
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 13, 2022
b4c24c1
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 13, 2022
79f6bfc
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 13, 2022
fff4210
Merge branch 'runtime-patch' of https://github.com/m-mayran/magic-mod…
m-mayran Jul 13, 2022
e4b882f
Update mmv1/third_party/terraform/tests/resource_notebooks_runtime_te…
m-mayran Jul 15, 2022
230a0ed
Update mmv1/third_party/terraform/tests/resource_notebooks_runtime_te…
m-mayran Jul 15, 2022
cf052e4
Update mmv1/products/notebooks/api.yaml
m-mayran Jul 15, 2022
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
17 changes: 16 additions & 1 deletion mmv1/products/notebooks/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ objects:
create_url: projects/{{project}}/locations/{{location}}/runtimes?runtimeId={{name}}
self_link: projects/{{project}}/locations/{{location}}/runtimes/{{name}}
create_verb: :POST
update_verb: :PATCH
update_mask: true
# When set, if any parameter change, they will get recreated.
# Use wisely because any `update_url:` in the hierarchy below this will get ignored.
# input: true
Expand Down Expand Up @@ -503,7 +505,7 @@ objects:
- !ruby/object:Api::Type::String
name: 'name'
description: |
The name specified for the Notebook instance.
The name specified for the Notebook runtime.
required: true
input: true
url_param_only: true
Expand Down Expand Up @@ -673,6 +675,7 @@ objects:
name: "containerImages"
description: |
Use a list of container images to start the notebook instance.
input: true
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
Expand All @@ -689,6 +692,7 @@ objects:
name: "encryptionConfig"
description: |
Encryption settings for virtual machine data disk.
input: true
properties:
- !ruby/object:Api::Type::String
name: "kmsKey"
Expand All @@ -702,6 +706,7 @@ objects:
name: "shieldedInstanceConfig"
description: |
Shielded VM Instance configuration settings.
input: true
properties:
- !ruby/object:Api::Type::Boolean
name: "enableSecureBoot"
Expand Down Expand Up @@ -757,6 +762,7 @@ objects:
configuring Private Service Access.
* Shared VPC (network & subnet are required). Requires
configuring Private Service Access.
input: true
- !ruby/object:Api::Type::String
name: "subnet"
description: |
Expand All @@ -766,6 +772,7 @@ objects:
* `https://www.googleapis.com/compute/v1/projects/[project_id]/
regions/us-east1/subnetworks/sub0`
* `projects/[project_id]/regions/us-east1/subnetworks/sub0`
input: true
- !ruby/object:Api::Type::Boolean
name: "internalIpOnly"
description: |
Expand All @@ -775,6 +782,7 @@ objects:
`internal_ip_only` restriction can only be enabled for subnetwork
enabled networks, and all dependencies must be configured to be
accessible without external IP addresses.
input: true
- !ruby/object:Api::Type::Array
name: "tags"
description: |
Expand Down Expand Up @@ -810,10 +818,17 @@ objects:
description: |
The type of vNIC to be used on this interface. This may be gVNIC
or VirtioNet.
input: true
values:
- UNSPECIFIED_NIC_TYPE
- VIRTIO_NET
- GVNIC
- !ruby/object:Api::Type::String
m-mayran marked this conversation as resolved.
Show resolved Hide resolved
name: "reservedIpRange"
description: |
Reserved IP Range name is used for VPC Peering. The
subnetwork allocation will use the range *name* if it's assigned.
input: true
- !ruby/object:Api::Type::Enum
name: 'state'
values:
Expand Down
5 changes: 5 additions & 0 deletions mmv1/products/notebooks/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ overrides: !ruby/object:Overrides::ResourceOverrides
softwareConfig: !ruby/object:Overrides::Terraform::PropertyOverride
# API returns default idleShutdown (true) and default idleShutdownTimeout (180).
default_from_api: true
update_mask_fields:
- "softwareConfig.idleShutdown"
- "softwareConfig.idleShutdownTimeout"
- "softwareConfig.customGpuDriverPath"
- "softwareConfig.postStartupScript"
Location: !ruby/object:Overrides::Terraform::ResourceOverride
properties:
name: !ruby/object:Overrides::Terraform::PropertyOverride
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<% autogen_exception -%>
package google

import (
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccNotebooksRuntime_update(t *testing.T) {
context := map[string]interface{}{
"random_suffix": randString(t, 10),
}

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckNotebooksRuntimeDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccNotebooksRuntime_basic(context),
},
{
ResourceName: "google_notebooks_runtime.runtime",
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccNotebooksRuntime_update(context),
},
{
ResourceName: "google_notebooks_runtime.runtime",
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccNotebooksRuntime_basic(context),
},
{
ResourceName: "google_notebooks_runtime.runtime",
ImportState: true,
ImportStateVerify: true,
},
},
})
}


func testAccNotebooksRuntime_basic(context map[string]interface{}) string {
m-mayran marked this conversation as resolved.
Show resolved Hide resolved
return Nprintf(`
resource "google_notebooks_runtime" "runtime" {
name = "tf-test-notebooks-runtime%{random_suffix}"
location = "us-central1"
access_config {
access_type = "SINGLE_USER"
runtime_owner = "[email protected]"
}
software_config {}
virtual_machine {
virtual_machine_config {
machine_type = "n1-standard-4"
data_disk {
initialize_params {
disk_size_gb = "100"
disk_type = "PD_STANDARD"
}
}
m-mayran marked this conversation as resolved.
Show resolved Hide resolved
reserved_ip_range = "192.168.255.0/24"
}
}
}
`, context)
}

func testAccNotebooksRuntime_update(context map[string]interface{}) string {
return Nprintf(`
resource "google_notebooks_runtime" "runtime" {
name = "tf-test-notebooks-runtime%{random_suffix}"
location = "us-central1"
access_config {
access_type = "SINGLE_USER"
runtime_owner = "[email protected]"
}
software_config {
idle_shutdown_timeout = "80"
}
virtual_machine {
virtual_machine_config {
machine_type = "n1-standard-4"
data_disk {
initialize_params {
disk_size_gb = "100"
disk_type = "PD_STANDARD"
}
}
m-mayran marked this conversation as resolved.
Show resolved Hide resolved
reserved_ip_range = "192.168.255.0/24"
}
}
}
`, context)
}