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

Add support for setting lower/upper-bounds for autotuned resources #3744

Merged
merged 4 commits into from
Dec 14, 2023

Conversation

nemacysts
Copy link
Member

At the moment this only supports a specific subset of top-level resource keys:

  • cpus
  • mem
  • disk

Supporting {min,max}_instances should be pretty trivial (but I'm not quite sure when we'd want to use that yet, so I left those out of the allowlist).

I'm explicitly not supporting these values for sidecars since: a) it seemed like it would complicate things a bit and, b) I'm not sure we have a usecase for this :p

At the moment this only supports a specific subset of top-level resource
keys:
* cpus
* mem
* disk

Supporting {min,max}_instances should be pretty trivial (but I'm not
quite sure when we'd want to use that yet, so I left those out of the
allowlist).

I'm explicitly not supporting these values for sidecars since:
a) it seemed like it would complicate things a bit and,
b) I'm not sure we have a usecase for this :p
@nemacysts nemacysts force-pushed the luisp/COMPINFRA-3424-autotune-mins branch from e1d8c9f to aad1ce9 Compare December 12, 2023 23:38
@@ -276,7 +279,7 @@ def get_recommendations_by_service_file(
result["cluster"],
) # e.g. (foo, marathon-norcal-stagef)
instance_type = result["cluster"].split("-", 1)[0]
rec: Union[KubernetesRecommendation, CassandraRecommendation]
rec: Union[KubernetesRecommendation, CassandraRecommendation] = {}
Copy link
Member Author

Choose a reason for hiding this comment

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

not super necessary, but pyright was correctly calling this out as a potentially unbound variable below (and I figured this is innocuous enough to sneak in here :p)

@nemacysts nemacysts marked this pull request as ready for review December 12, 2023 23:39
Comment on lines 295 to 297
for limit_type, limits in (
existing_configs[instance_name].get("autotune_limits", {}).items()
):
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to move this whole for loop into its own function, maybe called clamp_recommendations? This function is a bit long.

Copy link
Member Author

Choose a reason for hiding this comment

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

yup!

paasta_tools/config_utils.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jfongatyelp jfongatyelp left a comment

Choose a reason for hiding this comment

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

our first test for autotuned defaults logic!???

* Add docstring explaining types
* Match return type
* Update a test to make sure that we're doing the right thing with multiple
  instances in the same file
@nemacysts nemacysts merged commit c1aad55 into master Dec 14, 2023
9 checks passed
@nemacysts nemacysts deleted the luisp/COMPINFRA-3424-autotune-mins branch November 15, 2024 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants