surucucu 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- surucucu/__init__.py +13 -0
- surucucu/__main__.py +5 -0
- surucucu/assets/icon.png +0 -0
- surucucu/assets/icon.svg +71 -0
- surucucu/cli.py +126 -0
- surucucu/monitor.py +1301 -0
- surucucu-0.1.0.dist-info/METADATA +132 -0
- surucucu-0.1.0.dist-info/RECORD +11 -0
- surucucu-0.1.0.dist-info/WHEEL +5 -0
- surucucu-0.1.0.dist-info/entry_points.txt +2 -0
- surucucu-0.1.0.dist-info/top_level.txt +1 -0
surucucu/__init__.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Surucucu - Amazonian AI & Dev Observability Cockpit for Linux.
|
|
3
|
+
|
|
4
|
+
High-performance Glassmorphic HUD monitoring:
|
|
5
|
+
- NVIDIA GPU (VRAM allocation, CUDA cores, PCIe throughput, memory bus, thermals)
|
|
6
|
+
- Docker containers streaming stats & process inspection
|
|
7
|
+
- AI & Dev runtime classifications (LLM, Ollama, PyTorch, Langfuse, Node, Python)
|
|
8
|
+
- System metrics (CPU, RAM, SWAP, Disks)
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
__app_name__ = "surucucu"
|
|
12
|
+
__version__ = "0.1.0"
|
|
13
|
+
__author__ = "Erik"
|
surucucu/__main__.py
ADDED
surucucu/assets/icon.png
ADDED
|
Binary file
|
surucucu/assets/icon.svg
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128">
|
|
2
|
+
<defs>
|
|
3
|
+
<!-- Gradiente de fundo estilo vidro escuro -->
|
|
4
|
+
<linearGradient id="bgGrad" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
5
|
+
<stop offset="0%" stop-color="#1e1e2e" />
|
|
6
|
+
<stop offset="50%" stop-color="#11111b" />
|
|
7
|
+
<stop offset="100%" stop-color="#0b0b12" />
|
|
8
|
+
</linearGradient>
|
|
9
|
+
|
|
10
|
+
<!-- Gradiente de borda iluminada (Glass rim light) -->
|
|
11
|
+
<linearGradient id="borderGrad" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
12
|
+
<stop offset="0%" stop-color="#38bdf8" stop-opacity="0.8" />
|
|
13
|
+
<stop offset="50%" stop-color="#818cf8" stop-opacity="0.3" />
|
|
14
|
+
<stop offset="100%" stop-color="#c084fc" stop-opacity="0.7" />
|
|
15
|
+
</linearGradient>
|
|
16
|
+
|
|
17
|
+
<!-- Gradiente do pulso de recursos (Barras de RAM/CPU/GPU) -->
|
|
18
|
+
<linearGradient id="meterGrad1" x1="0%" y1="100%" x2="0%" y2="0%">
|
|
19
|
+
<stop offset="0%" stop-color="#059669" />
|
|
20
|
+
<stop offset="100%" stop-color="#34d399" />
|
|
21
|
+
</linearGradient>
|
|
22
|
+
<linearGradient id="meterGrad2" x1="0%" y1="100%" x2="0%" y2="0%">
|
|
23
|
+
<stop offset="0%" stop-color="#0284c7" />
|
|
24
|
+
<stop offset="100%" stop-color="#38bdf8" />
|
|
25
|
+
</linearGradient>
|
|
26
|
+
<linearGradient id="meterGrad3" x1="0%" y1="100%" x2="0%" y2="0%">
|
|
27
|
+
<stop offset="0%" stop-color="#6366f1" />
|
|
28
|
+
<stop offset="100%" stop-color="#a855f7" />
|
|
29
|
+
</linearGradient>
|
|
30
|
+
|
|
31
|
+
<!-- Brilho Glow Filter -->
|
|
32
|
+
<filter id="glow" x="-20%" y="-20%" width="140%" height="140%">
|
|
33
|
+
<feGaussianBlur stdDeviation="3" result="blur" />
|
|
34
|
+
<feComposite in="SourceGraphic" in2="blur" operator="over" />
|
|
35
|
+
</filter>
|
|
36
|
+
</defs>
|
|
37
|
+
|
|
38
|
+
<!-- Fundo com cantos arredondados modernos (Squircle) -->
|
|
39
|
+
<rect x="8" y="8" width="112" height="112" rx="26" fill="url(#bgGrad)" stroke="url(#borderGrad)" stroke-width="2.5" />
|
|
40
|
+
|
|
41
|
+
<!-- Reflexo de luz na parte superior do vidro -->
|
|
42
|
+
<path d="M 12,34 C 12,20 20,12 34,12 L 94,12 C 108,12 116,20 116,34 L 116,46 C 85,54 45,54 12,46 Z" fill="white" opacity="0.05" />
|
|
43
|
+
|
|
44
|
+
<!-- Base de monitoramento / Painel central HUD -->
|
|
45
|
+
<rect x="22" y="24" width="84" height="64" rx="14" fill="#181825" stroke="#313244" stroke-width="1.5" opacity="0.85" />
|
|
46
|
+
|
|
47
|
+
<!-- Barras do medidor de recursos (RAM, SWAP, GPU, CPU) -->
|
|
48
|
+
<!-- Barra 1: RAM -->
|
|
49
|
+
<rect x="34" y="58" width="10" height="20" rx="4" fill="url(#meterGrad1)" filter="url(#glow)" />
|
|
50
|
+
<!-- Barra 2: CPU -->
|
|
51
|
+
<rect x="49" y="44" width="10" height="34" rx="4" fill="url(#meterGrad2)" filter="url(#glow)" />
|
|
52
|
+
<!-- Barra 3: GPU -->
|
|
53
|
+
<rect x="64" y="36" width="10" height="42" rx="4" fill="url(#meterGrad3)" filter="url(#glow)" />
|
|
54
|
+
<!-- Barra 4: SWAP / Rede -->
|
|
55
|
+
<rect x="79" y="50" width="10" height="28" rx="4" fill="url(#meterGrad2)" filter="url(#glow)" />
|
|
56
|
+
|
|
57
|
+
<!-- Linha de onda cardíaca / osciloscópio na tela -->
|
|
58
|
+
<path d="M 28,68 L 40,68 L 46,54 L 54,76 L 62,48 L 70,68 L 100,68" fill="none" stroke="#38bdf8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" opacity="0.65" />
|
|
59
|
+
|
|
60
|
+
<!-- Pinos / Conectores de Chip na borda inferior -->
|
|
61
|
+
<g fill="#818cf8" opacity="0.7">
|
|
62
|
+
<rect x="36" y="94" width="6" height="12" rx="2" />
|
|
63
|
+
<rect x="48" y="94" width="6" height="12" rx="2" />
|
|
64
|
+
<rect x="60" y="94" width="6" height="12" rx="2" />
|
|
65
|
+
<rect x="72" y="94" width="6" height="12" rx="2" />
|
|
66
|
+
<rect x="84" y="94" width="6" height="12" rx="2" />
|
|
67
|
+
</g>
|
|
68
|
+
|
|
69
|
+
<!-- Ponto indicador de status ativo (LED verde neon) -->
|
|
70
|
+
<circle cx="96" cy="34" r="3.5" fill="#34d399" filter="url(#glow)" />
|
|
71
|
+
</svg>
|
surucucu/cli.py
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
CLI entry point for Surucucu Observability Cockpit.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
import argparse
|
|
9
|
+
import subprocess
|
|
10
|
+
import signal
|
|
11
|
+
import psutil
|
|
12
|
+
from surucucu import __version__, __app_name__
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def find_running_instances():
|
|
16
|
+
"""Find PIDs of running surucucu monitor processes."""
|
|
17
|
+
pids = []
|
|
18
|
+
current_pid = os.getpid()
|
|
19
|
+
for proc in psutil.process_iter(['pid', 'name', 'cmdline']):
|
|
20
|
+
try:
|
|
21
|
+
if proc.info['pid'] == current_pid:
|
|
22
|
+
continue
|
|
23
|
+
cmdline = proc.info.get('cmdline') or []
|
|
24
|
+
cmd_str = " ".join(cmdline)
|
|
25
|
+
# Ignora comandos utilitários como --status, --version, --stop
|
|
26
|
+
if any(arg in cmdline for arg in ["--status", "--version", "-v", "--stop", "-k", "--help", "-h"]):
|
|
27
|
+
continue
|
|
28
|
+
|
|
29
|
+
if "surucucu" in cmd_str or ("monitor.py" in cmd_str and "dev/setup-linux" in cmd_str):
|
|
30
|
+
pids.append(proc.info['pid'])
|
|
31
|
+
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
|
32
|
+
pass
|
|
33
|
+
return pids
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def stop_instances():
|
|
37
|
+
"""Stop running instances."""
|
|
38
|
+
pids = find_running_instances()
|
|
39
|
+
if not pids:
|
|
40
|
+
print("🐍 Surucucu não está em execução.")
|
|
41
|
+
return 0
|
|
42
|
+
|
|
43
|
+
print(f"🐍 Encerrando {len(pids)} instância(s) do Surucucu (PIDs: {pids})...")
|
|
44
|
+
for pid in pids:
|
|
45
|
+
try:
|
|
46
|
+
os.kill(pid, signal.SIGTERM)
|
|
47
|
+
except ProcessLookupError:
|
|
48
|
+
pass
|
|
49
|
+
print("✓ Surucucu encerrado.")
|
|
50
|
+
return 0
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def print_status():
|
|
54
|
+
"""Print status of surucucu."""
|
|
55
|
+
pids = find_running_instances()
|
|
56
|
+
if pids:
|
|
57
|
+
print(f"🐍 Surucucu está ATIVO (PID(s): {', '.join(map(str, pids))})")
|
|
58
|
+
else:
|
|
59
|
+
print("⚪ Surucucu está PARADO")
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def main():
|
|
63
|
+
parser = argparse.ArgumentParser(
|
|
64
|
+
prog="surucucu",
|
|
65
|
+
description="🐍 Surucucu - Amazonian AI, GPU & System Observability Cockpit for Linux",
|
|
66
|
+
)
|
|
67
|
+
parser.add_argument(
|
|
68
|
+
"-v", "--version", action="version", version=f"%(prog)s {__version__}"
|
|
69
|
+
)
|
|
70
|
+
parser.add_argument(
|
|
71
|
+
"-b", "--background", action="store_true", help="Executar o Cockpit HUD em segundo plano"
|
|
72
|
+
)
|
|
73
|
+
parser.add_argument(
|
|
74
|
+
"-k", "--stop", action="store_true", help="Encerrar instâncias do Surucucu em execução"
|
|
75
|
+
)
|
|
76
|
+
parser.add_argument(
|
|
77
|
+
"-r", "--restart", action="store_true", help="Reiniciar o Cockpit HUD"
|
|
78
|
+
)
|
|
79
|
+
parser.add_argument(
|
|
80
|
+
"--status", action="store_true", help="Exibir status de execução do Surucucu"
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
args = parser.parse_args()
|
|
84
|
+
|
|
85
|
+
if args.stop:
|
|
86
|
+
return stop_instances()
|
|
87
|
+
|
|
88
|
+
if args.status:
|
|
89
|
+
print_status()
|
|
90
|
+
return 0
|
|
91
|
+
|
|
92
|
+
if args.restart:
|
|
93
|
+
stop_instances()
|
|
94
|
+
|
|
95
|
+
# Garantir variáveis de display para Wayland / X11
|
|
96
|
+
if "DISPLAY" not in os.environ and "WAYLAND_DISPLAY" not in os.environ:
|
|
97
|
+
os.environ["DISPLAY"] = ":0"
|
|
98
|
+
if "WAYLAND_DISPLAY" not in os.environ:
|
|
99
|
+
os.environ["WAYLAND_DISPLAY"] = "wayland-0"
|
|
100
|
+
|
|
101
|
+
if args.background:
|
|
102
|
+
# Se já estiver rodando, avisar
|
|
103
|
+
existing = find_running_instances()
|
|
104
|
+
if existing and not args.restart:
|
|
105
|
+
print(f"🐍 Surucucu já está em execução (PID: {existing[0]}). Use --restart para reiniciar.")
|
|
106
|
+
return 0
|
|
107
|
+
|
|
108
|
+
# Lançar processo desacoplado
|
|
109
|
+
cmd = [sys.executable, "-m", "surucucu"]
|
|
110
|
+
proc = subprocess.Popen(
|
|
111
|
+
cmd,
|
|
112
|
+
stdout=subprocess.DEVNULL,
|
|
113
|
+
stderr=subprocess.DEVNULL,
|
|
114
|
+
preexec_fn=os.setpgrp,
|
|
115
|
+
)
|
|
116
|
+
print(f"🐍 Surucucu iniciado em segundo plano (PID: {proc.pid}).")
|
|
117
|
+
return 0
|
|
118
|
+
|
|
119
|
+
# Execução em primeiro plano
|
|
120
|
+
from surucucu.monitor import main as run_monitor
|
|
121
|
+
run_monitor()
|
|
122
|
+
return 0
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
if __name__ == "__main__":
|
|
126
|
+
sys.exit(main() or 0)
|