sciveo 0.0.42__tar.gz → 0.0.44__tar.gz
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.
- {sciveo-0.0.42 → sciveo-0.0.44}/PKG-INFO +1 -1
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/monitoring/monitor.py +3 -5
- sciveo-0.0.44/sciveo/version.py +2 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo.egg-info/PKG-INFO +1 -1
- sciveo-0.0.44/test/test_monitoring.py +97 -0
- sciveo-0.0.42/sciveo/version.py +0 -2
- sciveo-0.0.42/test/test_monitoring.py +0 -26
- {sciveo-0.0.42 → sciveo-0.0.44}/README.md +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/__init__.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/api/__init__.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/api/base.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/api/upload.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/common/__init__.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/common/configuration.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/common/model.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/common/optimizers.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/common/sampling.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/common/tools/__init__.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/common/tools/daemon.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/common/tools/formating.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/common/tools/hardware.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/common/tools/logger.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/common/tools/synchronized.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/content/__init__.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/content/dataset.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/content/experiment.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/content/project.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/content/runner.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo/monitoring/__init__.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo.egg-info/SOURCES.txt +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo.egg-info/dependency_links.txt +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo.egg-info/requires.txt +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/sciveo.egg-info/top_level.txt +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/setup.cfg +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/setup.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/test/test_configuration.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/test/test_runner.py +0 -0
- {sciveo-0.0.42 → sciveo-0.0.44}/test/test_sampling.py +0 -0
|
@@ -15,6 +15,7 @@ import time
|
|
|
15
15
|
import datetime
|
|
16
16
|
import socket
|
|
17
17
|
import psutil
|
|
18
|
+
import uuid
|
|
18
19
|
import numpy as np
|
|
19
20
|
|
|
20
21
|
from sciveo.common.tools.logger import *
|
|
@@ -81,10 +82,7 @@ class BaseMonitor(DaemonBase):
|
|
|
81
82
|
def getserial(self):
|
|
82
83
|
machine_serial = None
|
|
83
84
|
try:
|
|
84
|
-
|
|
85
|
-
for line in fp:
|
|
86
|
-
if line.startswith('Serial'):
|
|
87
|
-
machine_serial = line[10:26]
|
|
85
|
+
machine_serial = f"{socket.gethostname()}-{uuid.getnode()}"
|
|
88
86
|
except Exception:
|
|
89
87
|
pass
|
|
90
88
|
if machine_serial is None:
|
|
@@ -114,7 +112,7 @@ class BaseMonitor(DaemonBase):
|
|
|
114
112
|
[
|
|
115
113
|
'nvidia-smi',
|
|
116
114
|
'--query-gpu=gpu_uuid,gpu_name,index,power.draw,fan.speed,memory.total,memory.used,memory.free,utilization.gpu,utilization.memory,temperature.gpu',
|
|
117
|
-
'--format=csv'
|
|
115
|
+
'--format=csv,nounits'
|
|
118
116
|
],
|
|
119
117
|
capture_output=True, text=True, check=True
|
|
120
118
|
)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Pavlin Georgiev, Softel Labs
|
|
3
|
+
#
|
|
4
|
+
# This is a proprietary file and may not be copied,
|
|
5
|
+
# distributed, or modified without express permission
|
|
6
|
+
# from the owner. For licensing inquiries, please
|
|
7
|
+
# contact pavlin@softel.bg.
|
|
8
|
+
#
|
|
9
|
+
# 2024
|
|
10
|
+
#
|
|
11
|
+
|
|
12
|
+
import unittest
|
|
13
|
+
import numpy as np
|
|
14
|
+
|
|
15
|
+
from sciveo.common.tools.logger import *
|
|
16
|
+
from sciveo.monitoring.monitor import *
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class TestMonitoring(unittest.TestCase):
|
|
20
|
+
def test_cpu(self):
|
|
21
|
+
m = BaseMonitor()
|
|
22
|
+
m.get_cpu_usage()
|
|
23
|
+
print(m.data)
|
|
24
|
+
|
|
25
|
+
self.assertTrue("usage per core" in m.data["CPU"])
|
|
26
|
+
self.assertTrue("usage" in m.data["CPU"])
|
|
27
|
+
|
|
28
|
+
def test_gpu(self):
|
|
29
|
+
data = {
|
|
30
|
+
"GPU": {
|
|
31
|
+
"raw_lines": [
|
|
32
|
+
"uuid, name, index, power.draw [W], fan.speed [%], memory.total [MiB], memory.used [MiB], memory.free [MiB], utilization.gpu [%], utilization.memory [%], temperature.gpu",
|
|
33
|
+
"GPU-41e0e872-f8d5-95fb-6fd7-8c143c0db7c9, NVIDIA GeForce RTX 3060, 0, 11.57, 0, 12053, 13, 12040, 0, 0, 38",
|
|
34
|
+
"GPU-f7a1d225-58db-e209-aa84-574996d070cd, NVIDIA GeForce RTX 3060, 1, 12.08, 0, 12045, 477, 11568, 0, 39, 36"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
sample = {}
|
|
39
|
+
config = {
|
|
40
|
+
"CPU": {
|
|
41
|
+
"usage": {"ratio": 1.0, "metric": "%", "ylim": [0.0, 105.0]},
|
|
42
|
+
"usage per core": {"ratio": 1.0, "metric": "%", "ylim": [0.0, 105.0]},
|
|
43
|
+
},
|
|
44
|
+
"RAM": {
|
|
45
|
+
"used": {"ratio": 1.0 / (1024 * 1024 * 1024), "metric": "GB"},
|
|
46
|
+
},
|
|
47
|
+
"GPU": {
|
|
48
|
+
"fan.speed": {"ratio": 1.0, "metric": "%", "ylim": [0.0, 105.0]},
|
|
49
|
+
"power.draw": {"ratio": 1.0, "metric": "W", "ylim": [0.0, 250.0]},
|
|
50
|
+
"memory.free": {"ratio": 1.0 / 1024, "metric": "GB"},
|
|
51
|
+
"memory.used": {"ratio": 1.0 / 1024, "metric": "GB"},
|
|
52
|
+
"temperature.gpu": {"ratio": 1.0, "metric": "°C", "ylim": [10, 110]},
|
|
53
|
+
"utilization.gpu": {"ratio": 1.0, "metric": "%", "ylim": [0.0, 105.0]},
|
|
54
|
+
"utilization.memory": {"ratio": 1.0, "metric": "%", "ylim": [0.0, 105.0]},
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
try:
|
|
59
|
+
lines = data["GPU"]["raw_lines"]
|
|
60
|
+
header = lines[0].split(", ")
|
|
61
|
+
|
|
62
|
+
keys = []
|
|
63
|
+
gpu_keys = []
|
|
64
|
+
for k in header:
|
|
65
|
+
k_split = k.split(' ')
|
|
66
|
+
key = k_split[0]
|
|
67
|
+
keys.append(key)
|
|
68
|
+
gpu_keys.append(f"GPU {key}")
|
|
69
|
+
|
|
70
|
+
for i, k in enumerate(keys):
|
|
71
|
+
if k in config["GPU"]:
|
|
72
|
+
sample[gpu_keys[i]] = []
|
|
73
|
+
else:
|
|
74
|
+
data["GPU"][keys[i]] = []
|
|
75
|
+
|
|
76
|
+
for i in range(1, len(lines)):
|
|
77
|
+
line_values = lines[i].split(", ")
|
|
78
|
+
for j, value in enumerate(line_values):
|
|
79
|
+
try:
|
|
80
|
+
value = float(value)
|
|
81
|
+
except ValueError:
|
|
82
|
+
pass
|
|
83
|
+
if keys[j] in config["GPU"]:
|
|
84
|
+
sample[gpu_keys[j]].append(value)
|
|
85
|
+
else:
|
|
86
|
+
data["GPU"][keys[j]].append(value)
|
|
87
|
+
|
|
88
|
+
if "memory.total" in data["GPU"]:
|
|
89
|
+
print("memory.total", data["GPU"]["memory.total"])
|
|
90
|
+
for k in ["memory.used", "memory.free"]:
|
|
91
|
+
config["GPU"][k]["ylim"] = [0, max(data["GPU"]["memory.total"]) * config["GPU"][k]["ratio"]]
|
|
92
|
+
print("ylim", config["GPU"][k]["ylim"])
|
|
93
|
+
except Exception as e:
|
|
94
|
+
print("Exception", e)
|
|
95
|
+
|
|
96
|
+
print("memory.used", config["GPU"]["memory.used"])
|
|
97
|
+
print("free", config["GPU"]["memory.free"])
|
sciveo-0.0.42/sciveo/version.py
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Pavlin Georgiev, Softel Labs
|
|
3
|
-
#
|
|
4
|
-
# This is a proprietary file and may not be copied,
|
|
5
|
-
# distributed, or modified without express permission
|
|
6
|
-
# from the owner. For licensing inquiries, please
|
|
7
|
-
# contact pavlin@softel.bg.
|
|
8
|
-
#
|
|
9
|
-
# 2024
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
import unittest
|
|
13
|
-
import numpy as np
|
|
14
|
-
|
|
15
|
-
from sciveo.common.tools.logger import *
|
|
16
|
-
from sciveo.monitoring.monitor import *
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class TestMonitoring(unittest.TestCase):
|
|
20
|
-
def test_cpu(self):
|
|
21
|
-
m = BaseMonitor()
|
|
22
|
-
m.get_cpu_usage()
|
|
23
|
-
print(m.data)
|
|
24
|
-
|
|
25
|
-
self.assertTrue("usage_per_core" in m.data["CPU"])
|
|
26
|
-
self.assertTrue("usage" in m.data["CPU"])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|