Skip to content

Add endpoint build logs and server logs retrieval tools#414

Open
jralfonsog wants to merge 2 commits intodatabricks-solutions:mainfrom
jralfonsog:feat/serving-logs
Open

Add endpoint build logs and server logs retrieval tools#414
jralfonsog wants to merge 2 commits intodatabricks-solutions:mainfrom
jralfonsog:feat/serving-logs

Conversation

@jralfonsog
Copy link
Copy Markdown

Summary

  • Build logs: get_serving_endpoint_build_logs() retrieves container image creation output, dependency installation, and model download steps — essential for debugging failed or stuck deployments
  • Server logs: get_serving_endpoint_server_logs() retrieves recent stdout/stderr from the model server, including inference processing and runtime errors
  • Auto-resolve served_model_name: Both APIs require a served_model_name param that users rarely know. When omitted, it's auto-resolved from the endpoint's first served entity via get() — zero friction for single-model endpoints

Changes

Layer File What changed
Core serving/endpoints.py +2 functions + _resolve_served_model_name helper, added ResourceDoesNotExist/NotFound imports
Core serving/__init__.py Export new functions
MCP tools/serving.py +2 @mcp.tool(timeout=30) wrappers
Tests tests/unit/test_serving_logs.py 8 unit tests (explicit/auto-resolve, not-found, empty logs)

SDK methods wrapped

Tool SDK Method REST Endpoint
get_serving_endpoint_build_logs build_logs(name, served_model_name) GET /api/2.0/serving-endpoints/{name}/served-models/{model}/build-logs
get_serving_endpoint_server_logs logs(name, served_model_name) GET /api/2.0/serving-endpoints/{name}/served-models/{model}/logs

Test plan

  • 8 unit tests pass (explicit model name, auto-resolve, not-found, empty logs, wrong model)
  • Ruff lint + format pass (line-length=120, py311)
  • Integration tested against aws-fe workspace (ac_demo-demo_data-sklearn_model-serving-endpoint)
  • Auto-resolve correctly picks sklearn_model-21 from endpoint config
  • Not-found returns clear error message

This pull request was AI-assisted by Isaac

- Docstrings: opening """ on its own line
- Returns sections: bullet list format for dict keys

Co-authored-by: Isaac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant