opendatahub-io / opendatahub-operator

Open Data Hub operator to manage ODH component integrations
https://opendatahub.io
Apache License 2.0
60 stars 139 forks source link

Add caching suport to deployment action to minimize pressure on the API server and improve efficiency and responsiveness #1328

Open lburgazzoli opened 4 days ago

lburgazzoli commented 4 days ago

Description

This PR introduces an optional caching mechanism for the deploy action that, if enabled, prevent the action to actually apply a resource to the cluster. This is done by keeping an internal cache composed by type, namespaced name, revision of the live object plus an identity (hash) of the rendered resource. In case an object is known by the cache, it means there's no need to apply it again.

https://issues.redhat.com/browse/RHOAIENG-15174

How Has This Been Tested?

  1. enable the dashboard component on the DSC
  2. wait for the dashboard CR to become ready
  3. maned a resource created as part of the dashboard deployment (i.e. a service)
  4. observe that only the mentioned service gets applied and eventually reverted

Screenshot or short clip

Merge criteria

openshift-ci[bot] commented 4 days ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from lburgazzoli. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/opendatahub-io/opendatahub-operator/blob/feature-operator-refactor/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
lburgazzoli commented 4 days ago

/test opendatahub-operator-e2e

codecov[bot] commented 4 days ago

Codecov Report

Attention: Patch coverage is 58.86525% with 58 lines in your changes missing coverage. Please review.

Please upload report for BASE (feature-operator-refactor@86668ce). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/controller/actions/deploy/action_deploy.go 63.15% 33 Missing and 9 partials :warning:
...g/controller/actions/deploy/action_deploy_cache.go 40.74% 13 Missing and 3 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## feature-operator-refactor #1328 +/- ## ============================================================ Coverage ? 25.65% ============================================================ Files ? 53 Lines ? 4350 Branches ? 0 ============================================================ Hits ? 1116 Misses ? 3096 Partials ? 138 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

lburgazzoli commented 10 hours ago

@VaishnaviHire whenever you have some time, can you have a look at this ?