-
Notifications
You must be signed in to change notification settings - Fork 238
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
multiple metrics support for paasta #3837
Conversation
39bdd21
to
4040c65
Compare
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.
approach seems sensible to me - i mostly just have a couple questions and some non-blocking/ignorable suggestions/comments
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'm 75% certain that this file is dead code from the mesos days and we can ignore completely
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 am also 75% certain that none of this is needed. But if I don't make these changes then it will fail mypy checks. I am 50% tempted to just submit a PR to delete this file entirely but it seems like one of those things that is maybe still called somewhere in some arcane way that's hard to suss out.
|
||
def get_autoscaling_max_instances_alert_threshold(self) -> float: | ||
autoscaling_params = self.get_autoscaling_params() | ||
return autoscaling_params.get( | ||
"max_instances_alert_threshold", autoscaling_params["setpoint"] | ||
# TODO this default doesn't make sense for metrics providers that don't use setpoint |
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.
@EvanKrall what are your thoughts here?
i can see us resolving this in two ways:
- look at the autoscaling params and use the
desired_active_requests_per_replica
if present - give up on
desired_active_requests_per_replica
and rename it tosetpoint
so that the code is neater" (at the cost of people sometimes getting confused as to what setpoint means :p)
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 is kind of odd that for active-requests we have some positive number 0-infinity, where for other providers setpoint
is typically a number between 0-1 expressed as a ratio of some maximum resource utilization that's possible (100% worker util, 100% cpu, etc). We could maybe change active-requests to have two parameters: max_active_requests_per_replica
(which would be some larger number than desired
is currently) and setpoint
. But that's probably just adding complexity where it isn't necessary.
With my branch we could have setpoint be a large number for active requests and 0-1 for other providers, and then max_instances_alert_threshold for each of those would also follow the same rules.
@@ -921,7 +933,7 @@ def get_autoscaling_metric_spec( | |||
hpa = V2beta2HorizontalPodAutoscaler( | |||
kind="HorizontalPodAutoscaler", | |||
metadata=V1ObjectMeta( | |||
name=name, namespace=namespace, annotations=annotations, labels=labels | |||
name=name, namespace=namespace, annotations=dict(), labels=labels |
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.
comment: heh, i was confused by this diff until i read the previous code and realized (as you did) that we never wrote to annotations
🤣
71edc6f
to
90a7e7a
Compare
5a2cc07
to
b70b0b5
Compare
c8d79cc
to
c55635f
Compare
c72053d
to
9f09517
Compare
4abc69d
to
ce7b716
Compare
1588e74
to
0c76f8f
Compare
9f09517
to
41135e6
Compare
2cfd2d9
to
cb955b9
Compare
cb955b9
to
5e368dc
Compare
"metrics_providers" | ||
] | ||
|
||
# TODO: this doesn't work for metrics_providers that don't use setpoint (e.g. active-requests) |
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.
@Krall should we add a conditional that exits early if the metrics_provider doesn't use setpoint or should we add some special-casing here to treat the desired_active_requests field as setpoint?
5e368dc
to
8000f7f
Compare
8000f7f
to
75452ee
Compare
This change introduces the ability to add multiple metrics configs to an HPA via paasta. We transform the existing AutoscalingParamsDict into a new version that looks like this:
In this PR, we support both the old and the new ways of doing things, and we transform the old autoscaling params dict into the new version when we read the YAML files. After this PR is shipped, we will do a mass-refactor of yelpsoa into the new format and remove the "transformation" code so that only the new format is supported.
The first commit shows the bulk of the changes, and the second commit shows additional validation code and tests that are performed.
Testing done
Open questions
active-requests
in check_autoscaler_max_instances? (link1, link2)cc @sclg-yelp