-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 PushScaler interface and impl external-push scaler #865
Conversation
Closes #820 Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
Might be a stupid question but is there a reason why this impacts the external scaler spec? How I understood it it was going to be a new “push” scaler built in the core. |
go.mod
Outdated
@@ -21,11 +21,12 @@ require ( | |||
github.com/go-redis/redis v6.15.7+incompatible | |||
github.com/go-sql-driver/mysql v1.5.0 | |||
github.com/golang/mock v1.4.3 | |||
github.com/golang/protobuf v1.3.5 | |||
github.com/golang/protobuf v1.3.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.
Is this downgrade on purpose?
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
@tomkerkhove It's a really good question. It didn't have to alter the existing scaler, I just meant to add a completely new scaler, This PR can be thought of as 2 parts:
The reason to change external scaler was just to clean up the contract a bit. The current contract is this: service ExternalScaler {
rpc New(NewRequest) returns (google.protobuf.Empty) {}
rpc IsActive(ScaledObjectRef) returns (IsActiveResponse) {}
rpc GetMetricSpec(ScaledObjectRef) returns (GetMetricSpecResponse) {}
rpc GetMetrics(GetMetricsRequest) returns (GetMetricsResponse) {}
rpc Close(ScaledObjectRef) returns (google.protobuf.Empty) {}
} When I was implementing external scalers for testing the contract for "new" and "close" as GRPC calls is very awkward/unclear. In fact both the example external scalers we have don't do anything on Close (durable and artemis) and durable also just logs the request on New. Artemis uses new to store some global metadata, but this locks it to only 1 scaledObject. Handling this on per invocation for IsActive is a more flexible and doesn't require every implementation to handle state. This PR adds |
@ahmelsayed Thanks for the info! So if you build an external scaler, we don't mandate it to support pull & push but merely just give the contract or am I understanding it wrong (sorry, have to dig deeper on this topic). Just want to avoid that it's becoming more complex to write an external scaler while we don't need the complexity. |
@tomkerkhove Yeah, that's correct. See there are 2 types of External scaler: keda/pkg/scaling/scale_handler.go Lines 353 to 356 in 5996879
|
btw, is there a place we're tracking breaking changes in v2? I can add a couple of lines to the CHANGELOG for this. |
@ahmelsayed that's right. We don't have anything atm, the same goes for docs. Start the v2 section in Changelog with this PR and I'll add the other changes then. |
Since it has not been shipped yet, would it make sense to use "Upcoming" or move the WIP to a Google Doc? |
@tomkerkhove the changelog will be in the v2 branch, so it will not interfere with master branch. |
Good point, sounds good to me 👍 |
@ahmelsayed are going to add the Changelog as part of this PR or do you want to create another? If it is the latter option we can merge this PR. |
Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
Sorry for the delay, I was out the last couple of weeks. I added a line to the CHANGELOG for this breaking change. We can add another PR for other breaking changes in v2. I also opened a docs PR here kedacore/keda-docs#193 |
Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
* Add PushScaler interface and impl external-push scaler Closes kedacore#820 Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com> * pass metadata to scaler Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com> * add section for breaking changes in the CHANGELOG Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com> * use correct protoc-gen-go version Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
* Add PushScaler interface and impl external-push scaler Closes kedacore#820 Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com> * pass metadata to scaler Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com> * add section for breaking changes in the CHANGELOG Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com> * use correct protoc-gen-go version Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
* Add PushScaler interface and impl external-push scaler Closes #820 Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com> * pass metadata to scaler Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com> * add section for breaking changes in the CHANGELOG Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com> * use correct protoc-gen-go version Signed-off-by: Ahmed ElSayed <ahmels@microsoft.com>
Closes #820
Signed-off-by: Ahmed ElSayed ahmels@microsoft.com
This PR introduces
with 1 implementation in an
external-push
scaler with the following grpc callExternalScaler also keeps a pool of GRPC connections per-metadata hash. So if there are multiple scaledObjects all pointing to the same grpc endpoint with the same metadata, they will all use the same
grpc.ClientConn
with separategrpc.Client
per-scaledObject.This PR also removes the following methods from the external scaler interface:
This is a breaking change for external scaler.
Checklist
Fixes #820