Cephei Orleans

Server deployment of Cephei models using Orleans for Kubernetes deployment

Posted by steve on May 23, 2024

Forward

In an earlier post on the Cell Framework we described the paradigm of a Model as a collection of Cell that can be used as a class that industrialises a spreadsheet where values are guaranteed to be consistent with the underlying values that the formula is based on, but calculated in parallel. This matches well with a market scenario where any number of changes to underlying instruments can alter the value/price of calculations.

We showed that models can be built up from basic models (e.g. Floating Rate Bond) to represent models that include an entire portfolio of trades, which can then provide high-level values for continuous hedging and liquidity-driven risk appetite for near-real-time (where a SessionStream ensures that a fresh compute-intensive risk calculation does not start until the last session has completed).

Model and Cell provide IObervable/IObserver subscription for an event-stream Architecture, where events are passed between Nano-Servers through to active actors. Nano-Server is used here as a small block of logic that runs within a Micro-Service (modern Service Oriented Architecture ) that is itself deployed to a cluster of computers like Kubernetes. The Cell Framework is a building block for these kind of architecture.

Orleans

Within the realm of massive on-line gaming, Orleans provides a framework for Distributed Virtual Actors that run on a large number of load-balanced servers, where each Grain is a Nano-Server or Digital Twin for a remote device. Where Orleans is intended for millions of low-cost Nano-Services that cooperate, it also provides a rich hosting environment for scheduling any kind of work over massive clusters of Micro-Services, with production level telemetry and instrumentation.

Cephei.Orleans

The Cephei.Orleans Nuget Package will provide a Grain class ModelGrain<T> to host a Model within an Orleans cluster (e.g. ModelGrain<FloatingRateBond>) that can provide the fabric for real-time-risk. ModelGrain requires no changes to Cephei.Cell because Orleans also uses the asynchronous event-oriented model. Cephei.Cell directly support asynchronous notification through IObservable subscriptions with overlapping SessionStream to prevent blocking for continuous streams of data though the NanoService. Cephei.Orleans will provide all the plumbing to allow thousands of Models to collaborate in a managed compute-fabric.

Enterprise Architecture

While an event-fabric appears to be a complex graph of objects that cannot be presented within the document set needed for management and regulatory reporting, Enterprise Lineage can be simply demonstrated using UML trace-relationships and automatic derivation through an Enterprise Hub

Cephie.QL

Cephei.Orleans will be released with the upcoming update to the [Cephei.QL] wrapper around the latest version of Quantlib together with the Cephei.Excel Excel addin that enables the development of F# models using Microsoft Excel as an editor