# nv-morpheus/morpheus-experimental architecture

> Architecture diagram of the GitHub repository nv-morpheus/morpheus-experimental, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nv-morpheus/morpheus-experimental
- Repository: https://github.com/nv-morpheus/morpheus-experimental

## Overview

##### Main Components
a. Source Repository (GitHub)
– Contains: .github (issue/pr templates, workflows), CI scripts, Docker scripts, setup.cfg.
– Central hub for code, configuration, and templates.
b. CI/CD Subsystem
– ci/conda_env (environments), ci/scripts (linting, tests, release).
– Automates environment creation, code checks, version bumps, packaging.
c. Containerization Layer
– docker/Dockerfile, docker/build_container.sh, docker/run_container.sh, entrypoint.
– Builds and launches a GPU‐enabled container image with Morpheus Experimental.
d. Prototype Modules (one per subdirectory)
– ai-credit-fraud-workflow, anomalous-auth-detection, appshield-dga-detection, …, string-resemblance-grouping.
– Each module includes:
- datasets/ (sample or links)
- models/ (trained artifacts, ONNX/PyTorch/TensorFlow)
- training-tuning (scripts + tutorial notebooks + requirements)
- inference (standalone scripts + requirements)
- optionally morpheus-pipeline (preprocessing, run.py, Triton repo, config.pbtxt)
- documentation (README.md, docs/).
e. Runtime Environment
– Developer workstation or GPU cluster with Docker Engine + NVIDIA GPU drivers + Git LFS.
– Jupyter notebooks for ad-hoc exploration.
f. Morpheus Pipeline Orchestrator
– Within each prototype’s morpheus-pipeline, a sequence of stages (e.g., create_feature.py, preprocessing.py, run.py, Triton inference stage).
– Interacts with the Triton Inference Server (for ONNX models) if present.

##### Relationships and Data Flows
– Developers push code → GitHub → triggers CI workflows → builds/testing.
– On successful CI, Docker build_pipeline.sh produces a runtime image.
– Developer pulls or runs container → enters an isolated environment.
– Within container:
- Choose a prototype directory → pip install -r requirements.txt → data ingestion from datasets/
- Execute training notebook or script → outputs model artifacts → written to models/
- Execute inference script or Morpheus pipeline → loads model + datasets → runs preprocessing → model inference → postprocessing → outputs results.
– Optional: Push trained models to a model registry or external storage.
– Each morpheus-pipeline uses NVIDIA Triton Server for ONNX models, passing data from preprocessing through Triton → returns predictions to downstream stages.

##### Architectural Patterns and Design Principles
– Monorepo pattern: all prototypes in a single repository sharing CI and container build.
– Modular design: each prototype is self-contained, enabling adding/removing without affecting others.
– Containerization: isolates environment, ensures reproducibility, enforces GPU requirements.
– CI/CD pipelines: enforce code quality, environment consistency, version control.
– Pipeline orchestration (Morpheus): stage‐based processing, pluggable components, integration with Triton.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Actions
    subgraph "Developer Actions"
        Dev["Developer"]:::developer
    end

    %% Source & CI
    subgraph "Source & CI"
        GH["GitHub Repo"]:::sourceci
        CI["CI/CD Subsystem"]:::sourceci
    end

    %% Container Environment
    subgraph "Container Environment"
        DockerImage["Docker Image"]:::container
    end

    %% Prototype Execution
    subgraph "Prototype Execution"
        aiCredit["ai-credit-fraud-workflow"]:::prototype
        anomalousAuth["anomalous-auth-detection"]:::prototype
        appshieldDGA["appshield-dga-detection"]:::prototype
        assetClust["asset-clustering"]:::prototype
        cyberFound["cyber-foundation"]:::prototype
        dgaDetect["dga-detection"]:::prototype
        gnnAsset["gnn-asset-clustering"]:::prototype
        gnnNetflow["gnn-netflow-ad"]:::prototype
        idsDetect["ids-detection"]:::prototype
        logSeq["log-sequence-ad"]:::prototype
        opTech["operational-technology"]:::prototype
        phishingURL["phishing-url-detection"]:::prototype
        stringResemble["string-resemblance-grouping"]:::prototype
    end

    %% External Services
    subgraph "External Services"
        TritonServer["Triton Inference Server"]:::external
        ModelRegistry["Model Registry"]:::external
        DataStorage["Data Storage"]:::external
    end

    %% Connections
    Dev -->|git push| GH
    GH -->|triggers CI workflows| CI
    CI -->|docker build| DockerImage
    DockerImage -->|run container| Dev
    DockerImage -->|install & run| aiCredit
    DockerImage -->|install & run| anomalousAuth
    DockerImage -->|install & run| appshieldDGA
    DockerImage -->|install & run| assetClust
    DockerImage -->|install & run| cyberFound
    DockerImage -->|install & run| dgaDetect
    DockerImage -->|install & run| gnnAsset
    DockerImage -->|install & run| gnnNetflow
    DockerImage -->|install & run| idsDetect
    DockerImage -->|install & run| logSeq
    DockerImage -->|install & run| opTech
    DockerImage -->|install & run| phishingURL
    DockerImage -->|install & run| stringResemble

    aiCredit -->|reads sample data| DataStorage
    anomalousAuth -->|reads sample data| DataStorage
    appshieldDGA -->|reads sample data| DataStorage
    assetClust -->|reads sample data| DataStorage
    cyberFound -->|reads sample data| DataStorage
    dgaDetect -->|reads sample data| DataStorage
    gnnAsset -->|reads sample data| DataStorage
    gnnNetflow -->|reads sample data| DataStorage
    idsDetect -->|reads sample data| DataStorage
    logSeq -->|reads sample data| DataStorage
    opTech -->|reads sample data| DataStorage
    phishingURL -->|reads sample data| DataStorage
    stringResemble -->|reads sample data| DataStorage

    aiCredit -->|writes model| ModelRegistry
    anomalousAuth -->|writes model| ModelRegistry
    appshieldDGA -->|writes model| ModelRegistry
    assetClust -->|writes model| ModelRegistry
    cyberFound -->|writes model| ModelRegistry
    dgaDetect -->|writes model| ModelRegistry
    gnnAsset -->|writes model| ModelRegistry
    gnnNetflow -->|writes model| ModelRegistry
    idsDetect -->|writes model| ModelRegistry
    logSeq -->|writes model| ModelRegistry
    opTech -->|writes model| ModelRegistry
    phishingURL -->|writes model| ModelRegistry
    stringResemble -->|writes model| ModelRegistry

    appshieldDGA -->|infer via pipeline| TritonServer
    dgaDetect -->|infer via pipeline| TritonServer
    phishingURL -->|infer via pipeline| TritonServer

    %% Click Events
    click GH "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//.github/"
    click CI "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//ci/scripts/"
    click DockerImage "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//docker/Dockerfile"
    click aiCredit "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//ai-credit-fraud-workflow/"
    click anomalousAuth "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//anomalous-auth-detection/"
    click appshieldDGA "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//appshield-dga-detection/"
    click assetClust "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//asset-clustering/"
    click cyberFound "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//cyber-foundation/"
    click dgaDetect "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//dga-detection/"
    click gnnAsset "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//gnn-asset-clustering/"
    click gnnNetflow "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//gnn-netflow-ad/"
    click idsDetect "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//ids-detection/"
    click logSeq "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//log-sequence-ad/"
    click opTech "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//operational-technology/"
    click phishingURL "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//phishing-url-detection/"
    click stringResemble "https://github.com/nv-morpheus/morpheus-experimental/tree/branch-25.06//string-resemblance-grouping/"

    %% Styles
    classDef developer fill:#AEDFF7,stroke:#333,stroke-width:1px
    classDef sourceci fill:#B3D7A4,stroke:#333,stroke-width:1px
    classDef container fill:#F7D6A0,stroke:#333,stroke-width:1px
    classDef prototype fill:#F2A1A1,stroke:#333,stroke-width:1px
    classDef external fill:#CCCCCC,stroke:#333,stroke-width:1px
```
