Repository navigation
feat(analytics): Integrate ONNX Runtime and TensorFlow Serving (Issue #1476) - #2760
Merged
Merged
Conversation
…1476) Add ml_serving.h / ml_serving.cpp implementing a unified MLServingClient abstraction that wraps both ONNX Runtime (THEMIS_HAS_ONNX) and TensorFlow Serving REST (THEMIS_HAS_TF_SERVING + THEMIS_HAS_CURL) backends. Key changes: - include/analytics/ml_serving.h: MLTensor, MLServingRequest/Response, IMLServingBackend, ONNXServingBackend, TFServingBackend, MLServingClient - src/analytics/ml_serving.cpp: production implementation with graceful degradation when backends are absent at compile time - cmake/Dependencies.cmake: ONNX Runtime auto-detection via find_package, THEMIS_ENABLE_TF_SERVING option - tests/analytics/test_ml_serving.cpp: 30 unit tests covering both the available and unavailable code paths - src/analytics/ROADMAP.md: mark Issue #1476 resolved - src/analytics/README.md: document component #14 (ML Serving Integration) Co-authored-by: makr-code <[email protected]>
Co-authored-by: makr-code <[email protected]>
Copilot
AI
changed the title
[WIP] Integrate ONNX Runtime and TensorFlow Serving in analytics module
feat(analytics): Integrate ONNX Runtime and TensorFlow Serving (Issue #1476)
Feb 24, 2026
…runtime Code audit found that ml_serving.cpp was not wired into either build system configuration: - cmake/ModularBuild.cmake: add ml_serving.cpp to THEMIS_QUERY_SOURCES and add conditional onnxruntime::onnxruntime to query module deps - cmake/CMakeLists.txt: add ml_serving.cpp to THEMIS_CORE_SOURCES and add conditional target_link_libraries for onnxruntime::onnxruntime - tests/analytics/test_ml_serving.cpp: remove unused-variable warning by inlining the isBackendAvailable() call directly into EXPECT macros Co-authored-by: makr-code <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a production-ready ML serving abstraction to the analytics module, wiring two external inference backends — ONNX Runtime (in-process) and TensorFlow Serving (REST) — behind a single thread-safe
MLServingClientAPI.New files
include/analytics/ml_serving.h— Public API:MLTensor,MLServingRequest/Response,IMLServingBackendextension interface,ONNXServingBackend,TFServingBackend,MLServingClientsrc/analytics/ml_serving.cpp— Implementation; gracefulUNAVAILABLEdegradation when backends are absent at compile timetests/analytics/test_ml_serving.cpp— 36 tests; all pass regardless of which backends are compiled inBuild system
cmake/Dependencies.cmake—find_package(onnxruntime)→ auto-setsTHEMIS_HAS_ONNX=1; newTHEMIS_ENABLE_TF_SERVINGoption for TF Serving REST backendcmake/ModularBuild.cmake—ml_serving.cppadded toTHEMIS_QUERY_SOURCES; conditionalonnxruntime::onnxruntimedep on query modulecmake/CMakeLists.txt—ml_serving.cppadded toTHEMIS_CORE_SOURCES; conditionaltarget_link_librariesfor onnxruntimeKey design points
MLBackendType::AUTOprefers ONNX Runtime, falls back to TF ServinginferFromDataPoint()bridges directly to the existingDataPointtype: numeric fields sorted alphabetically →{1, N}float32 input tensor/v1/models/<name>:predict, optional bearer auth, configurable timeout<model_directory>/<name>.onnx, optional CUDA EPType of Change
Testing
📚 Research & Knowledge (wenn applicable)
/docs/research/angelegt?/docs/research/implementation_influence/eingetragen?Relevante Quellen:
Checklist
Original prompt
This section details on the original issue you should resolve
<issue_title>[analytics] Integrate ONNX Runtime and TensorFlow Serving</issue_title>
<issue_description># [analytics] Integrate ONNX Runtime and TensorFlow Serving
Summary
Implementation Context
Open Issues: TODOs: 0, Stubs: 1Implementation Phases
Phase 1: Core Analytics Engine (Status: Completed )
analytics/olap_engine.cpp)analytics/exporters/)Phase 2: Streaming & Incremental Analytics (Status: In Progress )
analytics/cep_engine.cpp(Target: Q2 2026)analytics/streaming_window.cpp(Target: Q2 2026)Phase 3: Distributed & ML-Augmented Analytics (Status: Planned )
Related Work
Scope Boundary
Mandatory Delivery Workflow (ThemisDB Rules)
Implementation Tasks
analytics/olap_engine.cpp)analytics/exporters/)analytics/cep_engine.cpp(Target: Q2 2026)analytics/streaming_window.cpp(Target: Q2 2026)Acceptance Criteria
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.