-
Notifications
You must be signed in to change notification settings - Fork 260
opm serve: use pre-existing cache, if set and up-to-date #1005
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
opm serve: use pre-existing cache, if set and up-to-date #1005
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: joelanford The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Joe Lanford <[email protected]>
d153b58 to
f60f4a6
Compare
Codecov Report
@@ Coverage Diff @@
## master #1005 +/- ##
==========================================
+ Coverage 52.62% 52.97% +0.35%
==========================================
Files 104 105 +1
Lines 9422 9606 +184
==========================================
+ Hits 4958 5089 +131
- Misses 3535 3562 +27
- Partials 929 955 +26
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
8841d77 to
399c3c1
Compare
399c3c1 to
9177ab8
Compare
|
@joelanford was able to test your branch by building |
Signed-off-by: Joe Lanford <[email protected]>
9177ab8 to
49ce3e6
Compare
|
/lgtm |
Signed-off-by: Joe Lanford [email protected]
Description of the change:
This PR introduces an optional persistent caching layer to the
opm servecommand to reduce the cost of initializing the GRPC server for file-based catalogs -- and thus improve the startup time.It also update the Dockerfile generated by
opm generate dockerfileto build a cache at image build time and use it at runtime. This does have the side affect of essentially doubling the image size when compared to an image that does not pre-generate the cache.It adds
--cache-dirand--cache-onlyflags to theopm servecommand to enable interactions with the cache.--cache-dirflag specifies a persistent cache directory to use. If--cache-diris unset, the existing behavior (which builds and uses an ephemeral cache directory) remains.--cache-onlyflag causesopm serveto sync the cache and then exit without actually serving the GRPC API. This is useful when building catalog images -- if the catalog image contains a pre-synced cache, the container startup time is significantly improved.Motivation for the change:
The
opm servecommand's startup time is proportional to the size of the FBC. This is a problem because OLM creates catalog pods with somewhat aggressive health/liveness probes that cause affected FBC catalogs to never become healthy.This problem has been partially addressed in current/future OLM versions via the introduction of a startupProbe. However, that is mainly a workaround for the root problem. This PR attempts to improve the startup time itself.
Reviewer Checklist
/docs