feat(iris): route actor RPC calls through proxy and decode responses#4161
feat(iris): route actor RPC calls through proxy and decode responses#4161ravwojdyla merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ebd049413
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| actor_name = field_values.get("actor_name") | ||
| if service_name == "actor" and actor_name: |
There was a problem hiding this comment.
Derive actor proxy header from parsed request body
actor_name is pulled only from field_values (CLI flags), so actor RPCs invoked via --json never set x-iris-actor-endpoint. In that path the proxy receives no routing header and returns 400 Missing x-iris-actor-endpoint, which makes the generic --json request mode unusable for actor methods (for example iris rpc actor call --json '{..."actor_name": ...}'). Read actor_name from the parsed request payload when --json is used.
Useful? React with 👍 / 👎.
rjpower
left a comment
There was a problem hiding this comment.
seems reasonable, but i might suggest that we special case actor calls as their own iris actor call <endpoint> <name> <args> instead. that would give us more flexibility to handle the serialization/pickle stuff and properly handle function arguments.
| which = response.WhichOneof("result") | ||
| if which == "serialized_value": | ||
| value = cloudpickle.loads(response.serialized_value) | ||
| return json.dumps(value, indent=2, default=str) |
There was a problem hiding this comment.
is value always json serializable? maybe just wrap in a try/except, fallback to repr
There was a problem hiding this comment.
according to claude yes, but will introduce separate cli per request and try/except
| def callback(ctx: click.Context, json_str: str | None, **kwargs): | ||
| controller_url = require_controller_url(ctx) | ||
| field_values = {k: v for k, v in kwargs.items() if v is not None} | ||
| request = build_request(method, json_str, field_values) |
There was a problem hiding this comment.
does build request do the right thing for actor calls?
There was a problem hiding this comment.
It did in my local tests
0a300f7 to
6afb6a0
Compare
Dedicated CLI command for actor RPCs instead of bolting onto the generic
rpc infrastructure. Handles auth, proxy header injection, cloudpickle
deserialization, and JSON kwargs naturally:
iris actor call /user/job/coord-0 get_counters
iris actor call /user/job/coord-0 get_counters '{"worker_id": "w-3"}'
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6afb6a0 to
20704ec
Compare
|
🤖 Validated the CLI against a live fuzzy dedup job on marin-dev. Examples: # Global counters (accumulated across all stages)
uv run iris --config lib/iris/examples/marin-dev.yaml actor call \
/rav/iris-run-reference_counter_test-20260326-013741/zephyr-fuzzy-dedup-03c3ddd9-p0-a0/zephyr-fuzzy-dedup-03c3ddd9-p0-coord-0 \
get_counters
# {"minhash/documents": 4039056, "minhash/buckets": 105015328}
# Per-worker counters (in-flight heartbeat snapshot)
uv run iris --config lib/iris/examples/marin-dev.yaml actor call \
/rav/.../zephyr-fuzzy-dedup-03c3ddd9-p0-coord-0 \
get_counters '{"worker_id": "zephyr-fuzzy-dedup-03c3ddd9-p0-workers-0"}'
# {"minhash/documents": 524288, "minhash/buckets": 13631488}
# Get job status
uv run iris --config lib/iris/examples/marin-dev.yaml actor call \
/rav/.../zephyr-fuzzy-dedup-03c3ddd9-p0-coord-0 \
get_statusPer-worker values diverge as expected (different shard sizes / processing speeds). Auth token is no longer leaked in logs. |
…4161) ## Summary - `iris rpc actor call --actor-name <full-name> --method-name <method>` now automatically sets the `x-iris-actor-endpoint` header, routing the call through the controller's actor proxy to the correct actor server - ActorResponse `serialized_value` is auto-unpickled so the CLI prints human-readable JSON instead of opaque base64 ### Example ```bash uv run iris --config lib/iris/examples/marin-dev.yaml rpc actor call \ --actor-name "/rav/my-job/zephyr-coord-0" \ --method-name get_counters # Output: { "minhash/documents": 7849813, "minhash/buckets": 204095138 } ``` ## Test plan - [x] Tested live against a running zephyr dedup job on marin-dev - [ ] Add unit test for `_format_actor_response` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Rafal Wojdyla <ravwojdyla@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
iris rpc actor call --actor-name <full-name> --method-name <method>now automatically sets thex-iris-actor-endpointheader, routing the call through the controller's actor proxy to the correct actor serverserialized_valueis auto-unpickled so the CLI prints human-readable JSON instead of opaque base64Example
Test plan
_format_actor_response🤖 Generated with Claude Code