[MP] Introduce MP runtime plugin framework#2956
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a multiprocess runtime plugin framework, including the new MPRuntimePluginLauncher class and integration into the cache server and HTTP server lifecycles. It also extends the server configuration to support plugin locations via CLI arguments. Feedback indicates that the new feature lacks required unit tests and design documentation. Additionally, several functions, including the new launcher's constructor and the updated run_cache_server implementations, require updated type hints and docstrings to comply with the project's style guide.
|
@sammshen @chunxiaozheng Would you like to take a look at this PR? Thanks! |
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
|
particularly for MP mode, now that we are introducing the LMCache CLI, I believe modification to the internals of the Configs or running sidecars should be done through that interface. Using Kubernetes as an example, I think that etcd is only interfaced through kube api server and controllers and scheduler and kubelet all change the cluster through a controlled interface. in the future, maybe we could start with a super concrete design of which existing modules a brand new feature will plug into with a clear definition of inputs and outputs? |
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit adec2fb. Configure here.

What this PR does / why we need it:
Special notes for your reviewers:
If applicable:
Note
Medium Risk
Adds optional subprocess launching during server startup/shutdown and changes plugin filtering/env-var behavior (including
PYTHONUNBUFFERED), which could impact deployments that rely on runtime plugins.Overview
Adds an MP-mode runtime plugin framework that can launch
.py/.shscripts alongside the multiprocess server, passing an aggregated JSON config blob viaLMCACHE_RUNTIME_PLUGIN_CONFIG.This introduces
RuntimePluginConfigand new CLI flags (--runtime-plugin-locations,--runtime-plugin-config) in MP config parsing, wires plugin lifecycle intomultiprocess/http_server.pystartup/shutdown via a newMPRuntimePluginLauncher, and updates the baseRuntimePluginLauncherto supportrole=None(disabling role/worker filename filtering) and to force unbuffered Python output for real-time log capture. Docs, examples, and unit tests are added to document and validate the MP launcher behavior.Reviewed by Cursor Bugbot for commit 67d201a. Bugbot is set up for automated code reviews on this repo. Configure here.