Add a minimal if pipeline is compatible mode#428
Draft
f-wright wants to merge 5 commits into
Draft
Conversation
… / fully_minimal) Replace the global useMinimalImage boolean with a tri-state inferenceImageMode and a per-detector minimal_compatible flag that flows from cloud fetch-model-urls through the model updater. The model-updater, request-path routing, and OODD-pod creation all derive from the same detector_uses_minimal_image lookup, so they can't disagree. Includes hot-swap (delete-and-recreate) when a live deployment's image diverges from the desired flavor. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… code, add swap test - Replace coarse INFERENCE_IMAGE_MODE check in image_queries.py with detector_uses_minimal_image so all four OODD-decision sites derive from the same primitive (eliminating orphan OODD rows for known-minimal detectors) - Remove two dead-code calls to get_edge_inference_deployment_name in _redeploy_for_flavor_swap whose return values were discarded - Add test_minimal_to_full_redeploys covering the missing hot-swap direction - Soften values.yaml comment to accurately describe when the legacy/new conflict detection fires Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e edge cases - Remove deprecated useMinimalImage Helm helper and schema entry; CI and helm test now pass inferenceImageMode directly - Rename INFERENCE_IMAGE_FULL/MINIMAL → FULL/MINIMAL_INFERENCE_IMAGE_URI - Rename update_models_if_available → sync_models_from_cloud - Add per-worker TTL cache for uses_separate_oodd to skip repeated DB reads - _persist_minimal_compatible now returns bool; reconcile only triggers flavor swap on minimal_compatible flip in minimal_if_compatible mode - _redeploy_for_flavor_swap returns bool so a failed swap no longer suppresses the pending model rollout (swap_happened stays False) - Fix stale OODD pod removal via separate_oodd_mismatch check - Remove incorrect minimal_compatible copy from primary to OODD in parse_model_info - Add tests for cache keying, standard-mode no-redeploy, stale OODD removal, failed-swap recovery, and K8s deployment path agreement Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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.
Summary
useMinimalImageboolean with a tri-stateinferenceImageModethat can be set tostandard,minimal_if_compatible, orfully_minimal. The newminimal_if_compatiblemode picks the minimal inference image per-detector based on aminimal_compatibleflag the cloud is adding onfetch-model-urls, while leaving detectors without that annotation on the full image.EdgeInferenceManagerrequest-path routing — derive from the samedetector_uses_minimal_image(detector_id, db_manager)primitive inapp/core/inference_image.py, so they cannot drift out of agreement.minimal_compatible), the model-updater tears down primary + OODD and recreates them on the correct image. Delete-then-create is the only viable path because deployment names are derived fromdetector_idalone; 404-tolerant deletes handle crash-mid-swap recovery.Invariants preserved
detector_uses_minimal_imagecall controls both so they cannot disagree.minimal_compatibleis a new additive field onfetch-model-urls; old edge clients that don't read it are unaffected.minimal_compatibledefaults toFalseeverywhere — unannotated detectors stay on the full image;minimal_if_compatiblemode degrades tostandardwhen cloud is older.Test plan
uv run pytest test/core/ test/edge_inference/ test/database_manager/ test/model_updater/— all tests passhelm templaterenders without error forinferenceImageMode: standard,minimal_if_compatible,fully_minimalhelm templatewith legacyuseMinimalImage: truerendersINFERENCE_IMAGE_MODE=fully_minimalhelm templatewith bothinferenceImageModeanduseMinimalImageset fails with an explicit errorminimal_if_compatible; stubfetch-model-urlsso detector A returnsminimal_compatible: true, B returnsfalse; confirm A runs on*-minimalimage with no OODD pod, B runs on full image with OODD podfully_minimal, re-apply chart; after one model-updater cycle both primaries swap to minimal image and B's OODD pod is torn down🤖 Generated with Claude Code