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 Consumer reconciler for scheduling and scaling #1601

Conversation

pierDipi
Copy link
Member

@pierDipi pierDipi commented Dec 14, 2021

Part of #1537

Proposed Changes

  • Add Consumer reconciler for scheduling and scaling
  • Add ConsumerSpec validation based on the reconciler assumptions

Release Note

None

Docs

None

Note:

  • TODO: reconciler tests

@knative-prow-robot knative-prow-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. area/control-plane approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 14, 2021
@codecov
Copy link

codecov bot commented Dec 14, 2021

Codecov Report

Merging #1601 (64bbe13) into main (6e55cf4) will decrease coverage by 6.54%.
The diff coverage is 75.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1601      +/-   ##
============================================
- Coverage     72.63%   66.09%   -6.55%     
- Complexity      600      606       +6     
============================================
  Files           122      128       +6     
  Lines          4586     5220     +634     
  Branches        174      176       +2     
============================================
+ Hits           3331     3450     +119     
- Misses          979     1484     +505     
- Partials        276      286      +10     
Flag Coverage Δ
java-unittests 81.88% <ø> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...nals/kafka/eventing/v1alpha1/consumer_lifecycle.go 0.00% <0.00%> (ø)
...nternals/kafka/eventing/v1alpha1/consumer_types.go 0.00% <ø> (ø)
...als/kafka/eventing/v1alpha1/consumer_validation.go 87.23% <82.35%> (-12.77%) ⬇️
...fka/eventing/v1alpha1/consumer_group_validation.go 100.00% <100.00%> (ø)
control-plane/pkg/contract/extensions.go 100.00% <100.00%> (ø)
control-plane/pkg/contract/serde.go 100.00% <100.00%> (ø)
control-plane/pkg/reconciler/base/reconciler.go 67.22% <100.00%> (ø)
...r/dispatcher/main/ConsumerVerticleFactoryImpl.java 87.82% <0.00%> (-0.25%) ⬇️
...a/broker/dispatcher/impl/KafkaResponseHandler.java
...r/dispatcher/impl/ResponseToKafkaTopicHandler.java 100.00% <0.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6e55cf4...64bbe13. Read the comment docs.

@pierDipi pierDipi force-pushed the SRVKE-1060_Consumer-reconciler branch from 0f05994 to fed104c Compare December 14, 2021 13:49
@knative-prow-robot knative-prow-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Dec 14, 2021
@pierDipi pierDipi force-pushed the SRVKE-1060_Consumer-reconciler branch 5 times, most recently from b24bf38 to b2d6ea5 Compare December 14, 2021 14:44
@pierDipi pierDipi changed the title [WIP] Add Consumer reconciler for scheduling and scaling Add Consumer reconciler for scheduling and scaling Dec 14, 2021
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 14, 2021
@pierDipi pierDipi requested a review from matzew January 4, 2022 09:30
@pierDipi pierDipi force-pushed the SRVKE-1060_Consumer-reconciler branch 2 times, most recently from 12a6fd3 to 0e9a8be Compare January 10, 2022 07:52
@pierDipi
Copy link
Member Author

I had to rebase this PR.

@devguyio devguyio requested review from devguyio and removed request for devguyio January 10, 2022 09:22
@devguyio devguyio self-assigned this Jan 10, 2022
return idx
}

func (r Reconciler) schedule(ctx context.Context, logger *zap.Logger, c *kafkainternals.Consumer, mutatorFunc contractMutatorFunc) (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain what the schedule function does in terms of figuring out placements here? At this point, the consumer is already scheduled right? Maybe some more comments here might help as in what is the update to the config map being done, etc?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll add comment, maybe schedule as the name isn't the best one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Does this help?

// schedule mutates the ConfigMap associated with the pod specified by Consumer.Spec.PodBind.
//
// The actual mutation is done by calling the provided contractMutatorFunc.

Copy link
Contributor

Choose a reason for hiding this comment

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

It does. Great. Think the function being called schedule made it a bit confusing without a comment

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 11, 2022
Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pdipilat@redhat.com>
@pierDipi pierDipi force-pushed the SRVKE-1060_Consumer-reconciler branch from 0e9a8be to 9693e7f Compare January 11, 2022 15:03
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 11, 2022
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-sandbox-eventing-kafka-broker-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
control-plane/pkg/apis/internals/kafka/eventing/v1alpha1/consumer_validation.go 100.0% 84.8% -15.2
control-plane/pkg/contract/extensions.go Do not exist 100.0%
control-plane/pkg/contract/serde.go Do not exist 100.0%

@pierDipi
Copy link
Member Author

/retest

Copy link
Contributor

@aavarghese aavarghese left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 12, 2022
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aavarghese, pierDipi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot merged commit 57e833c into knative-extensions:main Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/control-plane lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants