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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for autoscaling #509

Merged
merged 7 commits into from Mar 4, 2022
Merged

feat: Add support for autoscaling #509

merged 7 commits into from Mar 4, 2022

Conversation

Mariatta
Copy link
Contributor

@Mariatta Mariatta commented Feb 15, 2022

  • Add the parameters min_serve_nodes, max_serve_nodes, and cpu_utilization_percent
  • Create disable_autoscaling function
  • Update documentation and tests

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 馃

@Mariatta Mariatta requested review from a team as code owners February 15, 2022 20:00
@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/python-bigtable API. label Feb 15, 2022
@snippet-bot
Copy link

snippet-bot bot commented Feb 15, 2022

Here is the summary of changes.

You are about to add 2 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@@ -85,6 +89,28 @@ class Cluster(object):
:data:`google.cloud.bigtable.enums.Cluster.State.CREATING`.
:data:`google.cloud.bigtable.enums.Cluster.State.RESIZING`.
:data:`google.cloud.bigtable.enums.Cluster.State.DISABLED`.

:type min_serve_nodes: int
:param min_serve_nodes: (Optional) The minimum number of nodes in the cluster. Must be
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would reword this slightly to point out that this is a setting for autoscaling. Something like:

The miniumum number of nodes to be set in the cluster for autoscaling. Must be 1 or greater ...

google/cloud/bigtable/cluster.py Outdated Show resolved Hide resolved
google/cloud/bigtable/cluster.py Show resolved Hide resolved
google/cloud/bigtable/cluster.py Outdated Show resolved Hide resolved
tests/system/test_instance_admin.py Show resolved Hide resolved
Copy link
Collaborator

@kolea2 kolea2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm after two small docs comments!

and not self.cpu_utilization_percent
):
raise ValueError(
"Must specify either serve_nodes or all of the autoscaling configurations."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe list the configurations here for convenience?

)
):
raise ValueError(
"All of autoscaling configurations must be specified at the same time."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment here

alt_cluster.reload()
assert alt_cluster.min_serve_nodes == new_min_serve_nodes
assert alt_cluster.max_serve_nodes == new_max_serve_nodes
assert alt_cluster.cpu_utilization_percent == new_cpu_utilization_percent
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add one more test case in which only one field is updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added such test below (line 691)

@Mariatta Mariatta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 28, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 28, 2022
@Mariatta Mariatta requested a review from kolea2 February 28, 2022 21:59
- Add the parameters min_serve_nodes, max_serve_nodes, and cpu_utilization_percent
- Create disable_autoscaling function
- Update documentation and tests
- System test fixes and add new test fixtures
@Mariatta Mariatta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 4, 2022
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 4, 2022
@Mariatta Mariatta merged commit 8f4e197 into main Mar 4, 2022
@Mariatta Mariatta deleted the feat-add-autoscaling branch March 4, 2022 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the googleapis/python-bigtable API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants