-
Notifications
You must be signed in to change notification settings - Fork 132
refactor(sidecar): encapsulate code better in order to share protocol implementation between different connectors #566
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
Open
kyanokashi
wants to merge
65
commits into
llm-d:main
Choose a base branch
from
kyanokashi:refactor/sidecar/abstract-connector
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
b228bb7
feat: implement decode first flow on lmcache connector
kyanokashi a436b50
Merge branch 'main' into feat/sidecar/lmcache-connector/decode-first
kyanokashi a6ae771
fix: error handling
kyanokashi 58388eb
Merge branch 'main' into feat/sidecar/lmcache-connector/decode-first
kyanokashi 04b7ffd
chore: add back todo comment
kyanokashi ce74f50
refactor: reduce code complexity and duplication
kyanokashi 1de6035
refactor: improve header copying
kyanokashi c0ac69e
chore: add comment explaning the cache_hit_threshold field and the ne…
kyanokashi 7ce5e19
refactor: enhance logging for cache hit threshold in decode flow
kyanokashi 6430a02
refactor: improve error handling and observability when failing to un…
kyanokashi 4c15d95
chore: add deleted informational comments
kyanokashi cac084f
typo
kyanokashi 91c7a06
refactor: make error logs more descriptive of the failure reason
kyanokashi 69d30b5
feat: add cache hit threshold to prefill request so prefill executes …
kyanokashi 1ed1d89
fix: typo
kyanokashi 515b385
refactor: assign 0 cache_hit_threshold before final decode attempt
kyanokashi 4c8659e
chore: update comment according to feedback
kyanokashi 878585b
Merge branch 'main' into feat/sidecar/lmcache-connector/decode-first
kyanokashi 722b58e
chore: remove istio workaround
kyanokashi 487d333
fix: set cache hit threshold to 0 in prefill request for consistent e…
kyanokashi cb00b52
refactor: update the log
kyanokashi 88739c6
feat: support online decoding
kyanokashi 9fbb2d1
fix: preserve request body in lmcache connector
kyanokashi 7b18827
Merge branch 'main' into feat/sidecar/lmcache-connector/decode-first
kyanokashi 460b9c8
fix: support sse format for streamed decode
kyanokashi a722510
chore: add and improve log descriptions
kyanokashi e2b3380
fix: typo
kyanokashi 548e6c8
Merge branch 'main' into feat/sidecar/lmcache-connector/decode-first
kyanokashi 160fb72
nit: undo capitalization
kyanokashi 9a08dfb
fix: typos
kyanokashi 7508f10
chore: improve error log observability
kyanokashi bd114fa
refactor: encapsulate http error checking in function and reuse
kyanokashi 5a6a4f6
refactor: encapsulate and reuse code better
kyanokashi 6e6ff8f
fix: lint error
kyanokashi ea60bf0
refactor: improve code encapsulation and reduce duplication
kyanokashi 0cbc6f9
Merge branch 'main' into feat/sidecar/lmcache-connector/decode-first
kyanokashi fd43c17
refactor: rename and simplify SSE event signaling logic
kyanokashi 7030e38
refactor: rename lmcache to shared storage protocol
kyanokashi f84046a
Merge branch 'main' into feat/sidecar/lmcache-connector/decode-first
kyanokashi 64606e0
refactor: restructure proxy components in order to share protocol imp…
kyanokashi cb2cae1
fix: make request builder unopinionated over field types
kyanokashi b90ee02
refactor: use already defined keys
kyanokashi fbf2c17
Apply suggestions from code review
kyanokashi b315031
fix: remove unused function
kyanokashi fb20b7d
fix: return err also when http error response fails
kyanokashi 758fb78
Merge branch 'main' into refactor/sidecar/abstract-connector
kyanokashi aa6270a
Merge branch 'main' into refactor/sidecar/abstract-connector
kyanokashi 1e71083
refactor: various refactorings
kyanokashi 5fbab01
Apply suggestions from code review
kyanokashi aef9df1
refactor: rewrite function only used by tests as a test util
kyanokashi 36f9b2e
refactor: rename default request builder to shared storage request bu…
kyanokashi 0b8944a
chore: update copyright comments to year 2026
kyanokashi 050b1d7
Merge branch 'main' into refactor/sidecar/abstract-connector
kyanokashi 2490cf0
chore: remove pd-sidecar binary
kyanokashi 30559f5
Merge branch 'main' into refactor/sidecar/abstract-connector
kyanokashi db93a8d
docs(sidecar): add FIXME comments and document shared state
kyanokashi 3de2b43
refactor(sidecar): extract PDProxyManager interface
kyanokashi b19a041
refactor(sidecar): use PDProxyManager interface in runners
kyanokashi c150ae9
refactor(sidecar): export response writer types for testing
kyanokashi fab28a1
fix(sidecar): correct Write/WriteHeader order in mock handler
kyanokashi b580a7e
test(sidecar): add unit tests for request builders
kyanokashi 984b93e
test(sidecar): add unit tests for http_errors package
kyanokashi 081dd66
test(sidecar): add unit tests for response writers
kyanokashi 3c81eef
chore(sidecar): regenerate mocks for PDProxyManager interface
kyanokashi c854728
Merge branch 'main' into refactor/sidecar/abstract-connector
kyanokashi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,3 +39,4 @@ vendor | |
|
|
||
| # Build output | ||
| /build | ||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -309,15 +309,15 @@ func (av *AllowlistValidator) createPodInformer(poolName string, selector labels | |
| Group: "", | ||
| Version: "v1", | ||
| Resource: "pods", | ||
| }).Namespace(av.namespace).List(context.TODO(), options) | ||
| }).Namespace(av.namespace).List(context.TODO(), options) // FIXME: use stored context from Start() to respect shutdown | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: can you please extract TODO/FIXME from here and other files to a cleanup issue for awareness instead of keeping in the code? |
||
| }, | ||
| WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { | ||
| options.LabelSelector = selector.String() | ||
| return av.dynamicClient.Resource(schema.GroupVersionResource{ | ||
| Group: "", | ||
| Version: "v1", | ||
| Resource: "pods", | ||
| }).Namespace(av.namespace).Watch(context.TODO(), options) | ||
| }).Namespace(av.namespace).Watch(context.TODO(), options) // FIXME: use stored context from Start() to respect shutdown | ||
| }, | ||
| } | ||
|
|
||
|
|
@@ -363,7 +363,12 @@ func (av *AllowlistValidator) onPodDelete(obj interface{}) { | |
| av.rebuildAllowlist() | ||
| } | ||
|
|
||
| // rebuildAllowlist rebuilds the entire allowlist from current pod state | ||
| // rebuildAllowlist rebuilds the entire allowlist from current pod state. | ||
| // NOTE: This method acquires allowedTargetsMu then podInformersMu (RLock). | ||
| // There is a brief window where allowedTargets may be inconsistent with | ||
| // podInformers if a pod informer is being added/removed concurrently. | ||
| // This is acceptable because the allowlist is rebuilt on every pod event | ||
| // and will converge quickly. | ||
| func (av *AllowlistValidator) rebuildAllowlist() { | ||
| av.allowedTargetsMu.Lock() | ||
| defer av.allowedTargetsMu.Unlock() | ||
|
|
||
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could benefit from a specialized flag type (e.g., with validation and conversion to the type instead of "raw" string.