-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 Bigtable autoscaling configs to Instance #5803
Add Bigtable autoscaling configs to Instance #5803
Conversation
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
Hello! I am a robot who works on Magic Modules PRs. I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. Thanks for your contribution! A human will be with you soon. @megan07, please review this PR or find an appropriate assignee. |
de2b6c8
to
079cc35
Compare
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
079cc35
to
8585d5f
Compare
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
8585d5f
to
103d6a7
Compare
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
103d6a7
to
ced5b2f
Compare
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
ced5b2f
to
5a63a12
Compare
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
e548dcd
to
62d3aa9
Compare
/gcbrun |
Hi @kongweihan would you mind running |
@megan07 I see the changelog-checker passes now, is that ok or do I still need to update |
62d3aa9
to
371d05c
Compare
Hi @kongweihan, sorry, we just started managing this in magic-modules, so I was confused. You'll want to go to our downstream, make the update to |
371d05c
to
cb023b3
Compare
/gcbrun |
@megan07 updated. I see that downstream repo has both bigtable 1.10.1 and 1.13 in |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 4 files changed, 213 insertions(+), 4 deletions(-)) |
1 similar comment
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 4 files changed, 213 insertions(+), 4 deletions(-)) |
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.
Sorry for the delay, I needed to build and run locally. Tests passed, but there are some formatting issues. If you wouldn't mind fixing those up, I can get this merged today. Thanks so much!
Type: schema.TypeInt, | ||
Required: true, | ||
Description: `The minimum number of nodes for autoscaling.`, |
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.
Would you mind formatting these, please? When I ran it locally I saw changes to these 3 attributes.
Type: schema.TypeInt, | |
Required: true, | |
Description: `The minimum number of nodes for autoscaling.`, | |
Type: schema.TypeInt, | |
Required: true, | |
Description: `The minimum number of nodes for autoscaling.`, |
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.
Thanks! Will fix. And, looking at https://github.com/GoogleCloudPlatform/magic-modules/pull/5800/files
Should I also update the doc? This change will be directly available to customer right, so we should publish the doc change?
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.
Oh, yes please! Sorry, I missed that. Thank you!
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 updated these, PTAL. Thanks!
// Create Autoscaling config with 2 nodes. | ||
Config: testAccBigtableInstance_autoscalingCluster(instanceName, 2, 5, 70), | ||
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttr("google_bigtable_instance.instance", | ||
"cluster.0.num_nodes", "2"),), |
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.
There was also some formatting on these lines of the tests as well. You can run make fmt
in the downstream to find them all, that would be great.
"cluster.0.num_nodes", "2"),), | |
"cluster.0.num_nodes", "2")), |
cb023b3
to
3cc504c
Compare
Type: schema.TypeList, | ||
Optional: true, | ||
MaxItems: 1, | ||
Description: "A list of Autoscaling configurations. Only one element is used and allowed.", |
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.
Is there a reason why a list is used here but exactly one element is required?
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 it's the only way to nest a object into the schema in terraform. More details is in yaqs. See internal design doc.
"min_nodes": { | ||
Type: schema.TypeInt, | ||
Required: true, | ||
Description: `The minimum number of nodes for autoscaling.`, |
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.
nit: "The minimum number of nodes to scale down to"?
Similarly, "Maximum number of nodes to scale up to."
Required: true, | ||
Description: `The maximum number of nodes for autoscaling.`, | ||
}, | ||
"cpu_target": { |
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.
Are we doing some minimum validation on these field? e.g. 0 < cpu_target <= 100?
At very minimum we should document this.
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.
It says that in the description?
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.
}) | ||
} | ||
autoscaling_configs := cluster["autoscaling_config"].([]interface{}) | ||
if len(autoscaling_configs) > 0 { |
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.
What happens if len(autoscaling_configs) > 1? Are we silently dropping the rest of the configs?
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.
There's a check on the field validating it has at most 1 element.
// Create Autoscaling config with 2 nodes. | ||
Config: testAccBigtableInstance_autoscalingCluster(instanceName, 2, 5, 70), | ||
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttr("google_bigtable_instance.instance", | ||
"cluster.0.num_nodes", "2"),), |
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.
What are we checking here? only the allocated nodes?
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.
Yes, since that might not be set in the config, I want to explicitly check it.
}, | ||
{ | ||
// Update Autoscaling configs. | ||
Config: testAccBigtableInstance_autoscalingCluster(instanceName, 1, 5, 80), |
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.
Do we need to verify the updates?
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.
By default the test asserts on all the config fields.
ImportStateVerifyIgnore: []string{"deletion_protection", "instance_type"}, // we don't read instance type back | ||
}, | ||
{ | ||
// Disable Autoscaling without specifying num_nodes, it should should use the current node count, which is 2. |
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.
"it should use the current node count"
@@ -230,6 +355,26 @@ resource "google_bigtable_instance" "instance" { | |||
`, instanceName, instanceName, numNodes) | |||
} | |||
|
|||
|
|||
func testAccBigtableInstance_noNumNodes(instanceName string) string { |
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.
Interesting! I thought this is invalid. How can this work? Will users be confused?
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 invalid at create time but ok for update. We plan to keep this behavior in case people have config relying on this.
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttr("google_bigtable_instance.instance", | ||
"cluster.0.num_nodes", "2"),), | ||
}, | ||
{ |
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.
Sorry! just curious. What does this step do?
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.
Checking that if we create a cluster with autoscaling.min_nodes = X, the cluster will start with X nodes.
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 4 files changed, 213 insertions(+), 4 deletions(-)) |
3cc504c
to
83ad138
Compare
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 4 files changed, 211 insertions(+), 4 deletions(-)) |
548eebf
to
688727b
Compare
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 5 files changed, 219 insertions(+), 4 deletions(-)) |
1 similar comment
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 5 files changed, 219 insertions(+), 4 deletions(-)) |
4a16aa7
to
7fe688d
Compare
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 5 files changed, 216 insertions(+), 4 deletions(-)) |
Design at go/cbt-autoscaler-terraform Fixes hashicorp/terraform-provider-google#10758 ```release-note:enhancement bigtable: Added cluster autoscaling support ```
7fe688d
to
b03dd6a
Compare
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 5 files changed, 216 insertions(+), 4 deletions(-)) |
Looks good! Thank you for contributing! |
Thanks! How's the release process? When will this be available to customers? @megan07 |
We have some maintenance being done next week on our release process, so this will likely be released the following week. |
How do I know when it's released? |
@kongweihan: I've linked internal material covering this in chat! |
Design at go/cbt-autoscaler-terraform Fixes hashicorp/terraform-provider-google#10758 ```release-note:enhancement bigtable: Added cluster autoscaling support ```
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)