sciveo 0.0.31__tar.gz → 0.0.32__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.31 → sciveo-0.0.32}/PKG-INFO +1 -1
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/common/tools/hardware.py +45 -2
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/monitoring/monitor.py +10 -9
- sciveo-0.0.32/sciveo/version.py +2 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo.egg-info/PKG-INFO +1 -1
- sciveo-0.0.31/sciveo/version.py +0 -2
- {sciveo-0.0.31 → sciveo-0.0.32}/README.md +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/__init__.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/api/__init__.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/api/base.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/api/upload.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/common/__init__.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/common/configuration.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/common/model.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/common/optimizers.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/common/sampling.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/common/tools/__init__.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/common/tools/daemon.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/common/tools/formating.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/common/tools/logger.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/common/tools/synchronized.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/content/__init__.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/content/dataset.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/content/experiment.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/content/project.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/content/runner.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo/monitoring/__init__.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo.egg-info/SOURCES.txt +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo.egg-info/dependency_links.txt +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo.egg-info/requires.txt +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/sciveo.egg-info/top_level.txt +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/setup.cfg +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/setup.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/test/test_configuration.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/test/test_runner.py +0 -0
- {sciveo-0.0.31 → sciveo-0.0.32}/test/test_sampling.py +0 -0
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
#
|
|
11
11
|
|
|
12
12
|
import os
|
|
13
|
+
import subprocess
|
|
13
14
|
import datetime
|
|
14
15
|
import uuid
|
|
15
16
|
import random
|
|
16
17
|
import string
|
|
17
18
|
|
|
19
|
+
from sciveo.common.tools.logger import *
|
|
18
20
|
from sciveo.common.tools.formating import format_memory_size
|
|
19
21
|
|
|
20
22
|
|
|
@@ -36,12 +38,13 @@ class HardwareInfo:
|
|
|
36
38
|
"RAM": format_memory_size(os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES'))
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
self.
|
|
41
|
+
self.get_cpu()
|
|
42
|
+
self.get_gpu()
|
|
40
43
|
|
|
41
44
|
def __call__(self):
|
|
42
45
|
return self.data
|
|
43
46
|
|
|
44
|
-
def
|
|
47
|
+
def get_cpu(self):
|
|
45
48
|
list_keys = ["model name", "stepping", "cpu MHz", "cache size", "siblings", "cpu cores", "bogomips"]
|
|
46
49
|
try:
|
|
47
50
|
cpu_info = {}
|
|
@@ -57,3 +60,43 @@ class HardwareInfo:
|
|
|
57
60
|
self.data["CPU"]["info"] = cpu_info
|
|
58
61
|
except Exception:
|
|
59
62
|
return
|
|
63
|
+
|
|
64
|
+
# Currently simple nvidia-smi wrapper impl
|
|
65
|
+
def get_gpu(self):
|
|
66
|
+
try:
|
|
67
|
+
result = subprocess.run(
|
|
68
|
+
[
|
|
69
|
+
'nvidia-smi',
|
|
70
|
+
'--query-gpu=gpu_uuid,gpu_name,index,power.draw,fan.speed,memory.total,memory.used,memory.free,utilization.gpu,utilization.memory,temperature.gpu',
|
|
71
|
+
'--format=csv'
|
|
72
|
+
],
|
|
73
|
+
capture_output=True, text=True, check=True
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
lines = result.stdout.strip().split('\n')
|
|
77
|
+
header = lines[0].split(", ")
|
|
78
|
+
|
|
79
|
+
keys = []
|
|
80
|
+
units = {}
|
|
81
|
+
for k in header:
|
|
82
|
+
k_split = k.split(' ')
|
|
83
|
+
key = k_split[0]
|
|
84
|
+
keys.append(key)
|
|
85
|
+
if len(k_split) >= 2:
|
|
86
|
+
units[key] = k_split[1].replace('[', '').replace(']', '')
|
|
87
|
+
|
|
88
|
+
for i in range(1, len(lines)):
|
|
89
|
+
line_values = lines[i].split(", ")
|
|
90
|
+
line_data = {}
|
|
91
|
+
for j, value in enumerate(line_values):
|
|
92
|
+
value = value.split(' ')[0]
|
|
93
|
+
line_data[keys[j]] = value
|
|
94
|
+
self.data.setdefault("GPU", [])
|
|
95
|
+
self.data["GPU"].append(line_data)
|
|
96
|
+
except subprocess.CalledProcessError as e:
|
|
97
|
+
pass
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
if __name__ == "__main__":
|
|
101
|
+
hw = HardwareInfo()
|
|
102
|
+
hw()
|
|
@@ -33,15 +33,19 @@ class BaseMonitor(DaemonBase):
|
|
|
33
33
|
"installed": self.data["RAM"]
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
self.initial_cpu_usage = psutil.cpu_percent(interval=5, percpu=True)
|
|
37
|
-
cpuserial = self.getserial()
|
|
38
|
-
|
|
39
36
|
self.data["logs"] = {}
|
|
40
37
|
self.list_logs = []
|
|
41
38
|
|
|
42
39
|
self.api = APIRemoteClient()
|
|
43
40
|
|
|
44
|
-
|
|
41
|
+
# Warmup the psutil cpu usage
|
|
42
|
+
psutil.cpu_percent(interval=0.3, percpu=True)
|
|
43
|
+
initial_cpu_usage = psutil.cpu_percent(interval=None, percpu=True)
|
|
44
|
+
time.sleep(1)
|
|
45
|
+
|
|
46
|
+
cpuserial = self.getserial()
|
|
47
|
+
|
|
48
|
+
debug(type(self).__name__, "init", cpuserial, "initial_cpu_usage", initial_cpu_usage)
|
|
45
49
|
|
|
46
50
|
def __call__(self):
|
|
47
51
|
return self.data
|
|
@@ -62,11 +66,7 @@ class BaseMonitor(DaemonBase):
|
|
|
62
66
|
self.data["logs"][log_name] = self.tail_file(log_path)[-3:]
|
|
63
67
|
|
|
64
68
|
def get_cpu_usage(self):
|
|
65
|
-
|
|
66
|
-
self.data["CPU"]["usage_per_core"] = psutil.cpu_percent(interval=None, percpu=True)
|
|
67
|
-
else:
|
|
68
|
-
self.data["CPU"]["usage_per_core"] = self.initial_cpu_usage
|
|
69
|
-
self.initial_cpu_usage = None
|
|
69
|
+
self.data["CPU"]["usage_per_core"] = psutil.cpu_percent(interval=None, percpu=True)
|
|
70
70
|
# self.data["CPU"]["usage_per_core"] = (np.array(self.data["CPU"]["usage_per_core"]) / 100.0).tolist()
|
|
71
71
|
self.data["CPU"]["usage"] = np.array(self.data["CPU"]["usage_per_core"]).mean()
|
|
72
72
|
|
|
@@ -107,6 +107,7 @@ class BaseMonitor(DaemonBase):
|
|
|
107
107
|
return result
|
|
108
108
|
|
|
109
109
|
|
|
110
|
+
|
|
110
111
|
if __name__ == "__main__":
|
|
111
112
|
mon = BaseMonitor(period=60)
|
|
112
113
|
mon.start()
|
sciveo-0.0.31/sciveo/version.py
DELETED
|
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
|