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

Bump k8s.io/kube-openapi to commit ee342a809c29 #106181

Merged
merged 1 commit into from
Nov 10, 2021

Conversation

ulucinar
Copy link
Contributor

@ulucinar ulucinar commented Nov 5, 2021

What type of PR is this?

/kind bug

What this PR does / why we need it:

Updates kube-openapi dependency to consume the aggregated OpenAPI spec lazy-marshaling behavior introduced with:
kubernetes/kube-openapi#251

Looks like lazy-marshaling introduced with kubernetes/kube-openapi#251 enables us to better scale in the #-of-CRDs-per-cluster dimension.

Which issue(s) this PR fixes:

Fixes #101755
Fixes #105932

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 5, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @ulucinar!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @ulucinar. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/dependency Issues or PRs related to dependency changes labels Nov 5, 2021
@k8s-ci-robot k8s-ci-robot requested review from lavalamp, logicalhan and a team November 5, 2021 13:55
@ulucinar
Copy link
Contributor Author

ulucinar commented Nov 5, 2021

Hi @DangerOnTheRanger, @apelisse,
I have opened this PR to stir up some discussions on consuming @DangerOnTheRanger's PR and to plan about cherry-picks to active release branches.

I'd also like to gain experience on contributing to upstream Kubernetes so any guidance is very much appreciated :)

@DangerOnTheRanger
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. area/apiserver area/cloudprovider area/code-generation area/kubectl sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 5, 2021
@k8s-ci-robot k8s-ci-robot added sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/storage Categorizes an issue or PR as relevant to SIG Storage. labels Nov 5, 2021
@apelisse
Copy link
Member

apelisse commented Nov 5, 2021

We have quite a few things to get from kube-openapi before the release, I'm not opposed to merging this, but we'll have to bump it again soon anyway.

@ulucinar
Copy link
Contributor Author

ulucinar commented Nov 5, 2021

I have run the following command to see whether the failing TestFlowControlSignal/upgrade_request_performed also fails in my development environment. It looks like it's passing:

$ make test WHAT=./vendor/k8s.io/kube-aggregator/pkg/apiserver GOFLAGS="-v" KUBE_TEST_ARGS='-run ^TestFlowControlSignal$'

+++ [1105 17:31:04] Running tests without code coverage and with -race
=== RUN   TestFlowControlSignal
=== RUN   TestFlowControlSignal/local
=== RUN   TestFlowControlSignal/unavailable
=== RUN   TestFlowControlSignal/request_performed
=== RUN   TestFlowControlSignal/upgrade_request_performed
--- PASS: TestFlowControlSignal (0.02s)
    --- PASS: TestFlowControlSignal/local (0.00s)
    --- PASS: TestFlowControlSignal/unavailable (0.00s)
    --- PASS: TestFlowControlSignal/request_performed (0.01s)
    --- PASS: TestFlowControlSignal/upgrade_request_performed (0.00s)
PASS
ok      k8s.io/kubernetes/vendor/k8s.io/kube-aggregator/pkg/apiserver   0.181s

Trying the bot's suggestion:
/test pull-kubernetes-unit

@ulucinar
Copy link
Contributor Author

ulucinar commented Nov 5, 2021

Hi @apelisse,
Thanks for the feedback. I think this is for the 1.23 release planned for December 7, 2021.

How do we move on with the cherry-picks to the active release branches 1.20-22? How is kube-openapi consumed in a monthly patch release? If I'm not mistaken, the deadline for the cherry-picks is November 12, 2021. Is a cherry-pick to respective release branches (release-0.20, release-0.21, release-0.22) done after this PR (or one of the upcoming kube-openapi bump PRs) are merged)? Is it possible to independently bump kube-openapi version in active release branches without this one being merged? Wouldn't it be problematic to try to consume latest kube-openapi in those release branches?

Sorry for asking lots of questions. I'm trying to better understand our plan.

@enj enj added this to Needs Triage in SIG Auth Old Nov 6, 2021
Updates to consume the aggregated OpenAPI spec lazy-marshaling behaviour
introduced with: kubernetes/kube-openapi#251

Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>
@ulucinar
Copy link
Contributor Author

ulucinar commented Nov 8, 2021

Squashed the commits into a single one. Again looks like a unit test has failed. Gave it a try in my development environment:

$ make test WHAT=./vendor/k8s.io/client-go/metadata/metadatainformer GOFLAGS="-v" KUBE_TEST_ARGS='-run ^TestMetadataSharedInformerFactory$'

+++ [1108 13:08:16] Running tests without code coverage and with -race
=== RUN   TestMetadataSharedInformerFactory
=== RUN   TestMetadataSharedInformerFactory/scenario_1:_test_if_adding_an_object_triggers_AddFunc
W1108 13:08:21.210587 2507679 mutation_detector.go:53] Mutation detector is enabled, this will result in memory leakage.
I1108 13:08:21.213720 2507679 reflector.go:219] Starting reflector *v1.PartialObjectMetadata (0s) from k8s.io/client-go/metadata/metadatainformer/informer.go:90
I1108 13:08:21.213806 2507679 reflector.go:255] Listing and watching *v1.PartialObjectMetadata from k8s.io/client-go/metadata/metadatainformer/informer.go:90
I1108 13:08:21.312107 2507679 shared_informer.go:270] caches populated
I1108 13:08:21.312742 2507679 watch.go:183] Stopping fake watcher.
=== RUN   TestMetadataSharedInformerFactory/scenario_2:_tests_if_updating_an_object_triggers_UpdateFunc
I1108 13:08:21.313000 2507679 reflector.go:225] Stopping reflector *v1.PartialObjectMetadata (0s) from k8s.io/client-go/metadata/metadatainformer/informer.go:90
W1108 13:08:21.313525 2507679 mutation_detector.go:53] Mutation detector is enabled, this will result in memory leakage.
I1108 13:08:21.315741 2507679 reflector.go:219] Starting reflector *v1.PartialObjectMetadata (0s) from k8s.io/client-go/metadata/metadatainformer/informer.go:90
I1108 13:08:21.315804 2507679 reflector.go:255] Listing and watching *v1.PartialObjectMetadata from k8s.io/client-go/metadata/metadatainformer/informer.go:90
I1108 13:08:21.416699 2507679 shared_informer.go:270] caches populated
I1108 13:08:21.417285 2507679 watch.go:183] Stopping fake watcher.
I1108 13:08:21.417351 2507679 reflector.go:225] Stopping reflector *v1.PartialObjectMetadata (0s) from k8s.io/client-go/metadata/metadatainformer/informer.go:90
=== RUN   TestMetadataSharedInformerFactory/scenario_3:_test_if_deleting_an_object_triggers_DeleteFunc
W1108 13:08:21.418349 2507679 mutation_detector.go:53] Mutation detector is enabled, this will result in memory leakage.
I1108 13:08:21.420887 2507679 reflector.go:219] Starting reflector *v1.PartialObjectMetadata (0s) from k8s.io/client-go/metadata/metadatainformer/informer.go:90
I1108 13:08:21.420965 2507679 reflector.go:255] Listing and watching *v1.PartialObjectMetadata from k8s.io/client-go/metadata/metadatainformer/informer.go:90
I1108 13:08:21.521471 2507679 shared_informer.go:270] caches populated
I1108 13:08:21.521954 2507679 watch.go:183] Stopping fake watcher.
--- PASS: TestMetadataSharedInformerFactory (0.31s)
    --- PASS: TestMetadataSharedInformerFactory/scenario_1:_test_if_adding_an_object_triggers_AddFunc (0.10s)
    --- PASS: TestMetadataSharedInformerFactory/scenario_2:_tests_if_updating_an_object_triggers_UpdateFunc (0.10s)
    --- PASS: TestMetadataSharedInformerFactory/scenario_3:_test_if_deleting_an_object_triggers_DeleteFunc (0.10s)
PASS
I1108 13:08:21.522164 2507679 reflector.go:225] Stopping reflector *v1.PartialObjectMetadata (0s) from k8s.io/client-go/metadata/metadatainformer/informer.go:90
ok      k8s.io/kubernetes/vendor/k8s.io/client-go/metadata/metadatainformer     0.406s

/test pull-kubernetes-unit

@ulucinar
Copy link
Contributor Author

ulucinar commented Nov 8, 2021

We have given a try for bringing lazy OpenAPI spec marshaling changes to the active release branches release-1.22, release-1.21 and release-1.20. When opened, the v1.22 cherry-pick should look like the following:
https://github.com/kubernetes/kubernetes/compare/release-1.22...ulucinar:rel-1.22-consume-kube-openapi?expand=1

However, for the prospective v1.21 and v1.20 cherry-picks, because we are consuming kube-openapi master in the respective release branches, the "cherry-picks" involve API changes. For instance, for v1.21, we get something like the following:
https://github.com/kubernetes/kubernetes/compare/release-1.21...ulucinar:rel-1.21-consume-kube-openapi?expand=1

For release-1.21 & release-1.20 branches, we may proceed as Haowei Cai (@roycaihw) suggests in the sig-api-machinery Slack channel:

  1. Fork two new branches in kube-openapi from commits consumed in the respective k/k release branches and cherry-pick the lazy marshaling PR into those branches
  2. Consume these two forks in those release branches.

Do you think this is the preferred way to proceed to bring these changes into the release branches?

@muvaf
Copy link

muvaf commented Nov 8, 2021

FYI, @apelisse just created those new release branches in kube-openapi (thank you!!) and we opened three PRs [1] [2] [3] to cherry-pick the fix to those branches. Once they are merged, the cherry-pick PRs we will open here will be very limited in their scope.

@ulucinar
Copy link
Contributor Author

ulucinar commented Nov 9, 2021

The corresponding kube-openapi version bump PRs for release branches are open:
release-1.20: #106257
release-1.21: #106255
release-1.22: #106250

For v1.20 and v1.21, the PRs also bump versions for the github.com/googleapis/gnostic library.

@liggitt
Copy link
Member

liggitt commented Nov 9, 2021

For release-1.21 & release-1.20 branches, we may proceed as Haowei Cai (@roycaihw) suggests in the sig-api-machinery Slack channel:

  1. Fork two new branches in kube-openapi from commits consumed in the respective k/k release branches and cherry-pick the lazy marshaling PR into those branches
  2. Consume these two forks in those release branches.

Do you think this is the preferred way to proceed to bring these changes into the release branches?

yes. we've created branches in kube-openapi before to pick targeted fixes

@fedebongio
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 9, 2021
Copy link
Member

@liggitt liggitt left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Comment on lines +80 to +81
c.bytes = bytes
c.etag = computeETag(c.bytes)
Copy link
Member

@liggitt liggitt Nov 9, 2021

Choose a reason for hiding this comment

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

It's pretty twisty that Get() mutates *cache, and that calls to Get() from getSwaggerBytes() and getSwaggerPbBytes() are only protected by a read-lock.

It's not clear from the outside that cache#Get() and cache#New() are unsafe to call concurrently... and the calls to Get and New only happen to be safe because they're guarded by locks (which were primarily intended to protect reads/writes to the fields in OpenAPIService).

Not blocking for this PR, but probably worth a follow-up in kube-openapi master to clarify/clean that up

Copy link
Member

Choose a reason for hiding this comment

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

Good catch! Let's fix that up.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 9, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, ulucinar

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 9, 2021
@k8s-ci-robot k8s-ci-robot merged commit f59b0a5 into kubernetes:master Nov 10, 2021
SIG Auth Old automation moved this from Needs Triage to Closed / Done Nov 10, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Nov 10, 2021
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/apiserver area/cloudprovider area/code-generation area/dependency Issues or PRs related to dependency changes area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
SIG Auth Old
Closed / Done
7 participants