Skip to content

[Serve] Add doc for serve model registry integration - #59080

Merged
abrarsheikh merged 21 commits into
masterfrom
13913-abrar-docs
Jan 7, 2026
Merged

abrarsheikh merged 21 commits into
masterfrom
13913-abrar-docs

Conversation

@abrarsheikh

@abrarsheikh abrarsheikh commented Dec 1, 2025 •

Copy link
Copy Markdown
Contributor

https://anyscale-ray--59080.com.readthedocs.build/en/59080/serve/model-registries.html

  • Add a e2e working example
  • add mlflow dependency in docs requirements
  • include tips for using model registries in production
  • Write A/B testing section with MLflow

fixes #13913

@abrarsheikh
abrarsheikh marked this pull request as ready for review December 1, 2025 18:51
@abrarsheikh
abrarsheikh requested review from a team as code owners December 1, 2025 18:51
Signed-off-by: abrar <[email protected]>
@abrarsheikh
abrarsheikh requested a review from a team as a code owner December 1, 2025 18:57

@aslonnie aslonnie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for dependency changes.

@ray-gardener ray-gardener Bot added serve Ray Serve Related Issue docs An issue or change related to documentation labels Dec 1, 2025
Signed-off-by: abrar <[email protected]>
Signed-off-by: abrar <[email protected]>
Comment thread doc/source/serve/model-registries.md Resolved
Comment thread doc/source/serve/model-registries.md Resolved
@abrarsheikh abrarsheikh added the go add ONLY when ready to merge, run all tests label Dec 2, 2025
abrarsheikh and others added 2 commits December 3, 2025 03:55
Signed-off-by: abrar <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
# Get the most recent production model and load it
model_row = models.iloc[0]
artifact_location = model_row["artifact_location"]
self.model = mlflow.sklearn.load_model(artifact_location)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Wrong API access pattern for MLflow search result

The code uses pandas DataFrame-style access (.empty, .iloc[0], ["artifact_location"]) on the result of mlflow.search_logged_models(). However, this MLflow 3.0+ API returns a PagedList[LoggedModel] or list of LoggedModel objects, not a pandas DataFrame. Lists don't have .empty or .iloc attributes, and LoggedModel objects use attribute access (e.g., model.artifact_location) rather than dictionary-style access. This will cause AttributeError at runtime when the deployment initializes.

Fix in Cursor Fix in Web

# __deployment_start__
from ray import serve
import mlflow.pyfunc
import numpy as np

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing mlflow import in deployment code block

The deployment code block imports mlflow.pyfunc on line 90, but line 98 uses mlflow.search_logged_models() which requires the base mlflow module. In Python, import mlflow.pyfunc does not make the bare mlflow namespace available. The full file works because import mlflow exists at line 8, but the documentation extracts only the __deployment_start__ to __deployment_end__ block. Users copying this example code will get a NameError: name 'mlflow' is not defined when running it.

Fix in Cursor Fix in Web

except Exception as e:
# Mark model as FAILED if issues occur
mlflow.finalize_logged_model(logged_model.model_id, LoggedModelStatus.FAILED)
raise

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exception handler may corrupt already-finalized model state

The error handling structure has a logic flaw. Line 70 calls finalize_logged_model with READY status, and lines 72-75 call set_logged_model_tags. Both are inside the try block. If set_logged_model_tags fails after the model is successfully finalized as READY, the except block on line 79 attempts to finalize the already-finalized model as FAILED. This is incorrect because the model was successfully registered - only the tagging failed. Additionally, calling finalize_logged_model on an already-finalized model may raise an exception, masking the original error. The finalization and tagging calls on lines 70-75 are logically post-success operations and belong outside the try block.

Fix in Cursor Fix in Web

@elliot-barn
elliot-barn requested a review from a team as a code owner January 5, 2026 19:10
@abrarsheikh

Copy link
Copy Markdown
Contributor Author

thanks @elliot-barn for all the help on this

@dstrodtman dstrodtman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stamp

@abrarsheikh
abrarsheikh merged commit 894f668 into master Jan 7, 2026
@abrarsheikh
abrarsheikh deleted the 13913-abrar-docs branch January 7, 2026 23:17
AYou0207 pushed a commit to AYou0207/ray that referenced this pull request Jan 13, 2026
elliot-barn added a commit that referenced this pull request Nov 11, 2026
…68040)

## Description

Brings the eMudhra CA compromise and aiohttp DoS fixes to
`releases/2.57.2`. They come from the 2.59.1 squash `fed97328bf`
(#67487: #67295, #67301, #67298, #67305, #67304, #67350), as on 2.58.2
(#67962).

This is the first of two stacked PRs that replace #68013. The Brotli
fixes are in the follow-up PR, which is based on this branch.

## How it was applied

A direct cherry-pick of `fed97328bf` conflicts in about 110 files,
nearly all locks, because 2.57 is two minors behind 2.59. So the source
changes are applied by hand and the locks are regenerated:

- **`docker/base-deps`, `docker/base-slim` Dockerfiles:** the same lines
as `fed97328bf` adds: certifi 2026.10.19 and pip 26.2.2 via conda, uv
pinned to 0.13.4, and pip from PyPI on py3.10.
- **Windows and macOS wheel builds:** pip 26.2.2 and uv 0.13.4.
- **`requirements.txt`, `test-requirements.txt`, `setup.py`:** aiohttp
floor 3.13.3 → 3.14.4.
- **`security-requirements.txt`:** adds aiohttp, certifi and virtualenv
floors.
- **`requirements_compiled.txt`, `requirements_compiled_py3.14.txt`:**
aiohttp 3.14.4, certifi 2026.10.19, virtualenv 21.14.12 with distlib,
packaging, python-discovery and typing-extensions, and yarl 1.25.1. The
version and hash blocks are taken from 2.58.2.
- **`requirements_compiled.txt`** regenerated with `ci/ci.sh
compile_pip_dependencies` (py3.11), so the `# via` lines match. No pins
move.
- **Locks:** regenerated with `raydepsets build --all-configs`. Some
locks aren't constrained by the compiled files: TPU base deps, ray-llm
testdeps, docbuild, datatfds, and the multimodal and llm_batch release
locks. In those, the bumped packages are set to the exact versions from
`releases/2.58.2` (virtualenv 21.14.12, distlib 0.4.3, filelock 3.29.0,
platformdirs 4.9.6, python-discovery 1.6.1, typing-extensions 4.16.0,
certifi 2026.10.19, aiohttp 3.14.4) before the regen, so they match the
source PRs instead of floating to the newest releases.
`large_image_embedding_py3.10.lock` is stale on 2.58.2, so it follows
its sibling multimodal locks.
- **`ray_img_py39.lock`:** certifi 2026.10.19, as on 2.58.2, 2.59.1 and
master. Nothing on 2.57.x builds or reads this lock (`#59484` removed
py3.9 and `#59080` re-added the file by accident), but it ships in the
tree.

**Not ported:** 2.59's pinned `RUNTIME_ENV_AGENT_PIP_PACKAGES` in
`setup.py`. On 2.57 the runtime env agent installs `aiohttp` unpinned.

**Left on old pins, same as 2.58.2 and master:** aiohttp, virtualenv and
yarl in `ray_img_py39.lock`, aiohttp in `ci_windows_depset.lock`,
`requirements_ml_byod_3.10.txt`, aiohttp in
`release/requirements_py310.txt`, and the doc pip-freeze snapshots.

## Related issues

Related to #67487 (2.59.1) and #67962 (2.58.2). Together with the Brotli
PR, this supersedes #68013.

## Testing

- `bazel run //ci/raydepsets:raydepsets -- build --all-configs --check`
passed: "Lock files are up to date."
- `ci/ci.sh compile_pip_dependencies` (py3.11): only `# via` lines
change.
- Every bumped package compared with `releases/2.58.2`: versions and
hashes match, except the intentionally updated `large_image_embedding`.
- No brotli line changes compared with `releases/2.57.2`.

AI assistance (Claude Code) was used to prepare this change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: elliot-barn <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs An issue or change related to documentation go add ONLY when ready to merge, run all tests serve Ray Serve Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[serve] Documentation on how to use model registries/feature stores

7 participants