Add Instance resource agent, dashboards, and resource reporting integration#108
Closed
zhy1658858023 wants to merge 1 commit into
Closed
Add Instance resource agent, dashboards, and resource reporting integration#108zhy1658858023 wants to merge 1 commit into
zhy1658858023 wants to merge 1 commit into
Conversation
zhy1658858023
commented
Jul 15, 2026
zhy1658858023
left a comment
Collaborator
Author
There was a problem hiding this comment.
I do not recommend merging this PR in its current form.
Main blockers:
-
The branch is stale and diverged from current
main.codex/instanceisbehind_by=101relative tomainandmergeable=false.- Please rebase/update from current
mainand make the diff a clean increment for Issue #107 only.
-
Scope is much larger than Issue #107.
- Issue #107 asks for Proxy pool-level resource aggregation and Proxy -> Scheduler reporting.
- This PR also adds a Rust Instance Resource Agent, Instance dashboards, and a standalone reporter. Those are outside the requested scope and appear to duplicate earlier resource-monitoring/dashboard work.
- Please remove these out-of-scope additions from this PR unless there is a separate issue explicitly asking for them.
-
proxy/resource/p_control_plane.pyappears to reintroduce stale liveness behavior.- The added instance-list serialization still uses
"is_alive": True if not include_dead else None. - For
include_dead=true, the UI/debug path needs real TTL-derived liveness, notNone.
- The added instance-list serialization still uses
-
The resource snapshot API shape is narrower than the existing/desired reporting path.
- The reporter sends only
{instance_id, snapshot}. - Please preserve any existing metadata fields and avoid regressing resource-report observability.
- The reporter sends only
-
The core #107 path should remain lightweight and backward compatible:
- Proxy builds a compact
pool_resourcefromInstancePool. - Proxy sends it in register/heartbeat payloads.
- Scheduler stores it per Proxy.
- Scheduler exposes
/debug/proxy_pool_resources. - No Scheduler routing policy changes, no Proxy selection changes, no KDN/KVCache/IWS/Instance forwarding changes.
- Proxy builds a compact
Please redo this as a clean branch from latest main, with only the pool-resource aggregation/reporting changes plus minimal docs/validation notes.
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.
Motivation
Description
instance/resource_agent/src/main.rs) that samples CPU/memory/network/GPU and exposes HTTP endpointsGET /healthzandGET /v1/resource/snapshot, plusCargo.toml/Cargo.lockfor the agent.instance/resource_agent/proxy_reporter.pythat fetches the local agent snapshot andPOSTs it to the Proxy control plane atPOST /v1/instance/resource_snapshot.instance/resource_dashboard/dashboard_server.py), a Tkinter desktop app (instance/resource_dashboard/dashboard_app.py), and static frontend assets (static/index.html,static/app.js,static/style.css) for visualizing instance snapshots and controlling a managed agent process.POST /v1/instance/resource_snapshotand debug endpoints inproxy/resource/p_control_plane.py, store per-instanceInstanceResourceand computebuild_pool_resource_snapshotinproxy/resource/instance_pool.py, and propagatepool_resourcein proxy register/heartbeat flows viaproxy/sclient/scheduler_client.py.ProxyPoolto accept and exposepool_resourceon proxy registration/heartbeat and add debug APIs inscheduler/resource/control_plane.pyandscheduler/resource/proxy_pool.pyto surface reported pool resources.Testing
Codex Task