sciveo 0.0.43__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.
Files changed (38) hide show
  1. {sciveo-0.0.43 → sciveo-0.0.44}/PKG-INFO +1 -1
  2. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/monitoring/monitor.py +3 -5
  3. sciveo-0.0.44/sciveo/version.py +2 -0
  4. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo.egg-info/PKG-INFO +1 -1
  5. sciveo-0.0.44/test/test_monitoring.py +97 -0
  6. sciveo-0.0.43/sciveo/version.py +0 -2
  7. sciveo-0.0.43/test/test_monitoring.py +0 -26
  8. {sciveo-0.0.43 → sciveo-0.0.44}/README.md +0 -0
  9. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/__init__.py +0 -0
  10. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/api/__init__.py +0 -0
  11. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/api/base.py +0 -0
  12. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/api/upload.py +0 -0
  13. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/common/__init__.py +0 -0
  14. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/common/configuration.py +0 -0
  15. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/common/model.py +0 -0
  16. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/common/optimizers.py +0 -0
  17. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/common/sampling.py +0 -0
  18. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/common/tools/__init__.py +0 -0
  19. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/common/tools/daemon.py +0 -0
  20. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/common/tools/formating.py +0 -0
  21. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/common/tools/hardware.py +0 -0
  22. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/common/tools/logger.py +0 -0
  23. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/common/tools/synchronized.py +0 -0
  24. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/content/__init__.py +0 -0
  25. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/content/dataset.py +0 -0
  26. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/content/experiment.py +0 -0
  27. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/content/project.py +0 -0
  28. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/content/runner.py +0 -0
  29. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo/monitoring/__init__.py +0 -0
  30. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo.egg-info/SOURCES.txt +0 -0
  31. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo.egg-info/dependency_links.txt +0 -0
  32. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo.egg-info/requires.txt +0 -0
  33. {sciveo-0.0.43 → sciveo-0.0.44}/sciveo.egg-info/top_level.txt +0 -0
  34. {sciveo-0.0.43 → sciveo-0.0.44}/setup.cfg +0 -0
  35. {sciveo-0.0.43 → sciveo-0.0.44}/setup.py +0 -0
  36. {sciveo-0.0.43 → sciveo-0.0.44}/test/test_configuration.py +0 -0
  37. {sciveo-0.0.43 → sciveo-0.0.44}/test/test_runner.py +0 -0
  38. {sciveo-0.0.43 → sciveo-0.0.44}/test/test_sampling.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciveo
3
- Version: 0.0.43
3
+ Version: 0.0.44
4
4
  Description-Content-Type: text/markdown
5
5
  Provides-Extra: mon
6
6
 
@@ -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
- with open('/proc/cpuinfo','r') as fp:
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:
@@ -130,7 +128,7 @@ class BaseMonitor(DaemonBase):
130
128
 
131
129
 
132
130
  if __name__ == "__main__":
133
- mon = BaseMonitor(period=30)
131
+ mon = BaseMonitor(period=10)
134
132
  mon.start()
135
133
 
136
134
  while(True):
@@ -0,0 +1,2 @@
1
+
2
+ __version__ = '0.0.44'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciveo
3
- Version: 0.0.43
3
+ Version: 0.0.44
4
4
  Description-Content-Type: text/markdown
5
5
  Provides-Extra: mon
6
6
 
@@ -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"])
@@ -1,2 +0,0 @@
1
-
2
- __version__ = '0.0.43'
@@ -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