# evsio0n/slurm-web architecture

> Architecture diagram of the GitHub repository evsio0n/slurm-web, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/evsio0n/slurm-web
- Repository: https://github.com/evsio0n/slurm-web

## Overview

Slurm-web is a browser-based HPC cluster console; this fork adds an engineer-oriented job workbench with live logs, checks, diagnostics, and GPU telemetry. The main workflow runs from a user’s browser through the gateway to a per-cluster agent and Slurm, then presents scheduler and job data in frontend views. The graph preserves documented authentication, cluster visualization, caching, and metrics capabilities. Live protocol details come from the README and sampled frontend code; backend live-handler wiring was not sampled, so those internal links are limited to documented relationships.

Main entry points: [`frontend/src/views`](https://github.com/evsio0n/slurm-web/tree/main/frontend/src/views) (Cluster and job views), [`slurmweb/views/agent.py`](https://github.com/evsio0n/slurm-web/blob/main/slurmweb/views/agent.py) (Agent routes), [`slurmweb/apps/gateway.py`](https://github.com/evsio0n/slurm-web/blob/main/slurmweb/apps/gateway.py) (Gateway application), [`frontend/src/components/job/JobPipelineConsole.vue`](https://github.com/evsio0n/slurm-web/blob/main/frontend/src/components/job/JobPipelineConsole.vue) (Job workbench)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser console"]
  node_frontend_app["Vue application<br/>[main.ts]"]
  node_views["Cluster and job views"]
  node_job_console["Job workbench"]
  node_live_socket["Live job socket"]
  node_gateway_api["Gateway API client<br/>[GatewayAPI.ts]"]
  node_runtime_store["Runtime state"]
end

subgraph group_gateway["Gateway and identity"]
  node_gateway_app["Gateway application<br/>[gateway.py]"]
  node_gateway_views["Gateway routes<br/>[gateway.py]"]
  node_auth_views["Authentication routes"]
end

subgraph group_agent["Cluster agent"]
  node_agent_app["Agent application<br/>[agent.py]"]
  node_agent_views["Agent routes<br/>[agent.py]"]
  node_restd_client["Slurm REST client"]
  node_gpu_collector["GPU snapshot collector"]
end

subgraph group_operations["State and observability"]
  node_cache[("Transparent cache<br/>[cache.py]")]
  node_metrics["Metrics collection"]
end

node_user(("Cluster user"))
node_identity["LDAP / OIDC provider"]
node_slurm["Slurm cluster"]
node_job_files[("Job output and events")]
node_prometheus["Prometheus"]
node_cluster_topology[("Cluster topology data")]

node_user -->|"uses"| node_frontend_app
node_frontend_app -->|"routes to"| node_views
node_views -->|"requests data"| node_gateway_api
node_views -->|"updates state"| node_runtime_store
node_views -->|"opens job"| node_job_console
node_job_console -->|"fetches job data"| node_gateway_api
node_job_console -->|"starts live session"| node_live_socket
node_live_socket -->|"opens WebSocket"| node_gateway_app
node_gateway_api -->|"sends API requests"| node_gateway_app
node_gateway_app -->|"dispatches routes"| node_gateway_views
node_gateway_views -->|"forwards cluster requests"| node_agent_app
node_gateway_app -->|"dispatches auth"| node_auth_views
node_auth_views -.->|"authenticates"| node_identity
node_agent_app -->|"dispatches routes"| node_agent_views
node_agent_views -->|"queries scheduler"| node_restd_client
node_restd_client -->|"calls REST API"| node_slurm
node_agent_views -->|"reads job artifacts"| node_job_files
node_gpu_collector -->|"correlates job allocation"| node_slurm
node_gpu_collector -->|"writes GPU snapshots"| node_job_files
node_agent_views -->|"reads live events"| node_job_files
node_gateway_views -.->|"uses cache"| node_cache
node_agent_views -.->|"uses cache"| node_cache
node_metrics -.->|"collects metrics"| node_slurm
node_prometheus -.->|"scrapes metrics"| node_metrics
node_views -->|"visualizes topology"| node_cluster_topology

click node_frontend_app "https://github.com/evsio0n/slurm-web/blob/main/frontend/src/main.ts"
click node_views "https://github.com/evsio0n/slurm-web/tree/main/frontend/src/views"
click node_job_console "https://github.com/evsio0n/slurm-web/blob/main/frontend/src/components/job/JobPipelineConsole.vue"
click node_live_socket "https://github.com/evsio0n/slurm-web/blob/main/frontend/src/composables/useJobLiveSocket.ts"
click node_gateway_api "https://github.com/evsio0n/slurm-web/blob/main/frontend/src/composables/GatewayAPI.ts"
click node_runtime_store "https://github.com/evsio0n/slurm-web/tree/main/frontend/src/stores/runtime"
click node_gateway_app "https://github.com/evsio0n/slurm-web/blob/main/slurmweb/apps/gateway.py"
click node_gateway_views "https://github.com/evsio0n/slurm-web/blob/main/slurmweb/views/gateway.py"
click node_auth_views "https://github.com/evsio0n/slurm-web/tree/main/slurmweb/views/auth"
click node_agent_app "https://github.com/evsio0n/slurm-web/blob/main/slurmweb/apps/agent.py"
click node_agent_views "https://github.com/evsio0n/slurm-web/blob/main/slurmweb/views/agent.py"
click node_restd_client "https://github.com/evsio0n/slurm-web/tree/main/slurmweb/slurmrestd"
click node_gpu_collector "https://github.com/evsio0n/slurm-web/blob/main/contrib/slurm-web-gpu-snapshot.py"
click node_cache "https://github.com/evsio0n/slurm-web/blob/main/slurmweb/cache.py"
click node_metrics "https://github.com/evsio0n/slurm-web/tree/main/slurmweb/metrics"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frontend_app,node_views,node_job_console,node_live_socket,node_gateway_api,node_runtime_store,node_user toneBlue
class node_gateway_app,node_gateway_views,node_auth_views,node_job_files,node_cluster_topology toneAmber
class node_agent_app,node_agent_views,node_restd_client,node_gpu_collector toneMint
class node_cache,node_metrics toneRose
class node_identity,node_slurm,node_prometheus toneIndigo
```

## Components

### Browser console

- [Vue application](https://github.com/evsio0n/slurm-web/blob/main/frontend/src/main.ts): `frontend/src/main.ts`
- [Cluster and job views](https://github.com/evsio0n/slurm-web/tree/main/frontend/src/views): `frontend/src/views`
- [Job workbench](https://github.com/evsio0n/slurm-web/blob/main/frontend/src/components/job/JobPipelineConsole.vue): `frontend/src/components/job/JobPipelineConsole.vue`
- [Live job socket](https://github.com/evsio0n/slurm-web/blob/main/frontend/src/composables/useJobLiveSocket.ts): `frontend/src/composables/useJobLiveSocket.ts`
- [Gateway API client](https://github.com/evsio0n/slurm-web/blob/main/frontend/src/composables/GatewayAPI.ts): `frontend/src/composables/GatewayAPI.ts`
- [Runtime state](https://github.com/evsio0n/slurm-web/tree/main/frontend/src/stores/runtime): `frontend/src/stores/runtime`

### Gateway and identity

- [Gateway application](https://github.com/evsio0n/slurm-web/blob/main/slurmweb/apps/gateway.py): `slurmweb/apps/gateway.py`
- [Gateway routes](https://github.com/evsio0n/slurm-web/blob/main/slurmweb/views/gateway.py): `slurmweb/views/gateway.py`
- [Authentication routes](https://github.com/evsio0n/slurm-web/tree/main/slurmweb/views/auth): `slurmweb/views/auth`

### Cluster agent

- [Agent application](https://github.com/evsio0n/slurm-web/blob/main/slurmweb/apps/agent.py): `slurmweb/apps/agent.py`
- [Agent routes](https://github.com/evsio0n/slurm-web/blob/main/slurmweb/views/agent.py): `slurmweb/views/agent.py`
- [Slurm REST client](https://github.com/evsio0n/slurm-web/tree/main/slurmweb/slurmrestd): `slurmweb/slurmrestd`
- [GPU snapshot collector](https://github.com/evsio0n/slurm-web/blob/main/contrib/slurm-web-gpu-snapshot.py): `contrib/slurm-web-gpu-snapshot.py`

### State and observability

- [Transparent cache](https://github.com/evsio0n/slurm-web/blob/main/slurmweb/cache.py): `slurmweb/cache.py`
- [Metrics collection](https://github.com/evsio0n/slurm-web/tree/main/slurmweb/metrics): `slurmweb/metrics`

### Other components

- **Cluster user**
- **LDAP / OIDC provider**
- **Slurm cluster**
- **Job output and events**
- **Prometheus**
- **Cluster topology data**

## Connections

- Cluster user → Vue application: uses
- Vue application → Cluster and job views: routes to
- Cluster and job views → Gateway API client: requests data
- Cluster and job views → Runtime state: updates state
- Cluster and job views → Job workbench: opens job
- Job workbench → Gateway API client: fetches job data
- Job workbench → Live job socket: starts live session
- Live job socket → Gateway application: opens WebSocket
- Gateway API client → Gateway application: sends API requests
- Gateway application → Gateway routes: dispatches routes
- Gateway routes → Agent application: forwards cluster requests
- Gateway application → Authentication routes: dispatches auth
- Authentication routes → LDAP / OIDC provider: authenticates
- Agent application → Agent routes: dispatches routes
- Agent routes → Slurm REST client: queries scheduler
- Slurm REST client → Slurm cluster: calls REST API
- Agent routes → Job output and events: reads job artifacts
- GPU snapshot collector → Slurm cluster: correlates job allocation
- GPU snapshot collector → Job output and events: writes GPU snapshots
- Agent routes → Job output and events: reads live events
- Gateway routes → Transparent cache: uses cache
- Agent routes → Transparent cache: uses cache
- Metrics collection → Slurm cluster: collects metrics
- Prometheus → Metrics collection: scrapes metrics
- Cluster and job views → Cluster topology data: visualizes topology
