Repository navigation
Conversation
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
…t ingress servers for direct_http Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
…lated to current PR changes. Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
Signed-off-by: Celina Yang <[email protected]>
eicherseiji
left a comment
There was a problem hiding this comment.
Thanks Celina! A few comments. Also, let's make sure _direct_http is included in DeploymentVersion and deployment change comparisons so that redeploys restart the relevant replicas.
| # version advances and its port is reclaimed on the next reconcile. See | ||
| # consume_ingress_membership_removed. | ||
| self._ingress_membership_removed: bool = False | ||
| # Set when a replica that may own direct-ingress ports is permanently |
There was a problem hiding this comment.
These non-root deployments (which start HTTP servers and own ports) are not technically "ingress" so I think we should just call this _direct_http_port_owner_removed. WDYT?
There was a problem hiding this comment.
Or maybe something like this
owns_direct_ports = ingress or ingress_request_router or direct_http
| return ( | ||
| self.is_ingress() | ||
| or self.is_ingress_request_router() | ||
| or self.is_direct_http() |
There was a problem hiding this comment.
Could we have owns_direct_ingress_ports just return is_direct_http and make sure true ingress (root deployment) and ingress request routers have this property set
| if ( | ||
| not self._ingress | ||
| and not self._is_ingress_request_router | ||
| and not self._direct_http |
There was a problem hiding this comment.
Similar to https://github.com/ray-project/ray/pull/66255/changes#r4077717419, could we just check self._direct_http here?
|
|
||
| `_build_app_recursive` re-invokes `options()` on every deployment to assign | ||
| names and bind args, which reconstructs the `Deployment`. Without an explicit | ||
| carry-forward in `options()`, the flag would be silently dropped here and the |
There was a problem hiding this comment.
The test reads as a general happy path test (that's great!) but the comment makes it seem specific. Which is it?
| # In direct ingress mode, hold the replica open at least | ||
| # RAY_SERVE_DIRECT_INGRESS_MIN_DRAINING_PERIOD_S so load balancers can | ||
| # deregister it; the drain also waits for in-flight requests. | ||
| is_direct_ingress = RAY_SERVE_ENABLE_DIRECT_INGRESS and self._ingress |
There was a problem hiding this comment.
Could we check direct http here instead?
|
|
||
| deployment_config = DeploymentConfig.from_proto_bytes(deployment_config_proto_bytes) | ||
|
|
||
| if ingress and RAY_SERVE_ENABLE_DIRECT_INGRESS: |
There was a problem hiding this comment.
Also an opportunity to check direct http here instead?
| # that need to be pruned. | ||
| if ( | ||
| self.owns_direct_ingress_ports() | ||
| or replica.actor_http_port is not None |
There was a problem hiding this comment.
It seems that if a direct http replica is stopped in the period between port allocation in NodePortManager and actor_http_port being set in initialize_and_get_metadata, this check will return False, but the port will remain allocated.
To simplify things, can we retain some information about whether the replica was started with direct http and check that here instead?
|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
|
This pull request has been automatically closed because there has been no more activity in the 14 days Please feel free to reopen or open a new pull request if you'd still like this to be addressed. Again, you can always ask for help on our discussion forum or Ray's public slack channel. Thanks again for your contribution! |
## Description This PR makes the `lint: API param coverage` step a required check by removing `soft_fail: true`. The step was added in #64788 on 2026-08-11. A comment in the step said to remove `soft_fail` "once the false-positive rate is confirmed low." This PR measures that rate from the step's CI history and fixes the four failure patterns the history turned up. While the step only warns, undocumented parameters still land on master. #65633, #66602, and #66950 all merged with the check failing. ### Warn-phase metrics These numbers come from every `premerge` build from 2026-08-11 to 2026-10-29, pulled from the Buildkite API. | | Runs | PRs | |---|--:|--:| | Completed runs of the step | 3,453 | | | Passed | 3,398 | | | Failed | 55 | 23 | | Canceled, which isn't a check outcome | 211 | | Each failure falls into one of three groups: | Failure type | PRs | Runs | Detail | |---|--:|--:|---| | Correct finding | 15 | 42 | A new parameter on a `@PublicAPI` callable has no `Args:` entry. Two of these PRs, #65823 and #65839, were stacked on #65633 before it merged and report its findings again. | | False positive | 3 | 4 | #64399 flagged the `v` argument of a pydantic `@field_validator`. #66255 flagged the private kwarg `_direct_http`. #67258 flagged an option of the `ray start` Click command, which `help=` documents. | | Infrastructure | 5 | 9 | The step printed `could not determine merge-base` and no findings. The branches of #65437 and #65809 forked 520 and 598 master commits before their builds. The step's `git fetch --depth=500` makes the full CI clone shallow, so their merge-base wasn't in the fetched history. | That's 13 spurious failures out of 3,453 runs, about 0.4%, or 13 of 55 failures. Each one would block a PR once the step is required, so this PR fixes all four patterns before removing `soft_fail`. ### Changes - **`_`-prefixed parameters:** `api_param_coverage.py` skips parameters whose names start with `_`. That's Ray's convention for private kwargs, such as `ray.put(_owner=...)`, `tune.run(_remote=...)`, and `Deployment.options(_internal=...)`. On master, 31 public callables have such parameters. - **Pydantic validators and Click commands:** The script skips callables decorated with `field_validator`, `model_validator`, `validator`, `root_validator`, `command`, or `group`. On master, this removes 59 callables from scope. All of them are Click commands, such as `ray start` and `ray job submit`, or pydantic validators on Serve config models. None of them is a Python API whose parameters a docstring documents. - **Property setters:** The script also skips callables decorated with `@<name>.setter`. A setter's `value` is documented on the property's getter, which is the docstring Sphinx renders, not in an `Args:` section of its own. - **Shallow-clone merge-base:** When `git merge-base` fails after the depth-500 fetch, `ci/lint/lint.sh` runs `git fetch --unshallow` and retries. A branch within 500 commits of the base never reaches that path. The Python check still fails closed if the base can't be resolved after that. - **Step definition:** `.buildkite/lint.rayci.yml` drops `soft_fail: true` and the warn-phase comment. The `--blocking` help text in `cmd_check_api_param_coverage.py` no longer describes a warn phase. ## Related issues Follow-up to #64788. ## Additional information ### Testing - `pytest ci/ray_ci/doc/test_api_param_coverage.py`: 40 passed. That's the 28 existing tests plus 12 new cases covering `_` params, each validator spelling, Click command forms, and property setters. The test comments name the real PR that motivated each one. - **Replay against real PRs:** I ran the master and patched versions of the check against the exact commit and base of every failing run in each of the 18 PRs with findings. Master reproduces all 18 failures. The patched check passes #64399, #66255, and #67258, and reports the same findings as master on the other 15. - **Merge-base fix:** In a local repo with 600 commits on `master` and a branch forked at commit 50, `git fetch --depth=500` followed by `git merge-base` fails, which reproduces the CI failure. With the new `lint.sh` block, it resolves the correct fork commit. A branch forked 10 commits back resolves without the fallback. - `pre-commit run` on the changed files passes, including ruff, black, shellcheck, and docstyle. ### Duplicate check `gh pr list --state open --search "param coverage"` and `--search "api_param_coverage"` return no open PR that touches this check. The script hasn't changed since #65391 on 2026-08-14. ### AI assistance I used Claude Code to pull and classify the Buildkite history, draft the changes, and run the replay. I reviewed every changed line and the classification of every failing PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Why this is needed
Later in the stack, HAProxy routes requests directly to downstream
LLMServerreplicas, not just the application ingress. Today only the ingress deployment and its request router start a replica-local HTTP server. This PR adds a per-deployment_direct_httpflag so a non-ingress deployment can opt in to its own HTTP server and port. Routing to the port follows in the stack.Summary
_direct_httpoption toDeployment.options()direct_httptoDeploymentArgsandDeploymentInfoinserve.protoand thread it through deploy args, client, controller, andDeploymentInfoserialization_maybe_start_direct_ingress_serversstart the HTTP server for_direct_httpreplicas; gRPC stays ingress-only_direct_httpdeployments inowns_direct_ingress_ports()so the controller tracks their portsTest plan
python/ray/serve/tests/unit/test_build_app.pypython/ray/serve/tests/unit/test_deployment_info.pyto includedirect_httpflagpython/ray/serve/tests/unit/test_deployment_state.pypython/ray/serve/tests/test_direct_ingress.pyExample usage
This PR adds the private
_direct_httpoption toDeployment.options(). A non-ingress child can opt in to a replica-local HTTP listener while the parent remains the application ingress:At this point in the stack, the model replica owns an HTTP port but HAProxy does not route to it yet. PRs 2 and 3 publish that port and add deployment-specific routing.