Skip to content

🌱 Cache DiscoveryVariables calls #11592

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

Conversation

fabriziopandini
Copy link
Member

What this PR does / why we need it:
DiscoveryVariables is expected to return a "static" response + usually there are few extensions in a cluster, however today we keep calling DiscoveryVariables at every CC reconcile, and this could become very noisy if you have many CC.

This PR introduces a cache that prevents those repeated calls, all getting the same answer, to happen.

/area runtime-sdk

@k8s-ci-robot k8s-ci-robot added area/runtime-sdk Issues or PRs related to Runtime SDK cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 17, 2024
@fabriziopandini
Copy link
Member Author

/test

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 17, 2024
@k8s-ci-robot
Copy link
Contributor

@fabriziopandini: The /test command needs one or more targets.
The following commands are available to trigger required jobs:

  • /test pull-cluster-api-build-main
  • /test pull-cluster-api-e2e-blocking-main
  • /test pull-cluster-api-e2e-conformance-ci-latest-main
  • /test pull-cluster-api-e2e-conformance-main
  • /test pull-cluster-api-e2e-latestk8s-main
  • /test pull-cluster-api-e2e-main
  • /test pull-cluster-api-e2e-mink8s-main
  • /test pull-cluster-api-e2e-upgrade-1-32-1-33-main
  • /test pull-cluster-api-test-main
  • /test pull-cluster-api-test-mink8s-main
  • /test pull-cluster-api-verify-main

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-apidiff-main

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-apidiff-main
  • pull-cluster-api-build-main
  • pull-cluster-api-e2e-blocking-main
  • pull-cluster-api-test-main
  • pull-cluster-api-verify-main

In response to this:

/test

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-sigs/prow repository.

@fabriziopandini
Copy link
Member Author

/test pull-cluster-api-e2e-main

@sbueringer sbueringer force-pushed the cache-discoveryvariables-call branch from 3484831 to e9c66b7 Compare December 19, 2024 11:20
@sbueringer
Copy link
Member

/test pull-cluster-api-e2e-main

@sbueringer
Copy link
Member

@chrischdi @fabriziopandini Should be ready for another round of review

/hold
for additional unit tests in client.go

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 19, 2024
@sbueringer
Copy link
Member

/cherry-pick release-1.8

@k8s-infra-cherrypick-robot

@sbueringer: once the present PR merges, I will cherry-pick it on top of release-1.8 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.8

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 19, 2024
@sbueringer sbueringer force-pushed the cache-discoveryvariables-call branch from e9c66b7 to ddc14a2 Compare December 19, 2024 12:52
@sbueringer
Copy link
Member

/test pull-cluster-api-e2e-main
/hold cancel

@sbueringer
Copy link
Member

/cherry-pick release-1.9

@k8s-infra-cherrypick-robot

@sbueringer: once the present PR merges, I will cherry-pick it on top of release-1.9 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.9

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-sigs/prow repository.

@chrischdi
Copy link
Member

/retest

KCP adoption flake

@fabriziopandini
Copy link
Member Author

@sbueringer thanks for the commit on this PR, looks great!

@chrischdi
Copy link
Member

/lgtm
/approve

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

LGTM label has been added.

Git tree hash: 33847b7c6ccd6b35d06d140c760db41a07b97ee1

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chrischdi

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 Dec 19, 2024
@sbueringer
Copy link
Member

I don't see how this failure could be related: https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/kubernetes-sigs_cluster-api/11592/pull-cluster-api-e2e-main/1869761529562271744

How stable are the e2e tests at the moment?

/retest

@k8s-ci-robot k8s-ci-robot merged commit 7b18147 into kubernetes-sigs:main Dec 19, 2024
18 of 19 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.10 milestone Dec 19, 2024
@k8s-infra-cherrypick-robot

@sbueringer: #11592 failed to apply on top of branch "release-1.8":

Applying: Cache DiscoveryVariables calls
Using index info to reconstruct a base tree...
M	internal/controllers/clusterclass/clusterclass_controller.go
M	internal/controllers/clusterclass/clusterclass_controller_test.go
M	internal/controllers/topology/cluster/patches/external/external_patch_generator_test.go
M	test/extension/handlers/topologymutation/handler_integration_test.go
Falling back to patching base and 3-way merge...
Auto-merging test/extension/handlers/topologymutation/handler_integration_test.go
CONFLICT (content): Merge conflict in test/extension/handlers/topologymutation/handler_integration_test.go
Auto-merging internal/controllers/topology/cluster/patches/external/external_patch_generator_test.go
Auto-merging internal/controllers/clusterclass/clusterclass_controller_test.go
CONFLICT (content): Merge conflict in internal/controllers/clusterclass/clusterclass_controller_test.go
Auto-merging internal/controllers/clusterclass/clusterclass_controller.go
CONFLICT (content): Merge conflict in internal/controllers/clusterclass/clusterclass_controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Cache DiscoveryVariables calls

In response to this:

/cherry-pick release-1.8

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-sigs/prow repository.

@k8s-infra-cherrypick-robot

@sbueringer: new pull request created: #11599

In response to this:

/cherry-pick release-1.9

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-sigs/prow repository.

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/runtime-sdk Issues or PRs related to Runtime SDK cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", 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.

5 participants