sciveo 0.0.32__tar.gz → 0.0.34__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.32 → sciveo-0.0.34}/PKG-INFO +1 -1
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/common/tools/hardware.py +0 -42
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/monitoring/monitor.py +44 -1
- sciveo-0.0.34/sciveo/version.py +2 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo.egg-info/PKG-INFO +1 -1
- sciveo-0.0.32/sciveo/version.py +0 -2
- {sciveo-0.0.32 → sciveo-0.0.34}/README.md +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/__init__.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/api/__init__.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/api/base.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/api/upload.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/common/__init__.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/common/configuration.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/common/model.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/common/optimizers.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/common/sampling.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/common/tools/__init__.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/common/tools/daemon.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/common/tools/formating.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/common/tools/logger.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/common/tools/synchronized.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/content/__init__.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/content/dataset.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/content/experiment.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/content/project.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/content/runner.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo/monitoring/__init__.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo.egg-info/SOURCES.txt +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo.egg-info/dependency_links.txt +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo.egg-info/requires.txt +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/sciveo.egg-info/top_level.txt +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/setup.cfg +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/setup.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/test/test_configuration.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/test/test_runner.py +0 -0
- {sciveo-0.0.32 → sciveo-0.0.34}/test/test_sampling.py +0 -0
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
#
|
|
11
11
|
|
|
12
12
|
import os
|
|
13
|
-
import subprocess
|
|
14
13
|
import datetime
|
|
15
14
|
import uuid
|
|
16
15
|
import random
|
|
@@ -39,7 +38,6 @@ class HardwareInfo:
|
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
self.get_cpu()
|
|
42
|
-
self.get_gpu()
|
|
43
41
|
|
|
44
42
|
def __call__(self):
|
|
45
43
|
return self.data
|
|
@@ -60,43 +58,3 @@ class HardwareInfo:
|
|
|
60
58
|
self.data["CPU"]["info"] = cpu_info
|
|
61
59
|
except Exception:
|
|
62
60
|
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()
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#
|
|
11
11
|
|
|
12
12
|
import os
|
|
13
|
+
import subprocess
|
|
13
14
|
import time
|
|
14
15
|
import datetime
|
|
15
16
|
import socket
|
|
@@ -53,6 +54,7 @@ class BaseMonitor(DaemonBase):
|
|
|
53
54
|
def loop(self):
|
|
54
55
|
self.get_cpu_usage()
|
|
55
56
|
self.get_memory()
|
|
57
|
+
self.get_gpu()
|
|
56
58
|
|
|
57
59
|
self.tail_logs()
|
|
58
60
|
self.data["local_time"] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
|
@@ -106,10 +108,51 @@ class BaseMonitor(DaemonBase):
|
|
|
106
108
|
error(e, "tail_file", file_path)
|
|
107
109
|
return result
|
|
108
110
|
|
|
111
|
+
# Currently simple nvidia-smi wrapper impl
|
|
112
|
+
def get_gpu(self):
|
|
113
|
+
try:
|
|
114
|
+
result = subprocess.run(
|
|
115
|
+
[
|
|
116
|
+
'nvidia-smi',
|
|
117
|
+
'--query-gpu=gpu_uuid,gpu_name,index,power.draw,fan.speed,memory.total,memory.used,memory.free,utilization.gpu,utilization.memory,temperature.gpu',
|
|
118
|
+
'--format=csv'
|
|
119
|
+
],
|
|
120
|
+
capture_output=True, text=True, check=True
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
lines = result.stdout.strip().split('\n')
|
|
124
|
+
header = lines[0].split(", ")
|
|
125
|
+
|
|
126
|
+
keys = []
|
|
127
|
+
units = {}
|
|
128
|
+
for k in header:
|
|
129
|
+
k_split = k.split(' ')
|
|
130
|
+
key = k_split[0]
|
|
131
|
+
keys.append(key)
|
|
132
|
+
if len(k_split) >= 2:
|
|
133
|
+
units[key] = k_split[1].replace('[', '').replace(']', '')
|
|
134
|
+
|
|
135
|
+
data = []
|
|
136
|
+
for i in range(1, len(lines)):
|
|
137
|
+
line_values = lines[i].split(", ")
|
|
138
|
+
line_data = {}
|
|
139
|
+
for j, value in enumerate(line_values):
|
|
140
|
+
value = value.split(' ')[0]
|
|
141
|
+
line_data[keys[j]] = value
|
|
142
|
+
data.append(line_data)
|
|
143
|
+
|
|
144
|
+
self.data.setdefault("GPU", {})
|
|
145
|
+
self.data["GPU"]["units"] = units
|
|
146
|
+
self.data["GPU"]["data"] = data
|
|
147
|
+
|
|
148
|
+
except subprocess.CalledProcessError as e:
|
|
149
|
+
pass
|
|
150
|
+
|
|
151
|
+
|
|
109
152
|
|
|
110
153
|
|
|
111
154
|
if __name__ == "__main__":
|
|
112
|
-
mon = BaseMonitor(period=
|
|
155
|
+
mon = BaseMonitor(period=10)
|
|
113
156
|
mon.start()
|
|
114
157
|
|
|
115
158
|
while(True):
|
sciveo-0.0.32/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
|