sciveo 0.0.30__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.
Files changed (36) hide show
  1. {sciveo-0.0.30 → sciveo-0.0.32}/PKG-INFO +1 -1
  2. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/__init__.py +9 -0
  3. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/common/tools/hardware.py +45 -2
  4. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/monitoring/monitor.py +11 -3
  5. sciveo-0.0.32/sciveo/version.py +2 -0
  6. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo.egg-info/PKG-INFO +1 -1
  7. sciveo-0.0.30/sciveo/version.py +0 -2
  8. {sciveo-0.0.30 → sciveo-0.0.32}/README.md +0 -0
  9. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/api/__init__.py +0 -0
  10. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/api/base.py +0 -0
  11. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/api/upload.py +0 -0
  12. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/common/__init__.py +0 -0
  13. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/common/configuration.py +0 -0
  14. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/common/model.py +0 -0
  15. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/common/optimizers.py +0 -0
  16. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/common/sampling.py +0 -0
  17. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/common/tools/__init__.py +0 -0
  18. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/common/tools/daemon.py +0 -0
  19. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/common/tools/formating.py +0 -0
  20. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/common/tools/logger.py +0 -0
  21. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/common/tools/synchronized.py +0 -0
  22. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/content/__init__.py +0 -0
  23. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/content/dataset.py +0 -0
  24. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/content/experiment.py +0 -0
  25. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/content/project.py +0 -0
  26. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/content/runner.py +0 -0
  27. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo/monitoring/__init__.py +0 -0
  28. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo.egg-info/SOURCES.txt +0 -0
  29. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo.egg-info/dependency_links.txt +0 -0
  30. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo.egg-info/requires.txt +0 -0
  31. {sciveo-0.0.30 → sciveo-0.0.32}/sciveo.egg-info/top_level.txt +0 -0
  32. {sciveo-0.0.30 → sciveo-0.0.32}/setup.cfg +0 -0
  33. {sciveo-0.0.30 → sciveo-0.0.32}/setup.py +0 -0
  34. {sciveo-0.0.30 → sciveo-0.0.32}/test/test_configuration.py +0 -0
  35. {sciveo-0.0.30 → sciveo-0.0.32}/test/test_runner.py +0 -0
  36. {sciveo-0.0.30 → sciveo-0.0.32}/test/test_sampling.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciveo
3
- Version: 0.0.30
3
+ Version: 0.0.32
4
4
  Description-Content-Type: text/markdown
5
5
  Provides-Extra: mon
6
6
 
@@ -14,11 +14,13 @@ from builtins import ImportError
14
14
  try:
15
15
 
16
16
  import os
17
+ import time
17
18
 
18
19
  from sciveo.common.tools.logger import *
19
20
  from sciveo.common.tools.daemon import TasksDaemon, __upload_content__
20
21
  from sciveo.content.runner import ProjectRunner
21
22
  from sciveo.content.dataset import Dataset
23
+ from sciveo.monitoring.monitor import BaseMonitor
22
24
  from sciveo.version import __version__
23
25
 
24
26
 
@@ -41,5 +43,12 @@ try:
41
43
  def dataset(info={}):
42
44
  return Dataset.get(info)
43
45
 
46
+ # Monitoring start
47
+ def monitor(period=120):
48
+ mon = BaseMonitor(period=period)
49
+ mon.start()
50
+ while(True):
51
+ time.sleep(60)
52
+
44
53
  except ImportError as e:
45
54
  pass
@@ -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.get_cpuinfo()
41
+ self.get_cpu()
42
+ self.get_gpu()
40
43
 
41
44
  def __call__(self):
42
45
  return self.data
43
46
 
44
- def get_cpuinfo(self):
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()
@@ -32,14 +32,21 @@ class BaseMonitor(DaemonBase):
32
32
  self.data["RAM"] = {
33
33
  "installed": self.data["RAM"]
34
34
  }
35
- psutil.cpu_percent(interval=0.5)
36
- self.getserial()
37
35
 
38
36
  self.data["logs"] = {}
39
37
  self.list_logs = []
40
38
 
41
39
  self.api = APIRemoteClient()
42
40
 
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)
49
+
43
50
  def __call__(self):
44
51
  return self.data
45
52
 
@@ -100,8 +107,9 @@ class BaseMonitor(DaemonBase):
100
107
  return result
101
108
 
102
109
 
110
+
103
111
  if __name__ == "__main__":
104
- mon = BaseMonitor(period=10)
112
+ mon = BaseMonitor(period=60)
105
113
  mon.start()
106
114
 
107
115
  while(True):
@@ -0,0 +1,2 @@
1
+
2
+ __version__ = '0.0.32'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciveo
3
- Version: 0.0.30
3
+ Version: 0.0.32
4
4
  Description-Content-Type: text/markdown
5
5
  Provides-Extra: mon
6
6
 
@@ -1,2 +0,0 @@
1
-
2
- __version__ = '0.0.30'
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