Repository navigation
[Serve] Add doc for serve model registry integration - #59080
Conversation
Signed-off-by: abrar <[email protected]>
Signed-off-by: abrar <[email protected]>
Signed-off-by: abrar <[email protected]>
aslonnie
left a comment
There was a problem hiding this comment.
for dependency changes.
Signed-off-by: abrar <[email protected]>
Signed-off-by: abrar <[email protected]>
Signed-off-by: abrar <[email protected]>
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) |
There was a problem hiding this comment.
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.
Signed-off-by: abrar <[email protected]>
Signed-off-by: abrar <[email protected]>
| # __deployment_start__ | ||
| from ray import serve | ||
| import mlflow.pyfunc | ||
| import numpy as np |
There was a problem hiding this comment.
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.
| except Exception as e: | ||
| # Mark model as FAILED if issues occur | ||
| mlflow.finalize_logged_model(logged_model.model_id, LoggedModelStatus.FAILED) | ||
| raise |
There was a problem hiding this comment.
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.
Signed-off-by: abrar <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
|
thanks @elliot-barn for all the help on this |
Signed-off-by: abrar <[email protected]>
Signed-off-by: jasonwrwang <[email protected]>
…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]>
https://anyscale-ray--59080.com.readthedocs.build/en/59080/serve/model-registries.html
fixes #13913