-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add remaining fields to TPU VM resource #9308
Conversation
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 1 file changed, 218 insertions(+)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_tpu_v2_vm" "primary" {
scheduling_config {
reserved = # value needed
}
}
|
Tests analyticsTotal tests: Action takenFound 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccContainerAttachedCluster_containerAttachedClusterFullExample|TestAccContainerAttachedCluster_update|TestAccTpuV2Vm_update|TestAccTpuV2Vm_tpuV2VmFullExample |
Rerun these tests in REPLAYING mode to catch issues
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 1 file changed, 218 insertions(+)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_tpu_v2_vm" "primary" {
scheduling_config {
reserved = # value needed
}
}
|
Tests analyticsTotal tests: Action takenFound 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccContainerAttachedCluster_containerAttachedClusterFullExample|TestAccContainerAttachedCluster_update|TestAccTpuV2Vm_update |
Rerun these tests in REPLAYING mode to catch issues
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 1 file changed, 218 insertions(+)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_tpu_v2_vm" "primary" {
scheduling_config {
reserved = # value needed
}
}
|
Tests analyticsTotal tests: Action takenFound 6 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccContainerNodePool_fastSocket|TestAccContainerNodePool_012_ConfigModeAttr|TestAccDataSourceGoogleServiceAccountJwt|TestAccDataSourceGoogleServiceAccountAccessToken_basic|TestAccTpuV2Vm_update|TestAccWorkstationsWorkstationConfig_workstationConfigAcceleratorsExample |
I've added you both for initial review since this should be done (except for the additional fields I will be trying to add), and tests have passed locally, but it is just taking a very long time to get the VCR tests in a happy place. I already have a change queued up to attempt adding the networking fields as well, just waiting on VCR to complete to do that. @rileykarson I added you since I know you have context but feel free to re-assign. |
Rerun these tests in REPLAYING mode to catch issues
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 1 file changed, 257 insertions(+)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_tpu_v2_vm" "primary" {
scheduling_config {
reserved = # value needed
}
}
|
Tests analyticsTotal tests: Action takenFound 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccContainerNodePool_012_ConfigModeAttr|TestAccProjectIamPolicy_invalidMembers|TestAccTpuV2Vm_tpuV2VmFullExample|TestAccTpuV2Vm_update|TestAccWorkstationsWorkstationConfig_workstationConfigAcceleratorsExample |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial pass, I'm still working through updatable fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, pass done- was shorter to finish than I expected.
mmv1/third_party/terraform/services/tpuv2/resource_tpu_v2_vm_test.go.erb
Show resolved
Hide resolved
Rerun these tests in REPLAYING mode to catch issues
|
Oh good, it looks like the firewall issue I was seeing was specific to my local environment 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nothing blocking left on my end- it'd be nice to test updating a disk mode too, but as you mentioned that wasn't succeeding for API business logic reasons.
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 1 file changed, 258 insertions(+)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_tpu_v2_vm" "primary" {
scheduling_config {
reserved = # value needed
}
}
|
Tests analyticsTotal tests: Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccBigQueryDataTable_bigtable|TestAccTpuV2Vm_update |
Rerun these tests in REPLAYING mode to catch issues
|
item_type: Api::Type::String | ||
- !ruby/object:Api::Type::String | ||
name: 'state' | ||
output: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that output is true here, but does that mean it is output only? Want to check that it cannot be set in the .tf file. Also, are the output-only fields typically defined here in the resource yaml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, output: true
is our equivalent to output-only; it cannot be set by the user. And yea, this is where we specify that for mmv1 resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. It didn't seem required to state the outputs when I tested it and I didn't see this in some of the other resource files I checked. This seems fine, just curious if this is the preferred method since I'm not sure if I saw any difference when output fields were omitted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, you won't typically see a difference in output fields when testing, but we include them to better support users. They can feed outputs into other config or automation they may be using.
tags = ["foo"] | ||
|
||
lifecycle { | ||
prevent_destroy = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want prevent_destroy to be true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is sort of a trick I've seen used a few times that might be adopted more. The point of this type of test is to create the resource, update it in-place, and then destroy it. However, by default the "update in-place" requirement is not enforced, so changing an immutable field will still pass, and since that will recreate the resource, you can no longer tell if any of the fields are appropriately configured in terms of mutability.
So the workaround you see here ensures that Terraform will error if the resource needs to be recreated, so you know that only in-place updates are taking place if the test passes. Then, in order to clean up after the test is done, we need to set prevent_destroy = false
, and then finally delete the resource.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Longer term we'll be able to use hashicorp/terraform-plugin-testing#61 to assert properties of the test plan
mmv1/third_party/terraform/services/tpuv2/resource_tpu_v2_vm_test.go.erb
Outdated
Show resolved
Hide resolved
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 1 file changed, 262 insertions(+)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_tpu_v2_vm" "primary" {
scheduling_config {
reserved = # value needed
}
}
|
Tests analyticsTotal tests: Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccSpannerInstanceIamPolicy|TestAccTpuV2Vm_tpuV2VmFullExample |
Rerun these tests in REPLAYING mode to catch issues
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 1 file changed, 262 insertions(+)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_tpu_v2_vm" "primary" {
scheduling_config {
reserved = # value needed
}
}
|
Tests analyticsTotal tests: Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccTpuV2Vm_update |
Rerun these tests in REPLAYING mode to catch issues
|
This reverts commit 5dc9f2e.
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 1 file changed, 272 insertions(+)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_tpu_v2_vm" "primary" {
scheduling_config {
reserved = # value needed
}
}
|
Tests analyticsTotal tests:
|
b/292585830
This adds the remaining fields to
google_tpu_v2_vm
that are available from the API.Notable exceptions (which may end up making it into this PR):
accelerator_config
accelerator_type
, and we'll need to work around the existing default behaviorOne other interesting piece is
service_account.scopes
. If the user specifies this field but does not includehttps://www.googleapis.com/auth/pubsub
, it will be automatically added by the server, so I've added a diff_suppress to ignore that value.Release Note Template for Downstream PRs (will be copied)