1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Example Docker Compose configuration for all-smi with Rebellions NPU support
# This demonstrates how to properly mount host /proc for PID mapping
version: '3.8'
services:
all-smi-monitor:
image: all-smi:latest
build:
context: ..
dockerfile: Dockerfile
command:
privileged: true # Required for NPU device access
pid: host # Alternative: use host PID namespace
volumes:
# Mount host /proc for PID mapping when running in container namespace
- /proc:/host/proc:ro
# Mount NPU device files
- /dev:/dev
environment:
# Tell all-smi where to find host proc
HOST_PROC_PATH: /host/proc
devices:
# Rebellions NPU devices
- /dev/rbln0
- /dev/rbln1
- /dev/rbln2
- /dev/rbln3
# API mode for Prometheus metrics
all-smi-api:
image: all-smi:latest
command:
ports:
- "9090:9090"
privileged: true
volumes:
- /proc:/host/proc:ro
- /dev:/dev
devices:
- /dev/rbln0
- /dev/rbln1
- /dev/rbln2
- /dev/rbln3
# Example with PID namespace sharing (simpler but less isolated)
all-smi-shared-pid:
image: all-smi:latest
command:
pid: host # Share host PID namespace - PIDs will match
privileged: true
volumes:
- /dev:/dev
devices:
- /dev/rbln0
- /dev/rbln1
- /dev/rbln2
- /dev/rbln3