feat: add PVC inspection to cache list for orphaned entry detection#183
Merged
feat: add PVC inspection to cache list for orphaned entry detection#183
Conversation
) Enhance `llmkube cache list` to inspect actual PVC contents by exec'ing into a pod that mounts the model cache PVC. This enables detection of orphaned cache entries (files on disk with no corresponding Model CR) and shows real disk usage instead of stale status values. - Add PVC inspection logic that finds an existing running pod or creates a temporary busybox inspector pod, runs `du -sb`, then parses output - Merge PVC entries with Model CR data to show active vs orphaned status - Add STATUS column to cache list output when PVC inspection succeeds - Add --orphaned flag to filter to orphaned-only entries - Graceful fallback to CR-only output when PVC is absent or inspection fails - Add formatBytes utility for human-readable byte sizes - Add comprehensive unit tests for all new functions - Add E2E tests covering full PVC inspection flow against Kind cluster Signed-off-by: Christopher Maher <christopher.maher@gmail.com> Signed-off-by: Christopher Maher <chris@mahercode.io>
The cache E2E tests were in a separate top-level Describe block that didn't share the CRD/controller lifecycle from the Manager Describe. This caused failures because CRDs were either not yet installed or already uninstalled when cache tests ran. Move all cache test contexts into the Manager Describe block so they run between BeforeAll (CRD install) and AfterAll (CRD cleanup). Delete the standalone cache_e2e_test.go file. Signed-off-by: Defilan <noreply@defilan.com> Signed-off-by: Christopher Maher <chris@mahercode.io>
The model cache PVC (llmkube-model-cache) is created by the InferenceService controller, not the Model controller. The cache E2E tests were only creating a Model CR, so no PVC existed and inspectPVCCache fell back to CR-only output without the STATUS column. Add an InferenceService CR and wait for PVC creation before running cache list assertions that depend on PVC inspection. Signed-off-by: Defilan <noreply@defilan.com> Signed-off-by: Christopher Maher <chris@mahercode.io>
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.
Summary
Closes #56
llmkube cache listto inspect actual PVC contents by exec'ing into a pod that mounts the model cache PVC, enabling detection of orphaned cache entries and real disk usage--orphanedflag to filter to only orphaned entries (files on PVC with no corresponding Model CR)Test plan
make testpasses — all unit tests including 25 new cache inspection testsmake lintpasses — 0 issuesmake test-e2e— E2E tests validate full PVC inspection flow:--orphanedflag filters correctly