# apache/yunikorn-core architecture

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

- Interactive diagram: https://gitdiagram.com/apache/yunikorn-core
- Repository: https://github.com/apache/yunikorn-core

## Overview

##### Main Components

a) Core Components (Central Focus):
- Scheduler Core (pkg/scheduler)
- Resource Manager Proxy (pkg/rmproxy)
- Web Service (pkg/webservice)
- Event System (pkg/events)

b) Supporting Components:
- Configuration Management (pkg/common/configs)
- Security/ACL System (pkg/common/security)
- Metrics Collection (pkg/metrics)
- Plugin System (pkg/plugins)

**┌─────────────────────────────────────────────────────┐**
- External Systems                   │
- (Kubernetes, YARN, or other orchestrators)       │
- ┤
- Resource Manager Proxy            │
- ┤

- Scheduler Core                    │
- ┌─────────────┐  ┌──────────────┐  ┌──────────┐   │
- Placement  │  │  Partition   │  │  Objects  │   │
- Engine    │  │   Manager    │  │          │   │
- ┘  └──────────────┘  └──────────┘   │

- ┤
- Events System         │      Metrics System      │
- ┤
- Web Service                     │
- ┘

##### Key Relationships to Highlight

a) Data Flow:
- External System → RM Proxy → Scheduler Core
- Scheduler Core → Events System
- Web Service ← All Components (for monitoring)

b) Component Interactions:
- How the placement engine interacts with nodes and applications
- Event flow through the system
- Metrics collection points

##### Important Details

a) Scheduler Core Internals:
- Placement Rules System
- Queue Management
- Application Management
- Node Management
- Resource Tracking

b) Supporting Features:
- Security/ACL System
- Configuration Management
- Plugin Architecture
- Health Checking System

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Systems Layer
    subgraph ExternalSystems["External Systems"]
        K8s["Kubernetes"]
        YARN["YARN"]
        Other["Other Orchestrators"]
    end

    %% Resource Manager Proxy Layer
    subgraph RMProxy["Resource Manager Proxy"]
        RMP["RM Proxy Core"]:::rmproxy
        RMEvents["RM Events"]:::rmproxy
    end

    %% Scheduler Core Layer
    subgraph SchedulerCore["Scheduler Core"]
        PE["Placement Engine"]:::scheduler
        PM["Partition Manager"]:::scheduler
        OM["Objects Management"]:::scheduler
    end

    %% Support Systems Layer
    subgraph SupportSystems["Support Systems"]
        direction TB
        ES["Event System"]:::events
        MS["Metrics System"]:::metrics
        PS["Plugin System"]:::plugins
        CM["Configuration Management"]:::config
        SS["Security/ACL System"]:::security
    end

    %% Web Service Layer
    subgraph WebService["Web Service"]
        WS["Web Service Core"]:::webservice
        DAO["Data Access Objects"]:::webservice
        RH["Request Handlers"]:::webservice
    end

    %% Relationships
    K8s & YARN & Other --> RMP
    RMP --> RMEvents
    RMP --> PE
    PE --> PM
    PE --> OM
    PE --> ES
    PE --> MS
    PM --> MS
    OM --> MS
    ES --> WS
    MS --> WS
    PS --> SchedulerCore
    CM --> SchedulerCore
    SS --> SchedulerCore

    %% Styles
    classDef scheduler fill:#2374ab
    classDef rmproxy fill:#57b8ff
    classDef events fill:#ffd166
    classDef metrics fill:#f4d35e
    classDef webservice fill:#78c091
    classDef plugins fill:#98c1d9
    classDef config fill:#bee1e6
    classDef security fill:#cddafd

    %% Click Events
    click PE "https://github.com/apache/yunikorn-core/tree/master/pkg/scheduler/placement/"
    click PM "https://github.com/apache/yunikorn-core/blob/master/pkg/scheduler/partition_manager.go"
    click OM "https://github.com/apache/yunikorn-core/tree/master/pkg/scheduler/objects/"
    click RMP "https://github.com/apache/yunikorn-core/tree/master/pkg/rmproxy/"
    click RMEvents "https://github.com/apache/yunikorn-core/tree/master/pkg/rmproxy/rmevent/"
    click WS "https://github.com/apache/yunikorn-core/tree/master/pkg/webservice/"
    click DAO "https://github.com/apache/yunikorn-core/tree/master/pkg/webservice/dao/"
    click RH "https://github.com/apache/yunikorn-core/blob/master/pkg/webservice/handlers.go"
    click ES "https://github.com/apache/yunikorn-core/tree/master/pkg/events/"
    click CM "https://github.com/apache/yunikorn-core/tree/master/pkg/common/configs/"
    click SS "https://github.com/apache/yunikorn-core/tree/master/pkg/common/security/"
    click MS "https://github.com/apache/yunikorn-core/tree/master/pkg/metrics/"
    click PS "https://github.com/apache/yunikorn-core/tree/master/pkg/plugins/"

    %% Legend
    subgraph Legend
        direction TB
        L1["Scheduler Components"]:::scheduler
        L2["RM Proxy Components"]:::rmproxy
        L3["Event System"]:::events
        L4["Metrics System"]:::metrics
        L5["Web Service"]:::webservice
        L6["Plugin System"]:::plugins
        L7["Configuration"]:::config
        L8["Security"]:::security
    end
```
