# o-ran-sc/nonrtric architecture

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

- Interactive diagram: https://gitdiagram.com/o-ran-sc/nonrtric
- Repository: https://github.com/o-ran-sc/nonrtric

## Overview

##### Project Type and Purpose
- This is a microservices‐based, containerized orchestration platform (Non-RT RIC) for O-RAN, implemented in Go, Java and Python. It provides non‐real‐time RAN policy and AI/ML model management via A1 interfaces, orchestrates message flows over DMaaP (Kafka), and exposes services via Kubernetes/Helm/Istio.

##### File Structure
- Top‐level directories:
- `.github`, `.releases`, CI/CD and release manifests (Helm charts & container/K8s YAML).
- `auth-token-fetch`: a Go microservice fetching auth tokens.
- `docker-compose`: local dev/test environments for each microservice (A1 sim, DMaaP sim, policy framework, ICS, RAPP, SDNC, etc.).
- `docs`: Sphinx documentation and design guidance.
- `sample-services`: stand-alone example R-APPs (hello-world, ICS producer/consumer) with Docker, Helm charts.
- `service-exposure`: Go CLI and K8s/Istio/Keycloak/Cert-Manager scripts and Helm charts for exposing services.
- `test`: automated shell/python test harnesses, simulators, certificate generators.

- Key patterns:
- Microservices communicate via Kafka (DMaaP) topics.
- A1 Controller and policy management services expose REST/gRPC A1 interfaces.
- A policy-framework uses Drools/XACML PDPs.
- Helm charts for Kubernetes packaging.
- Istio Gateway + MutatingWebhookConfiguration for secure ingress with Keycloak and JWT.

##### README for Additional Insights
- Confirms focus on non-real-time RIC functions: policy optimization, AI/ML model distribution, coordination with Near-RT RIC.
- No monolithic UI—pure back-end services.

a. Main Components
- Non-RT RIC Microservices:
- A1-Controller
- A1-Policy-Management-Service
- Policy-Agent
- Enrichment Coordinator
- Information Coordinator
- R-APP Catalogue Controller
- O-DU Slice Assurance, O-RU Closed-Loop Consumer/Recovery
- Auth-Token-Fetch Service
- Message Bus: DMaaP (Kafka) topics for events in/out.
- Policy Framework: Drools PDP, XACML PDP, database (embedded or external).
- External Systems:
- Near-RT RIC (A1 interface).
- SDNC, O-Cloud, O-CAPIF.
- Keycloak for auth/OIDC.
- Service Exposure Layer:
- Istio Gateway, VirtualService, EnvoyFilter.
- Kubernetes Ingress + JWT Authentication Webhook.
- Sample R-APPs: example producer/consumer apps.

b. Relationships and Interactions
- Near-RT RIC ←→ A1-Controller (REST/gRPC).
- A1-Controller → A1-Policy-Management → Policy-Agent → DMaaP (publish policies).
- Enrichment Coordinator subscribes DMaaP → processes → publishes enriched data.
- Information Coordinator collects jobs from DMaaP → stores/forwards to R-APPs.
- R-APP Catalogue Controller manages R-APP registrations → policy updates.
- Auth-Token-Fetch provides JWTs to microservices for secure calls.
- Service Exposure Layer front-ends A1 and sample-service APIs to external clients, using Istio + Keycloak.
- Policy Framework PDPs invoked by Policy-Agent via HTTP or gRPC.

c. Architectural Patterns & Principles
- Microservices communicating asynchronously via pub/sub.
- API Gateway (Istio) and sidecar proxies enforcing security policies.
- Helm chart packaging for K8s deployment and Rollback.
- Separation of concerns: ingestion, coordination, policy management, exposure.

d. Relevant Technologies
- Go, Java Spring Boot, Python (test harness), Kafka/DMaaP, Docker, Helm, Kubernetes, Istio, Keycloak, Drools/XACML PDP, GitHub Actions / Gerrit CI.

## Diagram (Mermaid)

```mermaid
graph TD
    %% CI/CD Layer
    subgraph "CI/CD Pipeline"
        GitHubActions["GitHub Actions"]:::ci
        ContainerRegistry["Container Registry"]:::ci
        HelmManager["Helm Manager"]:::ci
    end

    GitHubActions -->|push artifacts| ContainerRegistry
    ContainerRegistry -->|publish charts| HelmManager

    %% External Systems
    subgraph "External Systems"
        NearRT_RIC["Near-RT RIC"]:::external
        SDNC["SDNC"]:::external
        OCloud["O-Cloud"]:::external
        OCAPIF["O-CAPIF"]:::external
    end

    %% Core Non-RT RIC Services
    subgraph "Core Non-RT RIC Services"
        A1_Controller["A1-Controller"]:::core
        A1_Policy_Management["A1-Policy-Management-Service"]:::core
        Policy_Agent["Policy-Agent"]:::core
        Enrichment_Coordinator["Enrichment Coordinator Service"]:::core
        Information_Coordinator["Information Coordinator Service"]:::core
        RAPP_Catalogue["R-APP Catalogue Controller"]:::core
        ODU_Slice["O-DU Slice Assurance"]:::core
        ORU_Consumer["O-RU Closed-Loop Consumer"]:::core
        ORU_Recovery["O-RU Closed-Loop Recovery"]:::core
        Auth_Token_Fetch["Auth-Token-Fetch Service"]:::core
    end

    %% Message Bus
    subgraph "DMaaP (Kafka) Message Bus"
        DMaaP_Adaptor["DMaaP Adaptor (Kafka)"]:::bus
        DMaaP_Producer["DMaaP Mediator Producer"]:::bus
    end

    %% Policy Framework
    subgraph "Policy Framework"
        PDP["Drools/XACML PDP"]:::policy
    end

    %% Service Exposure
    subgraph "Service Exposure Layer"
        Istio_Gateway["Istio Gateway"]:::exposure
        VirtualService_JWT["VirtualService & JWT Webhook"]:::exposure
        Keycloak_OIDC["Keycloak OIDC Configuration"]:::exposure
        Cert_Manager["Certificate Management"]:::exposure
    end

    %% Sample & Test
    subgraph "Examples & Testing"
        Sample_RAPPs["Sample R-APPs"]:::sample
        Test_Harness["Automated Test Harness & Simulators"]:::test
    end

    %% CI/CD Deployment
    HelmManager -->|deploy charts| Istio_Gateway
    HelmManager -->|deploy charts| A1_Controller
    HelmManager -->|deploy charts| A1_Policy_Management
    HelmManager -->|deploy charts| Policy_Agent

    %% External synchronous interactions
    NearRT_RIC -->|REST/gRPC| A1_Controller
    A1_Controller -->|REST/gRPC| A1_Policy_Management
    A1_Policy_Management -->|HTTP/gRPC| Policy_Agent
    Policy_Agent -->|invoke PDP| PDP

    %% Asynchronous pub/sub
    Policy_Agent -->|Kafka publish| DMaaP_Adaptor
    Enrichment_Coordinator -->|Kafka publish| DMaaP_Producer
    DMaaP_Adaptor -->|Kafka subscribe| Enrichment_Coordinator
    DMaaP_Adaptor -->|Kafka subscribe| Information_Coordinator
    Information_Coordinator -->|forward| Sample_RAPPs

    %% R-APP Catalogue and Policy updates
    RAPP_Catalogue -->|manage registrations| A1_Policy_Management

    %% Auth service
    Auth_Token_Fetch -->|provide JWT| A1_Controller
    Auth_Token_Fetch -->|provide JWT| A1_Policy_Management
    Auth_Token_Fetch -->|provide JWT| Policy_Agent

    %% Service Exposure
    Istio_Gateway -->|route| A1_Controller
    Istio_Gateway -->|route| Sample_RAPPs
    VirtualService_JWT -->|apply auth| Istio_Gateway
    Keycloak_OIDC -->|OIDC| VirtualService_JWT
    Cert_Manager -->|TLS certs| Istio_Gateway

    %% External connections
    SDNC -->|A1 policies| A1_Controller
    OCloud -->|capabilities| Information_Coordinator
    OCAPIF -->|service calls| A1_Controller

    %% Sample & Test harness interactions
    Test_Harness -->|simulate DMaaP| DMaaP_Adaptor
    Test_Harness -->|simulate services| A1_Controller

    %% Click Events
    click A1_Controller "https://github.com/o-ran-sc/nonrtric/blob/master/.releases/container-release-nonrtric-a1-controller.yaml"
    click A1_Policy_Management "https://github.com/o-ran-sc/nonrtric/blob/master/.releases/container-release-nonrtric-a1-policy-management-service.yaml"
    click Policy_Agent "https://github.com/o-ran-sc/nonrtric/blob/master/.releases/container-release-nonrtric-policy-agent.yaml"
    click Enrichment_Coordinator "https://github.com/o-ran-sc/nonrtric/blob/master/.releases/container-release-nonrtric-enrichment-coordinator-service.yaml"
    click Information_Coordinator "https://github.com/o-ran-sc/nonrtric/blob/master/.releases/container-release-nonrtric-information-coordinator-service.yaml"
    click RAPP_Catalogue "https://github.com/o-ran-sc/nonrtric/blob/master/.releases/container-release-nonrtric-r-app-catalogue-controller.yaml"
    click ODU_Slice "https://github.com/o-ran-sc/nonrtric/blob/master/.releases/container-release-nonrtric-o-du-slice-assurance.yaml"
    click ORU_Consumer "https://github.com/o-ran-sc/nonrtric/blob/master/.releases/container-release-nonrtric-o-ru-closed-loop-consumer.yaml"
    click ORU_Recovery "https://github.com/o-ran-sc/nonrtric/blob/master/.releases/container-release-nonrtric-o-ru-closed-loop-recovery.yaml"
    click Auth_Token_Fetch "https://github.com/o-ran-sc/nonrtric/tree/master/auth-token-fetch/"
    click DMaaP_Adaptor "https://github.com/o-ran-sc/nonrtric/blob/master/.releases/container-release-nonrtric-dmaap-adaptor.yaml"
    click DMaaP_Producer "https://github.com/o-ran-sc/nonrtric/blob/master/.releases/container-release-nonrtric-dmaap-mediator-producer.yaml"
    click PDP "https://github.com/o-ran-sc/nonrtric/tree/master/docker-compose/docker-compose-policy-framework/"
    click Istio_Gateway "https://github.com/o-ran-sc/nonrtric/blob/master/service-exposure/IstioOperator.yaml"
    click VirtualService_JWT "https://github.com/o-ran-sc/nonrtric/blob/master/service-exposure/MutatingWebhookConfiguration.yaml"
    click Keycloak_OIDC "https://github.com/o-ran-sc/nonrtric/blob/master/service-exposure/keycloak.yaml"
    click Cert_Manager "https://github.com/o-ran-sc/nonrtric/tree/master/service-exposure/"
    click Sample_RAPPs "https://github.com/o-ran-sc/nonrtric/tree/master/sample-services/"
    click Test_Harness "https://github.com/o-ran-sc/nonrtric/tree/master/test/"
    click HelmManager "https://github.com/o-ran-sc/nonrtric/blob/master/.releases/container-release-nonrtric-helm-manager.yaml"

    %% Styles
    classDef core fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef policy fill:#FFA500,stroke:#333,stroke-width:1px
    classDef exposure fill:#90EE90,stroke:#333,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef bus fill:#FFFF00,stroke:#333,stroke-width:1px
    classDef ci fill:#E6E6FA,stroke:#333,stroke-width:1px
    classDef sample fill:#FFFACD,stroke:#333,stroke-width:1px
    classDef test fill:#F0F0F0,stroke:#333,stroke-width:1px
```
