# martimy/network-automation-and-observability architecture

> Architecture diagram of the GitHub repository martimy/network-automation-and-observability, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/martimy/network-automation-and-observability
- Repository: https://github.com/martimy/network-automation-and-observability

## Overview

##### Project type and purpose
- This is a network-automation lab environment demonstrating multi-vendor automation and observability in a leaf-spine data-center fabric.
- It uses Containerlab to spin up six router containers (two Nokia SR Linux spines and four NVIDIA Cumulus Linux leaves) and shows how to drive them via gNMI/YANG and NVUE REST API.

##### File structure
- Top-level tutorials (Markdown) describe lab setup and the network-automation tutorial.
- Configuration files:
- topology.clab.yml – container topology definition
- inventory.yaml, ansible.cfg, requirements.yaml – Ansible inventory and dependencies
- extract.sh – helper script for extracting or preparing artifacts
- No separate “src” or “frontend/backend” directories—this is a lab playground focused on automation scripts and platform interactions.

##### Key insights from the README
- Lab topology: two spines + four leaves connected in a leaf/spine fabric.
- Management network: 192.168.121.0/24 across all containers.
- Automation interfaces:
- Spines: Nokia SR Linux via gNMI (YANG) driven by tools like `gnmic`.
- Leaves: Cumulus Linux via NVUE REST API driven by `curl` or Ansible.
- Future phases: unified automation framework, CI/CD, observability—though Phase 1 is direct device interaction.

##### Main components
a. Containerlab Fabric
- Spine1 (Nokia SR Linux)
- Spine2 (Nokia SR Linux)
- Leaf1–Leaf4 (NVIDIA Cumulus Linux)
- Interconnect lines showing leaf-to-spine links in a classic leaf/spine mesh.
b. Management Network
- A network cloud labeled “Mgmt Network: 192.168.121.0/24”
c. Automation Layer
- Ansible (inventory.yaml, ansible.cfg, requirements.yaml)
- gnmic (gNMI CLI)
- curl (NVUE REST calls)
- extract.sh (helper script)
d. External References

##### Architectural patterns and design principles
- Physical-logical separation: data-plane (leaf/spine fabric) vs. control/management-plane (Mgmt Network + automation).
- Multi-vendor abstraction: one toolchain (Ansible + gNMI + REST) driving two different NOS.
- Container-based virtualization for reproducibility and isolation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External References
    Blog["Blog & Docs"]:::external
    LabSetup["Tutorial - Lab Setup.md"]:::external
    NetAutoTutorial["Tutorial - Network Automation with Nokia SR Linux and Cumulus Linux.md"]:::external

    %% Automation Layer
    subgraph "Automation & Observability Tools"
        direction TB
        Ansible["Ansible"]:::automation
        GNMIcli["gnmic (gNMI CLI)"]:::automation
        Curl["curl (NVUE REST)"]:::automation
        Extract["extract.sh"]:::automation
        Inventory["inventory.yaml"]:::automation
        Config["ansible.cfg"]:::automation
        Requirements["requirements.yaml"]:::automation
        CLabCLI["Containerlab CLI"]:::automation
    end

    %% Management Network
    MgmtNet["Mgmt Network: 192.168.121.0/24"]:::network

    %% Containerlab Fabric
    subgraph "Containerlab Fabric"
        direction TB
        Spine1["Spine1 (Nokia SR Linux)"]:::srl
        Spine2["Spine2 (Nokia SR Linux)"]:::srl
        Leaf1["Leaf1 (Cumulus Linux)"]:::cumulus
        Leaf2["Leaf2 (Cumulus Linux)"]:::cumulus
        Leaf3["Leaf3 (Cumulus Linux)"]:::cumulus
        Leaf4["Leaf4 (Cumulus Linux)"]:::cumulus

        %% Data-plane links
        Spine1 --- Leaf1
        Spine1 --- Leaf2
        Spine1 --- Leaf3
        Spine1 --- Leaf4
        Spine2 --- Leaf1
        Spine2 --- Leaf2
        Spine2 --- Leaf3
        Spine2 --- Leaf4
    end

    %% Control/Config Flows
    Ansible -->|"ssh/gNMI"| MgmtNet
    GNMIcli -->|"gNMI"| MgmtNet
    Curl -->|"REST API"| MgmtNet
    Extract --> CLabCLI
    CLabCLI -.->|"clab deploy/destroy"| ContainerlabFabric

    MgmtNet --> Spine1
    MgmtNet --> Spine2
    MgmtNet --> Leaf1
    MgmtNet --> Leaf2
    MgmtNet --> Leaf3
    MgmtNet --> Leaf4

    %% File attachments
    ContainerlabFabric((Containerlab Fabric))
    Topology["topology.clab.yml"]:::config
    ContainerlabFabric --- Topology

    %% Layout connections
    Blog --> Ansible
    LabSetup --> Blog
    NetAutoTutorial --> Blog

    %% Click Events
    click Topology "https://github.com/martimy/network-automation-and-observability/blob/main/topology.clab.yml"
    click Inventory "https://github.com/martimy/network-automation-and-observability/blob/main/inventory.yaml"
    click Config "https://github.com/martimy/network-automation-and-observability/blob/main/ansible.cfg"
    click Requirements "https://github.com/martimy/network-automation-and-observability/blob/main/requirements.yaml"
    click Extract "https://github.com/martimy/network-automation-and-observability/blob/main/extract.sh"
    click Blog "https://github.com/martimy/network-automation-and-observability/blob/main/README.md"
    click LabSetup "https://github.com/martimy/network-automation-and-observability/blob/main/Tutorial - Lab Setup.md"
    click NetAutoTutorial "https://github.com/martimy/network-automation-and-observability/blob/main/Tutorial - Network Automation with Nokia SR Linux and Cumulus Linux.md"

    %% Styles
    classDef srl fill:#FFCCCC,stroke:#CC0000,color:#660000
    classDef cumulus fill:#CCE5FF,stroke:#004A99,color:#003366
    classDef automation fill:#E6FFCC,stroke:#99CC00,color:#336600
    classDef network fill:#CCF2FF,stroke:#00AACC,color:#005566
    classDef external fill:#F2E6FF,stroke:#9933CC,color:#660066
    classDef config fill:#FFF2CC,stroke:#CCA300,color:#665500
```
