Skip to content

Use actual pods from K8S Informer for scaling rate - #3055

Merged
knative-prow-robot merged 23 commits into
knative:masterfrom
yanweiguo:use_actual_pods
Feb 8, 2019
Merged

knative-prow-robot merged 23 commits into
knative:masterfrom
yanweiguo:use_actual_pods

Conversation

@yanweiguo

@yanweiguo yanweiguo commented Jan 31, 2019 •

Copy link
Copy Markdown
Contributor

Fixes #2994 and #3058

Proposed Changes

  • Use actual pods from K8S Informer for scaling rate in autoscaler.
  • Assume actual pods from K8S Informer doesn't change rapidly. Cache these data of each second in memory for a period of stable window size. They will be used to calculate revision concurrency when we do sampling.
  • Extract two functions to short locked scope.

Release Note


@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 31, 2019

@knative-prow-robot knative-prow-robot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@yanweiguo: 1 warning.

Details

In response to this:

Fixes #2994

Proposed Changes

  • Use actual pods from K8S Informer for scaling rate in autoscaler.
  • Assume actual pods from K8S Informer doesn't change rapidly. Cache these data of each second in memory for a period of stable window size. They will be used to calculate revision concurrency when we do sampling.

Release Note


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Comment thread pkg/autoscaler/autoscaler.go Resolved
Comment thread pkg/autoscaler/autoscaler.go Resolved
Comment thread pkg/autoscaler/autoscaler.go Resolved
Comment thread pkg/autoscaler/autoscaler.go Resolved
Comment thread pkg/autoscaler/autoscaler.go Resolved
Comment thread pkg/autoscaler/autoscaler.go Resolved
Comment thread pkg/autoscaler/autoscaler.go Resolved
Comment thread pkg/autoscaler/autoscaler.go Resolved

@vagababov vagababov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, minor stuff mostly.

Comment thread cmd/autoscaler/main.go Resolved
Comment thread pkg/autoscaler/autoscaler.go Resolved
Comment thread pkg/autoscaler/autoscaler.go Resolved
Comment thread pkg/autoscaler/autoscaler.go Resolved

@vagababov vagababov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the changes.
/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 1, 2019
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Feb 1, 2019
@yanweiguo

Copy link
Copy Markdown
Contributor Author

/test pull-knative-serving-upgrade-tests
/test pull-knative-serving-integration-tests

@vagababov vagababov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks!
/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 2, 2019
@yanweiguo

Copy link
Copy Markdown
Contributor Author

I changed .gitattributes to exclude coverage test for all main.go files.

@yanweiguo
yanweiguo requested a review from mattmoor February 6, 2019 23:01
@markusthoemmes

Copy link
Copy Markdown
Contributor

No, I think it's just due to the flakiness.

Sorry, but I'll have to disagree here. The test that failed is pkg/autoscaler TestAutoscaler_PanicModeExponential_TrackAndStablize and it's not one of our usually flaky tests.

To run this test locally you can use:

/usr/local/bin/go test -race --count=100 -timeout 30s github.com/knative/serving/pkg/autoscaler -run "^(TestAutoscaler_PanicModeExponential_TrackAndStablize)$"

On master that works just fine for me. Checking out this PR you'll see this test failing an awful lot of times so I think this PR introduces a flake into this test which we should hunt down before merging.

@yanweiguo

Copy link
Copy Markdown
Contributor Author

No, I think it's just due to the flakiness.

Sorry, but I'll have to disagree here. The test that failed is pkg/autoscaler TestAutoscaler_PanicModeExponential_TrackAndStablize and it's not one of our usually flaky tests.

To run this test locally you can use:

/usr/local/bin/go test -race --count=100 -timeout 30s github.com/knative/serving/pkg/autoscaler -run "^(TestAutoscaler_PanicModeExponential_TrackAndStablize)$"

On master that works just fine for me. Checking out this PR you'll see this test failing an awful lot of times so I think this PR introduces a flake into this test which we should hunt down before merging.

Thanks for this information. It turns out the flakiness is due to the readyPodsCache. Added the clean up each time to force it to get the newest value from Informer.

@yanweiguo

Copy link
Copy Markdown
Contributor Author

/test pull-knative-serving-unit-tests

Not TestAutoscaler_PanicModeExponential_TrackAndStablize this time.

Comment thread pkg/autoscaler/autoscaler.go Resolved
@greghaynes

Copy link
Copy Markdown
Contributor

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 7, 2019
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Feb 7, 2019
@knative-metrics-robot

Copy link
Copy Markdown

The following is the coverage report on pkg/.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/autoscaler/autoscaler.go 99.2% 97.2% -2.0

@yanweiguo

Copy link
Copy Markdown
Contributor Author

/test pull-knative-serving-integration-tests

@markusthoemmes markusthoemmes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm
/approve

Thanks for simplifying without the cache for now. We should add that when it has more context.

/assign @josephburnett

Do you mind taking a look as well please? I feel like my eyes are not sharp on this PR anymore.

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 8, 2019
@greghaynes

Copy link
Copy Markdown
Contributor

/lgtm

Comment thread pkg/autoscaler/autoscaler.go Resolved
@mdemirhan

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@knative-prow-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: markusthoemmes, mdemirhan, yanweiguo

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

The pull request process is described here

Details 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 8, 2019
@yanweiguo

Copy link
Copy Markdown
Contributor Author

/test pull-knative-serving-unit-tests
/test pull-knative-serving-integration-tests

@knative-prow-robot
knative-prow-robot merged commit 6ff096f into knative:master Feb 8, 2019
@yanweiguo
yanweiguo deleted the use_actual_pods branch March 21, 2019 18:59
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. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants