Closed
Conversation
📊 Code Coverage Report
📦 Per-package breakdown |
There was a problem hiding this comment.
Code Review
This pull request introduces a shared node-level cache for static inline volumes, allowing multiple pods to share model data and reducing redundant pulls. The implementation includes configuration helpers for cache paths, reference counting and garbage collection logic in the worker service, and updated CSI node publish/unpublish workflows. Review feedback suggests using the provided request context instead of context.Background() when acquiring locks to ensure that operations properly handle timeouts and cancellations.
Signed-off-by: chlins <chlins.zhang@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a node-level shared cache for static inline model volumes, enabling multiple pods on the same node to share a single copy of a fully-pulled model. The cache is reference-counted and garbage-collected when no volumes are using a particular model. The implementation includes new helpers for cache directory management, updates to the publish and unpublish volume paths to use the shared cache, and comprehensive tests for cache path logic.
Shared cache implementation and integration:
RawConfigfor cache directory structure and digest parsing. The cache stores models undercache/content/$algo/$hex, with references tracked undercache/refs/$algo/$hex/$refName. (pkg/config/config.gopkg/config/config.goR146-R183)EnsureCachedModel,ReleaseCachedModel, andFindCacheDigestByRefinWorkerto manage cache population, reference counting, and garbage collection. These methods ensure deduplication of downloads, safe concurrent access, and cleanup when no references remain. (pkg/service/worker.go[1] [2]pkg/service/node_static_inline.go[1] [2]Testing and status tracking:
pkg/config/cache_test.gopkg/config/cache_test.goR1-R78)status.Statusto track the cache digest instatus.json, allowing unpublish operations to reliably release cache references. (pkg/status/status.gopkg/status/status.goR65)Storage structure: