Morpheus includes a number of pre-defined stage implementations to choose from when building a custom pipeline, each of which can be included and configured to suit your application.
There are likely going to be situations that require writing a custom stage. Morpheus stages are written in Python and optionally may include a C++ implementation. The following guides outline how to create your own stages in both Python and C++.
- Simple Python Stage
- Real-World Application: Phishing Detection
- Simple C++ Stage
- Creating a C++ Source Stage
Note: The code for the above guides can be found in the
examples/developer_guide
directory of the Morpheus repository. To build the C++ examples, pass-DMORPHEUS_BUILD_EXAMPLES=ON
to CMake when building Morpheus. Users building Morpheus with the providedscripts/compile.sh
script can do do by setting theCMAKE_CONFIGURE_EXTRA_ARGS
environment variable:CMAKE_CONFIGURE_EXTRA_ARGS="-DMORPHEUS_BUILD_EXAMPLES=ON" ./scripts/compile.sh
Morpheus includes, as of version 23.03, a number of pre-defined module implementations to choose from when building a custom pipeline. Modules can be thought of as units of work, which exist at a lower level than stages. Modules can be defined, registered, chained, nested, and loaded at runtime. Modules can be written in Python or C++.
There are likely going to be situations that require writing a custom module, either for creating your own reusable work units, or for creating a new compound module from a set of existing primitives. The following guides will walk through the process of creating a custom module in Python and C++.