sciveo 0.0.25__tar.gz → 0.1.89__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 (199) hide show
  1. {sciveo-0.0.25/sciveo.egg-info → sciveo-0.1.89}/PKG-INFO +135 -3
  2. sciveo-0.0.25/PKG-INFO → sciveo-0.1.89/README.md +125 -8
  3. sciveo-0.1.89/sciveo/__init__.py +56 -0
  4. {sciveo-0.0.25 → sciveo-0.1.89}/sciveo/api/base.py +8 -5
  5. sciveo-0.1.89/sciveo/api/predictors.py +67 -0
  6. sciveo-0.1.89/sciveo/api/server.py +80 -0
  7. {sciveo-0.0.25 → sciveo-0.1.89}/sciveo/api/upload.py +6 -7
  8. sciveo-0.1.89/sciveo/cli.py +184 -0
  9. {sciveo-0.0.25 → sciveo-0.1.89}/sciveo/common/configuration.py +2 -2
  10. {sciveo-0.0.25 → sciveo-0.1.89}/sciveo/common/model.py +1 -1
  11. {sciveo-0.0.25 → sciveo-0.1.89}/sciveo/common/optimizers.py +4 -4
  12. {sciveo-0.0.25 → sciveo-0.1.89}/sciveo/common/sampling.py +9 -9
  13. {sciveo-0.0.25 → sciveo-0.1.89}/sciveo/content/dataset.py +1 -1
  14. {sciveo-0.0.25 → sciveo-0.1.89}/sciveo/content/experiment.py +11 -11
  15. {sciveo-0.0.25 → sciveo-0.1.89}/sciveo/content/project.py +9 -9
  16. {sciveo-0.0.25 → sciveo-0.1.89}/sciveo/content/runner.py +3 -3
  17. sciveo-0.1.89/sciveo/db/read_table.py +191 -0
  18. sciveo-0.1.89/sciveo/media/capture/__init__.py +0 -0
  19. sciveo-0.1.89/sciveo/media/capture/cam.py +195 -0
  20. sciveo-0.1.89/sciveo/media/capture/draw.py +85 -0
  21. sciveo-0.1.89/sciveo/media/capture/games/__init__.py +0 -0
  22. sciveo-0.1.89/sciveo/media/capture/games/asteroids/__init__.py +0 -0
  23. sciveo-0.1.89/sciveo/media/capture/games/asteroids/asteroid.py +34 -0
  24. sciveo-0.1.89/sciveo/media/capture/games/asteroids/base_move.py +26 -0
  25. sciveo-0.1.89/sciveo/media/capture/games/asteroids/circle.py +31 -0
  26. sciveo-0.1.89/sciveo/media/capture/games/asteroids/game.py +11 -0
  27. sciveo-0.1.89/sciveo/media/capture/games/asteroids/geometrics.py +36 -0
  28. sciveo-0.1.89/sciveo/media/capture/games/asteroids/gravity_ball.py +32 -0
  29. sciveo-0.1.89/sciveo/media/capture/games/asteroids/laser.py +42 -0
  30. sciveo-0.1.89/sciveo/media/capture/games/asteroids/rocket.py +160 -0
  31. sciveo-0.1.89/sciveo/media/capture/games/asteroids/space_asteroids.py +155 -0
  32. sciveo-0.1.89/sciveo/media/capture/games/asteroids/volume_bar.py +24 -0
  33. sciveo-0.1.89/sciveo/media/capture/gst_server.py +211 -0
  34. sciveo-0.1.89/sciveo/media/capture/motion_detection.py +154 -0
  35. sciveo-0.1.89/sciveo/media/capture/nvr.py +264 -0
  36. sciveo-0.1.89/sciveo/media/capture/readers.py +127 -0
  37. sciveo-0.1.89/sciveo/media/capture/rpi.py +60 -0
  38. sciveo-0.1.89/sciveo/media/capture/rtsp.py +85 -0
  39. sciveo-0.1.89/sciveo/media/ml/__init__.py +0 -0
  40. sciveo-0.1.89/sciveo/media/ml/base.py +48 -0
  41. sciveo-0.1.89/sciveo/media/ml/encoders/__init__.py +0 -0
  42. sciveo-0.1.89/sciveo/media/ml/encoders/base.py +24 -0
  43. sciveo-0.1.89/sciveo/media/ml/encoders/normalizer.py +32 -0
  44. sciveo-0.1.89/sciveo/media/ml/nlp/__init__.py +0 -0
  45. sciveo-0.1.89/sciveo/media/ml/nlp/search.py +70 -0
  46. sciveo-0.1.89/sciveo/media/ml/time_series/__init__.py +0 -0
  47. sciveo-0.1.89/sciveo/media/ml/time_series/dataset.py +67 -0
  48. sciveo-0.1.89/sciveo/media/ml/time_series/predictor.py +105 -0
  49. sciveo-0.1.89/sciveo/media/ml/time_series/trainer.py +126 -0
  50. sciveo-0.1.89/sciveo/media/ml/time_series/window_generator.py +121 -0
  51. sciveo-0.1.89/sciveo/media/pipelines/__init__.py +0 -0
  52. sciveo-0.1.89/sciveo/media/pipelines/base.py +165 -0
  53. sciveo-0.1.89/sciveo/media/pipelines/job_daemon.py +59 -0
  54. sciveo-0.1.89/sciveo/media/pipelines/layouts/__init__.py +0 -0
  55. sciveo-0.1.89/sciveo/media/pipelines/layouts/base.py +25 -0
  56. sciveo-0.1.89/sciveo/media/pipelines/pipeline.py +185 -0
  57. sciveo-0.1.89/sciveo/media/pipelines/postprocessors/__init__.py +0 -0
  58. sciveo-0.1.89/sciveo/media/pipelines/postprocessors/base.py +26 -0
  59. sciveo-0.1.89/sciveo/media/pipelines/postprocessors/default.py +155 -0
  60. sciveo-0.1.89/sciveo/media/pipelines/processors/__init__.py +0 -0
  61. sciveo-0.1.89/sciveo/media/pipelines/processors/audio/__init__.py +0 -0
  62. sciveo-0.1.89/sciveo/media/pipelines/processors/audio/audio.py +99 -0
  63. sciveo-0.1.89/sciveo/media/pipelines/processors/audio/audio_extractor_process.py +136 -0
  64. sciveo-0.1.89/sciveo/media/pipelines/processors/aws.py +49 -0
  65. sciveo-0.1.89/sciveo/media/pipelines/processors/base.py +87 -0
  66. sciveo-0.1.89/sciveo/media/pipelines/processors/file/__init__.py +0 -0
  67. sciveo-0.1.89/sciveo/media/pipelines/processors/file/archive.py +90 -0
  68. sciveo-0.1.89/sciveo/media/pipelines/processors/image/__init__.py +0 -0
  69. sciveo-0.1.89/sciveo/media/pipelines/processors/image/album.py +129 -0
  70. sciveo-0.1.89/sciveo/media/pipelines/processors/image/album_in_image.py +127 -0
  71. sciveo-0.1.89/sciveo/media/pipelines/processors/image/depth_esimation.py +86 -0
  72. sciveo-0.1.89/sciveo/media/pipelines/processors/image/embeddings.py +49 -0
  73. sciveo-0.1.89/sciveo/media/pipelines/processors/image/filters.py +268 -0
  74. sciveo-0.1.89/sciveo/media/pipelines/processors/image/generators.py +281 -0
  75. sciveo-0.1.89/sciveo/media/pipelines/processors/image/histogram.py +72 -0
  76. sciveo-0.1.89/sciveo/media/pipelines/processors/image/mask.py +131 -0
  77. sciveo-0.1.89/sciveo/media/pipelines/processors/image/object_detection.py +81 -0
  78. sciveo-0.1.89/sciveo/media/pipelines/processors/image/resize.py +51 -0
  79. sciveo-0.1.89/sciveo/media/pipelines/processors/image/segmentation.py +87 -0
  80. sciveo-0.1.89/sciveo/media/pipelines/processors/image/watermark.py +90 -0
  81. sciveo-0.1.89/sciveo/media/pipelines/processors/media_info.py +153 -0
  82. sciveo-0.1.89/sciveo/media/pipelines/processors/nlp/__init__.py +0 -0
  83. sciveo-0.1.89/sciveo/media/pipelines/processors/nlp/address.py +160 -0
  84. sciveo-0.1.89/sciveo/media/pipelines/processors/qr.py +79 -0
  85. sciveo-0.1.89/sciveo/media/pipelines/processors/sci/__init__.py +0 -0
  86. sciveo-0.1.89/sciveo/media/pipelines/processors/sci/base.py +164 -0
  87. sciveo-0.1.89/sciveo/media/pipelines/processors/sci/dataset.py +99 -0
  88. sciveo-0.1.89/sciveo/media/pipelines/processors/sci/time_series/__init__.py +0 -0
  89. sciveo-0.1.89/sciveo/media/pipelines/processors/sci/time_series/predictor.py +108 -0
  90. sciveo-0.1.89/sciveo/media/pipelines/processors/sci/time_series/trainer.py +185 -0
  91. sciveo-0.1.89/sciveo/media/pipelines/processors/tpu_base.py +36 -0
  92. sciveo-0.1.89/sciveo/media/pipelines/processors/video/__init__.py +0 -0
  93. sciveo-0.1.89/sciveo/media/pipelines/processors/video/generators.py +42 -0
  94. sciveo-0.1.89/sciveo/media/pipelines/processors/video/motion_detection.py +73 -0
  95. sciveo-0.1.89/sciveo/media/pipelines/processors/video/resize.py +77 -0
  96. sciveo-0.1.89/sciveo/media/pipelines/processors/video/video_album.py +120 -0
  97. sciveo-0.1.89/sciveo/media/pipelines/processors/video/video_frames.py +58 -0
  98. sciveo-0.1.89/sciveo/media/pipelines/processors/video/video_resample.py +65 -0
  99. sciveo-0.1.89/sciveo/media/pipelines/queues.py +68 -0
  100. sciveo-0.1.89/sciveo/media/pipelines/server.py +81 -0
  101. sciveo-0.1.89/sciveo/media/pipelines/web/__init__.py +0 -0
  102. sciveo-0.1.89/sciveo/media/pipelines/web/server.py +106 -0
  103. sciveo-0.1.89/sciveo/media/tools/__init__.py +0 -0
  104. sciveo-0.1.89/sciveo/media/tools/video_interactive.py +149 -0
  105. sciveo-0.1.89/sciveo/ml/__init__.py +0 -0
  106. sciveo-0.1.89/sciveo/ml/base.py +55 -0
  107. sciveo-0.1.89/sciveo/ml/dataset/__init__.py +0 -0
  108. sciveo-0.1.89/sciveo/ml/dataset/object_detection.py +273 -0
  109. sciveo-0.1.89/sciveo/ml/evaluation/__init__.py +0 -0
  110. sciveo-0.1.89/sciveo/ml/evaluation/markdown.py +227 -0
  111. sciveo-0.1.89/sciveo/ml/evaluation/object_detection.py +225 -0
  112. sciveo-0.1.89/sciveo/ml/images/__init__.py +0 -0
  113. sciveo-0.1.89/sciveo/ml/images/base.py +48 -0
  114. sciveo-0.1.89/sciveo/ml/images/description.py +64 -0
  115. sciveo-0.1.89/sciveo/ml/images/embeddings.py +105 -0
  116. sciveo-0.1.89/sciveo/ml/images/object_detection.py +241 -0
  117. sciveo-0.1.89/sciveo/ml/images/tools.py +83 -0
  118. sciveo-0.1.89/sciveo/ml/images/transformers.py +316 -0
  119. sciveo-0.1.89/sciveo/ml/nlp/__init__.py +0 -0
  120. sciveo-0.1.89/sciveo/ml/nlp/embeddings.py +152 -0
  121. sciveo-0.1.89/sciveo/ml/nlp/tokenizers/__init__.py +0 -0
  122. sciveo-0.1.89/sciveo/ml/nlp/tokenizers/bpe.py +76 -0
  123. sciveo-0.1.89/sciveo/ml/video/__init__.py +0 -0
  124. sciveo-0.1.89/sciveo/ml/video/description.py +42 -0
  125. sciveo-0.1.89/sciveo/monitoring/__init__.py +0 -0
  126. sciveo-0.1.89/sciveo/monitoring/monitor.py +217 -0
  127. sciveo-0.1.89/sciveo/monitoring/power/__init__.py +0 -0
  128. sciveo-0.1.89/sciveo/monitoring/power/ems300.py +107 -0
  129. sciveo-0.1.89/sciveo/monitoring/power/sim.py +71 -0
  130. sciveo-0.1.89/sciveo/monitoring/power/tools.py +394 -0
  131. sciveo-0.1.89/sciveo/monitoring/start.py +67 -0
  132. sciveo-0.1.89/sciveo/monitoring/watchdog/__init__.py +0 -0
  133. sciveo-0.1.89/sciveo/monitoring/watchdog/base.py +56 -0
  134. sciveo-0.1.89/sciveo/monitoring/watchdog/process.py +115 -0
  135. sciveo-0.1.89/sciveo/network/__init__.py +0 -0
  136. sciveo-0.1.89/sciveo/network/camera.py +82 -0
  137. sciveo-0.1.89/sciveo/network/sniffer.py +75 -0
  138. sciveo-0.1.89/sciveo/network/tools.py +204 -0
  139. sciveo-0.1.89/sciveo/tools/__init__.py +0 -0
  140. sciveo-0.1.89/sciveo/tools/array.py +149 -0
  141. sciveo-0.1.89/sciveo/tools/aws/__init__.py +0 -0
  142. sciveo-0.1.89/sciveo/tools/aws/priority_queue.py +109 -0
  143. sciveo-0.1.89/sciveo/tools/aws/s3.py +49 -0
  144. sciveo-0.1.89/sciveo/tools/common.py +98 -0
  145. sciveo-0.1.89/sciveo/tools/complexity.py +75 -0
  146. sciveo-0.1.89/sciveo/tools/compress.py +37 -0
  147. sciveo-0.1.89/sciveo/tools/configuration.py +106 -0
  148. sciveo-0.1.89/sciveo/tools/crypto.py +68 -0
  149. {sciveo-0.0.25/sciveo/common → sciveo-0.1.89/sciveo}/tools/daemon.py +32 -4
  150. sciveo-0.1.89/sciveo/tools/draw/__init__.py +0 -0
  151. sciveo-0.1.89/sciveo/tools/draw/contours.py +147 -0
  152. sciveo-0.1.89/sciveo/tools/hardware.py +66 -0
  153. sciveo-0.1.89/sciveo/tools/http.py +134 -0
  154. sciveo-0.1.89/sciveo/tools/logger.py +63 -0
  155. sciveo-0.1.89/sciveo/tools/os.py +67 -0
  156. sciveo-0.1.89/sciveo/tools/queue.py +47 -0
  157. sciveo-0.1.89/sciveo/tools/random.py +46 -0
  158. sciveo-0.1.89/sciveo/tools/remote.py +71 -0
  159. sciveo-0.1.89/sciveo/tools/simple_counter.py +112 -0
  160. sciveo-0.1.89/sciveo/tools/synchronized.py +160 -0
  161. sciveo-0.1.89/sciveo/tools/timers.py +96 -0
  162. sciveo-0.1.89/sciveo/tools/totp.py +80 -0
  163. sciveo-0.1.89/sciveo/version.py +2 -0
  164. sciveo-0.1.89/sciveo/web/__init__.py +0 -0
  165. sciveo-0.1.89/sciveo/web/common.py +138 -0
  166. sciveo-0.0.25/README.md → sciveo-0.1.89/sciveo.egg-info/PKG-INFO +141 -3
  167. sciveo-0.1.89/sciveo.egg-info/SOURCES.txt +188 -0
  168. sciveo-0.1.89/sciveo.egg-info/entry_points.txt +2 -0
  169. sciveo-0.1.89/sciveo.egg-info/requires.txt +106 -0
  170. sciveo-0.1.89/setup.py +75 -0
  171. sciveo-0.1.89/test/test_complexity.py +36 -0
  172. sciveo-0.1.89/test/test_compress.py +27 -0
  173. sciveo-0.1.89/test/test_crypto.py +45 -0
  174. sciveo-0.1.89/test/test_eval_markdown.py +41 -0
  175. sciveo-0.1.89/test/test_ml_datasets.py +46 -0
  176. sciveo-0.1.89/test/test_monitoring.py +97 -0
  177. {sciveo-0.0.25 → sciveo-0.1.89}/test/test_sampling.py +2 -2
  178. sciveo-0.1.89/test/test_tokenizers.py +34 -0
  179. sciveo-0.1.89/test/test_totp.py +41 -0
  180. sciveo-0.0.25/sciveo/__init__.py +0 -38
  181. sciveo-0.0.25/sciveo/common/tools/hardware.py +0 -43
  182. sciveo-0.0.25/sciveo/common/tools/logger.py +0 -44
  183. sciveo-0.0.25/sciveo/common/tools/synchronized.py +0 -48
  184. sciveo-0.0.25/sciveo/monitoring/monitor.py +0 -61
  185. sciveo-0.0.25/sciveo/version.py +0 -2
  186. sciveo-0.0.25/sciveo.egg-info/SOURCES.txt +0 -33
  187. sciveo-0.0.25/sciveo.egg-info/requires.txt +0 -6
  188. sciveo-0.0.25/setup.py +0 -20
  189. {sciveo-0.0.25 → sciveo-0.1.89}/sciveo/api/__init__.py +0 -0
  190. {sciveo-0.0.25 → sciveo-0.1.89}/sciveo/common/__init__.py +0 -0
  191. {sciveo-0.0.25/sciveo/common/tools → sciveo-0.1.89/sciveo/content}/__init__.py +0 -0
  192. {sciveo-0.0.25/sciveo/content → sciveo-0.1.89/sciveo/db}/__init__.py +0 -0
  193. {sciveo-0.0.25/sciveo/monitoring → sciveo-0.1.89/sciveo/media}/__init__.py +0 -0
  194. {sciveo-0.0.25/sciveo/common → sciveo-0.1.89/sciveo}/tools/formating.py +0 -0
  195. {sciveo-0.0.25 → sciveo-0.1.89}/sciveo.egg-info/dependency_links.txt +0 -0
  196. {sciveo-0.0.25 → sciveo-0.1.89}/sciveo.egg-info/top_level.txt +0 -0
  197. {sciveo-0.0.25 → sciveo-0.1.89}/setup.cfg +0 -0
  198. {sciveo-0.0.25 → sciveo-0.1.89}/test/test_configuration.py +0 -0
  199. {sciveo-0.0.25 → sciveo-0.1.89}/test/test_runner.py +0 -0
@@ -1,26 +1,130 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciveo
3
- Version: 0.0.25
3
+ Version: 0.1.89
4
4
  Description-Content-Type: text/markdown
5
5
  Provides-Extra: mon
6
+ Provides-Extra: net
7
+ Provides-Extra: server
8
+ Provides-Extra: media
9
+ Provides-Extra: media-ml
10
+ Provides-Extra: web
11
+ Provides-Extra: db
12
+ Provides-Extra: power
13
+ Provides-Extra: all
14
+ Provides-Extra: ml
15
+
16
+ # SCIVEO - ML/AI and Scientific tools
17
+
18
+ ## Monitoring ML Infrastructure
19
+ sciveo monitoring of (ML) machines' CPU/RAM/GPU/NET/DISK/TEMP etc.
20
+ It is very easy to start and use with a single command line.
21
+
22
+ - **Monitoring** of current machine with sampling period of 60 seconds
23
+ ```shell
24
+ sciveo monitor --period 60
25
+ ```
26
+ - **Monitoring** of current machine, logging the samples to local file (in this case the ./sciveo_monitor.json default name when dir path is used)
27
+ ```shell
28
+ sciveo monitor --period 120 --output-path ./
29
+ ```
30
+
31
+ The monitor client is sendind the monitored samples to remote [sciveo](https://sciveo.com) api (init config located in ~/.sciveo/)
32
+
33
+ ### Watchdog monitoring with action
34
+ - **Memory usage** watchdog for 90% max memory, measure every 10 seconds and execute "<some command to handle the high memory event>"
35
+ ```shell
36
+ sciveo watchdog --src memory --threshold 90 --period 10 --execute "<some command to handle the high memory event>"
37
+ ```
38
+ - **Disk usage** watchdog for 80% max disk usage on /some/path/to/watch path, measure every 600 seconds and execute "<some command to handle the high disk usage event>".
39
+ ```shell
40
+ sciveo watchdog --src disk --input-path "/some/path/to/watch" --threshold 80 --period 600 --execute "find /some/path/to/watch -type f -mtime +1"
41
+ ```
42
+
43
+
44
+ ## Network tools
45
+
46
+ - **Network Scan** Networks of hosts to scan for a single port
47
+ ```shell
48
+ sciveo scan --port 22
49
+
50
+ sciveo scan --net 192.168.0.0/24 --port 22 --timeout 0.5
51
+ ```
52
+
53
+ - **Network Scan** Single Host list of ports to scan
54
+ ```shell
55
+ sciveo scan --host 192.168.0.10
56
+
57
+ sciveo scan --host 192.168.0.10 --ports [443,80]
58
+ ```
59
+
60
+ ## Remote network video recorder
61
+
62
+ - **NVR** RTSP cams video recorder
63
+ ```shell
64
+ sciveo nvr --input-path cams.json
65
+ ```
66
+
67
+ where cams.json has the cam and nvr configuration like
68
+ ```json
69
+ {
70
+ "video_retention_period": 5,
71
+ "max_video_len": 60,
72
+ "transport": "tcp",
73
+ "path": {
74
+ "tmp": "tmp/nvr/tmp",
75
+ "video": "tmp/nvr/video"
76
+ },
77
+ "cam": {
78
+ "cam_livingroom": {
79
+ "url": "rtsp://192.168.1.11/stream1"
80
+ },
81
+ "cam_kitchen": {
82
+ "url": "rtsp://rtsp://192.168.1.12"
83
+ }
84
+ }
85
+ }
86
+ ```
87
+
88
+
89
+ ## Media pipelines processing worker
90
+ - **Media Pipelines processing** service
91
+ ```shell
92
+ sciveo media-server
93
+ ```
6
94
 
7
- # SCIVEO - ML/Scientific Experiments Management Client
8
95
 
96
+ ## Experiments Management Client
9
97
  `sciveo` is a Python library that serves as a client for managing machine learning and scientific experiments on the sciveo.com platform. This library provides a convenient interface to interact with the sciveo.com API, enabling users to organize, track, and analyze their experiments efficiently.
10
98
  There are few configuration params samplers, which allows easy parameter tuning. The "auto" sampler perhaps is the easiest to use, but also
11
99
  "random" and "grid" ones are available.
12
100
 
13
- ## Features
101
+ #### Features
14
102
 
15
103
  - **Experiment Tracking:** Easily log and track your machine learning experiments.
16
104
  - **Experiment Comparison:** Compare different experiments and their results.
17
105
  - **Data Visualization:** Visualize experiment metrics and results.
18
106
  - **Integration with sciveo.com:** Seamlessly connect and synchronize with the sciveo.com platform.
107
+ - **Monitoring machines (from HPC to jetson nano):** Visualisation and metrics collection in sciveo platform.
108
+
19
109
 
20
110
  ## Installation
21
111
 
112
+ - main sciveo
22
113
  pip install sciveo
23
114
 
115
+ - optional for sciveo monitoring
116
+ pip install sciveo[mon]
117
+ - optional for sciveo network tools
118
+ pip install sciveo[net]
119
+ - for full installation, without media and ML support
120
+ pip install sciveo[all]
121
+
122
+ - for media (images/video/audio/text)
123
+ pip install sciveo[media]
124
+ - for media with ML processors
125
+ pip install sciveo[media-ml]
126
+
127
+
24
128
  ## Example usage
25
129
 
26
130
  There are few public examples in sciveo.com.
@@ -28,8 +132,36 @@ There are few public examples in sciveo.com.
28
132
  The library has local and remote mode. The local one is ready to use, but for the remote one you will need a sciveo.com account.
29
133
 
30
134
  When have sciveo account:
135
+ ```shell
136
+ sciveo init
137
+ ```
138
+ Where ~/.sciveo/ path and ~/.sciveo/default file will be created. Just need to change the secret_access_key value.
139
+
140
+ or
141
+ ```shell
31
142
  export SCIVEO_SECRET_ACCESS_KEY='my_sciveo_user_auth_token'
143
+ ```
144
+ or create a file like ~/.sciveo/some_file_name where put:
145
+ secret_access_key=my_sciveo_user_auth_token
146
+
147
+ Sciveo Monitoring cli
148
+ ```shell
149
+ sciveo monitor --period 120
150
+ ```
151
+
152
+ Monitoring started along with other python code.
153
+ ```python
154
+ import sciveo
155
+
156
+ # Non blocking monitoring, so continue the code execution after it.
157
+ sciveo.monitor(period=120, block=False)
158
+
159
+ #rest of your python code here
160
+
161
+ ```
162
+
32
163
 
164
+ Experimental Projects management
33
165
 
34
166
  ```python
35
167
 
@@ -1,26 +1,115 @@
1
- Metadata-Version: 2.1
2
- Name: sciveo
3
- Version: 0.0.25
4
- Description-Content-Type: text/markdown
5
- Provides-Extra: mon
1
+ # SCIVEO - ML/AI and Scientific tools
6
2
 
7
- # SCIVEO - ML/Scientific Experiments Management Client
3
+ ## Monitoring ML Infrastructure
4
+ sciveo monitoring of (ML) machines' CPU/RAM/GPU/NET/DISK/TEMP etc.
5
+ It is very easy to start and use with a single command line.
8
6
 
7
+ - **Monitoring** of current machine with sampling period of 60 seconds
8
+ ```shell
9
+ sciveo monitor --period 60
10
+ ```
11
+ - **Monitoring** of current machine, logging the samples to local file (in this case the ./sciveo_monitor.json default name when dir path is used)
12
+ ```shell
13
+ sciveo monitor --period 120 --output-path ./
14
+ ```
15
+
16
+ The monitor client is sendind the monitored samples to remote [sciveo](https://sciveo.com) api (init config located in ~/.sciveo/)
17
+
18
+ ### Watchdog monitoring with action
19
+ - **Memory usage** watchdog for 90% max memory, measure every 10 seconds and execute "<some command to handle the high memory event>"
20
+ ```shell
21
+ sciveo watchdog --src memory --threshold 90 --period 10 --execute "<some command to handle the high memory event>"
22
+ ```
23
+ - **Disk usage** watchdog for 80% max disk usage on /some/path/to/watch path, measure every 600 seconds and execute "<some command to handle the high disk usage event>".
24
+ ```shell
25
+ sciveo watchdog --src disk --input-path "/some/path/to/watch" --threshold 80 --period 600 --execute "find /some/path/to/watch -type f -mtime +1"
26
+ ```
27
+
28
+
29
+ ## Network tools
30
+
31
+ - **Network Scan** Networks of hosts to scan for a single port
32
+ ```shell
33
+ sciveo scan --port 22
34
+
35
+ sciveo scan --net 192.168.0.0/24 --port 22 --timeout 0.5
36
+ ```
37
+
38
+ - **Network Scan** Single Host list of ports to scan
39
+ ```shell
40
+ sciveo scan --host 192.168.0.10
41
+
42
+ sciveo scan --host 192.168.0.10 --ports [443,80]
43
+ ```
44
+
45
+ ## Remote network video recorder
46
+
47
+ - **NVR** RTSP cams video recorder
48
+ ```shell
49
+ sciveo nvr --input-path cams.json
50
+ ```
51
+
52
+ where cams.json has the cam and nvr configuration like
53
+ ```json
54
+ {
55
+ "video_retention_period": 5,
56
+ "max_video_len": 60,
57
+ "transport": "tcp",
58
+ "path": {
59
+ "tmp": "tmp/nvr/tmp",
60
+ "video": "tmp/nvr/video"
61
+ },
62
+ "cam": {
63
+ "cam_livingroom": {
64
+ "url": "rtsp://192.168.1.11/stream1"
65
+ },
66
+ "cam_kitchen": {
67
+ "url": "rtsp://rtsp://192.168.1.12"
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+
74
+ ## Media pipelines processing worker
75
+ - **Media Pipelines processing** service
76
+ ```shell
77
+ sciveo media-server
78
+ ```
79
+
80
+
81
+ ## Experiments Management Client
9
82
  `sciveo` is a Python library that serves as a client for managing machine learning and scientific experiments on the sciveo.com platform. This library provides a convenient interface to interact with the sciveo.com API, enabling users to organize, track, and analyze their experiments efficiently.
10
83
  There are few configuration params samplers, which allows easy parameter tuning. The "auto" sampler perhaps is the easiest to use, but also
11
84
  "random" and "grid" ones are available.
12
85
 
13
- ## Features
86
+ #### Features
14
87
 
15
88
  - **Experiment Tracking:** Easily log and track your machine learning experiments.
16
89
  - **Experiment Comparison:** Compare different experiments and their results.
17
90
  - **Data Visualization:** Visualize experiment metrics and results.
18
91
  - **Integration with sciveo.com:** Seamlessly connect and synchronize with the sciveo.com platform.
92
+ - **Monitoring machines (from HPC to jetson nano):** Visualisation and metrics collection in sciveo platform.
93
+
19
94
 
20
95
  ## Installation
21
96
 
97
+ - main sciveo
22
98
  pip install sciveo
23
99
 
100
+ - optional for sciveo monitoring
101
+ pip install sciveo[mon]
102
+ - optional for sciveo network tools
103
+ pip install sciveo[net]
104
+ - for full installation, without media and ML support
105
+ pip install sciveo[all]
106
+
107
+ - for media (images/video/audio/text)
108
+ pip install sciveo[media]
109
+ - for media with ML processors
110
+ pip install sciveo[media-ml]
111
+
112
+
24
113
  ## Example usage
25
114
 
26
115
  There are few public examples in sciveo.com.
@@ -28,8 +117,36 @@ There are few public examples in sciveo.com.
28
117
  The library has local and remote mode. The local one is ready to use, but for the remote one you will need a sciveo.com account.
29
118
 
30
119
  When have sciveo account:
120
+ ```shell
121
+ sciveo init
122
+ ```
123
+ Where ~/.sciveo/ path and ~/.sciveo/default file will be created. Just need to change the secret_access_key value.
124
+
125
+ or
126
+ ```shell
31
127
  export SCIVEO_SECRET_ACCESS_KEY='my_sciveo_user_auth_token'
128
+ ```
129
+ or create a file like ~/.sciveo/some_file_name where put:
130
+ secret_access_key=my_sciveo_user_auth_token
131
+
132
+ Sciveo Monitoring cli
133
+ ```shell
134
+ sciveo monitor --period 120
135
+ ```
136
+
137
+ Monitoring started along with other python code.
138
+ ```python
139
+ import sciveo
140
+
141
+ # Non blocking monitoring, so continue the code execution after it.
142
+ sciveo.monitor(period=120, block=False)
143
+
144
+ #rest of your python code here
145
+
146
+ ```
147
+
32
148
 
149
+ Experimental Projects management
33
150
 
34
151
  ```python
35
152
 
@@ -139,4 +256,4 @@ sciveo.start(
139
256
  ### Who do I talk to? ###
140
257
 
141
258
  * Pavlin Georgiev
142
- * pavlin@softel.bg
259
+ * pavlin@softel.bg
@@ -0,0 +1,56 @@
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
+ # 2023
10
+ #
11
+
12
+ from builtins import ImportError
13
+
14
+ try:
15
+
16
+ import os
17
+ import time
18
+
19
+ from sciveo.tools.logger import *
20
+ from sciveo.tools.daemon import TasksDaemon, __upload_content__
21
+ from sciveo.content.runner import ProjectRunner
22
+ from sciveo.content.dataset import Dataset
23
+ from sciveo.version import __version__
24
+
25
+
26
+ TasksDaemon.current = TasksDaemon(num_threads=int(os.environ.get("SCIVEO_TASKS_NUM_THREADS", 1)))
27
+
28
+
29
+ # New Experiment
30
+ def open():
31
+ if ProjectRunner.current is not None:
32
+ return ProjectRunner.current.project
33
+ else:
34
+ error("there is no started project")
35
+
36
+ def start(project, function, configuration={}, **kwargs):
37
+ TasksDaemon.current.start()
38
+ ProjectRunner.current = ProjectRunner(project=project, function=function, configuration=configuration, **kwargs)
39
+ ProjectRunner.current.run()
40
+
41
+ # Dataset info
42
+ def dataset(info={}):
43
+ return Dataset.get(info)
44
+
45
+ # Monitoring start
46
+ def monitor(**kwargs):
47
+ from sciveo.monitoring.start import MonitorStart
48
+ MonitorStart(**kwargs)()
49
+
50
+ # Network tools
51
+ def network(**kwargs):
52
+ from sciveo.network.tools import NetworkTools
53
+ return NetworkTools(**kwargs)
54
+
55
+ except ImportError as e:
56
+ pass
@@ -14,16 +14,19 @@ import json
14
14
  from urllib import request, parse
15
15
  from urllib.error import HTTPError
16
16
 
17
- from sciveo.common.tools.logger import *
17
+ from sciveo.tools.logger import *
18
+ from sciveo.tools.configuration import GlobalConfiguration
18
19
 
19
20
 
20
21
  class APIRemoteClient:
21
22
  def __init__(self, base_url=None, ver=1):
23
+ self.config = GlobalConfiguration.get()
24
+ self.auth_token = None
22
25
  if base_url is None:
23
- base_url = os.environ.get("SCIVEO_API_BASE_URL", "https://sciveo.com")
26
+ base_url = self.config["api_base_url"]
24
27
  self.base_url = f"{base_url}/api/v{ver}/"
25
- self.headers = { "Auth-Token": os.environ['SCIVEO_SECRET_ACCESS_KEY'] }
26
- debug(type(self).__name__, f"base url: {self.base_url}")
28
+ self.headers = { "Auth-Token": self.config['secret_access_key'] }
29
+ debug(f"base url: {self.base_url}")
27
30
 
28
31
  def POST_SCI(self, content_type, data, timeout=30):
29
32
  return self.POST(f"sci/{content_type}/", data, timeout)
@@ -44,7 +47,7 @@ class APIRemoteClient:
44
47
  return result
45
48
 
46
49
  def GET(self, url, timeout=30):
47
- url = f"{self.base_url}{url}&auth_token={os.environ['SCIVEO_SECRET_ACCESS_KEY']}"
50
+ url = f"{self.base_url}{url}&auth_token={self.config['secret_access_key']}"
48
51
  result = False
49
52
  try:
50
53
  # debug("GET", url)
@@ -0,0 +1,67 @@
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
+ # 2023
10
+ #
11
+
12
+ from sciveo.tools.logger import *
13
+ from sciveo.tools.timers import Timer
14
+ from sciveo.tools.configuration import GlobalConfiguration
15
+
16
+
17
+ class Predictors:
18
+ instance = None
19
+
20
+ def __init__(self, predictors=None):
21
+ if predictors is not None:
22
+ self.list_predictors = predictors
23
+ else:
24
+ from sciveo.ml.images.embeddings import ImageEmbedding
25
+ from sciveo.ml.nlp.embeddings import TextEmbedding
26
+ self.list_predictors = {
27
+ "TextEmbedding": TextEmbedding(),
28
+ "ImageEmbedding": ImageEmbedding(),
29
+ }
30
+
31
+ self.stats = {}
32
+
33
+ @staticmethod
34
+ def get():
35
+ if Predictors.instance is None:
36
+ Predictors.instance = Predictors(GlobalConfiguration.get().data.get("API_PREDICTORS", None))
37
+ return Predictors.instance
38
+
39
+ @staticmethod
40
+ def set(predictors):
41
+ Predictors.instance = predictors
42
+
43
+ def predict(self, predictor_name, X):
44
+ t = Timer()
45
+ predicted = self.list_predictors[predictor_name].predict(X)
46
+ self.stats.setdefault(predictor_name, {"elapsed": 0.0, "count": 0})
47
+ self.stats[predictor_name]["elapsed"] += t.stop()
48
+ self.stats[predictor_name]["count"] += len(X)
49
+ return predicted
50
+
51
+ def train(self, predictor_name, X, Y_true=None):
52
+ t = Timer()
53
+ result = self.list_predictors[predictor_name].train(X, Y_true)
54
+ self.stats.setdefault(predictor_name, {"elapsed": 0.0, "count": 0})
55
+ self.stats[predictor_name]["elapsed"] += t.stop()
56
+ self.stats[predictor_name]["count"] += len(X)
57
+ return result
58
+
59
+ def describe(self):
60
+ result = []
61
+ for k, v in self.list_predictors.items():
62
+ result.append([k, v.describe(), self.stats.get(k, "")])
63
+ return result
64
+
65
+ def print(self):
66
+ for k, v in self.list_predictors.items():
67
+ info("predictor", k, v.describe())
@@ -0,0 +1,80 @@
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
+ # 2023
10
+ #
11
+
12
+ import os
13
+ import time
14
+ from flask import Flask, jsonify, render_template, request, url_for, Response, abort
15
+ from waitress import serve
16
+
17
+ from sciveo.tools.logger import *
18
+ from sciveo.tools.daemon import DaemonBase
19
+ from sciveo.tools.timers import Timer
20
+ from sciveo.tools.compress import CompressJsonData
21
+ from sciveo.tools.configuration import GlobalConfiguration
22
+ from sciveo.api.predictors import Predictors
23
+
24
+
25
+ CONFIG = GlobalConfiguration.get()
26
+ SCI_API_AUTH_TOKEN = CONFIG["api_auth_token"]
27
+ SCI_API_PREFIX = CONFIG["api_prefix"]
28
+
29
+
30
+ app = Flask(__name__)
31
+
32
+
33
+ def authenticate():
34
+ token = request.headers.get('Authorization')
35
+ if token != f"Bearer {SCI_API_AUTH_TOKEN}":
36
+ abort(401, 'Unauthorized')
37
+
38
+ @app.before_request
39
+ def before_request_func():
40
+ authenticate()
41
+
42
+ @app.route(f'/{SCI_API_PREFIX}/predict', methods=['POST'])
43
+ def predict_endpoint():
44
+ result = {"error": "invalid data"}
45
+ try:
46
+ if request.is_json:
47
+ data = request.json
48
+ if "predictor" in data and "X" in data:
49
+ t = Timer()
50
+ predicted = Predictors.get().predict(data["predictor"], data["X"])
51
+
52
+ if data.get("compressed", 0) > 0:
53
+ predicted = CompressJsonData().compress(predicted)
54
+
55
+ result = {
56
+ data["predictor"]: predicted,
57
+ "stats": {
58
+ "elapsed": t.stop(),
59
+ "count": len(data["X"])
60
+ }
61
+ }
62
+ except Exception as e:
63
+ exception("predict_endpoint", e)
64
+ return jsonify(result)
65
+
66
+
67
+ class WebServerDaemon(DaemonBase):
68
+ def __init__(self, host="127.0.0.1", port=8901, predictors=None):
69
+ super().__init__()
70
+ self.host = host
71
+ self.port = port
72
+
73
+ if predictors is not None:
74
+ Predictors.set(predictors)
75
+
76
+ def run(self):
77
+ info("run", [self.host, self.port])
78
+ Predictors.get().print()
79
+
80
+ serve(app, host=self.host, port=self.port, threads=1, connection_limit=10)
@@ -13,8 +13,9 @@ import os
13
13
  import json
14
14
  from urllib import request, parse
15
15
  from urllib.error import HTTPError
16
+ import requests
16
17
 
17
- from sciveo.common.tools.logger import *
18
+ from sciveo.tools.logger import *
18
19
  from sciveo.api.base import *
19
20
 
20
21
 
@@ -29,22 +30,20 @@ class APIFileUploader:
29
30
  APIFileUploader.api = APIRemoteClient()
30
31
 
31
32
  def __call__(self):
32
- import requests
33
-
34
33
  file_name = self.local_path.split("/")[-1]
35
34
  url_presigned_post = f"aws/s3/presigned_post/?content_type={self.content_type}&file_name={file_name}"
36
35
  presigned_post = APIFileUploader.api.GET(url_presigned_post)
37
- debug(type(self).__name__, "upload presigned_post", url_presigned_post, "=>", presigned_post)
36
+ debug("upload presigned_post", url_presigned_post, "=>", presigned_post)
38
37
  if "fields" in presigned_post:
39
38
  response = None
40
39
  with open(self.local_path, 'rb') as fh:
41
40
  files = { 'file': (presigned_post['fields']['key'], fh) }
42
41
  response = requests.post(presigned_post['url'], data=presigned_post['fields'], files=files)
43
42
  if response.status_code == 204:
44
- debug(type(self).__name__, self.content_type, self.local_path, "uploaded")
43
+ debug(self.content_type, self.local_path, "uploaded")
45
44
  url_append = f"content/append/?content_type={self.content_type}&name={file_name}&key={presigned_post['fields']['key']}&parent_id={self.parent_guid}"
46
45
  result = APIFileUploader.api.GET(url_append)
47
- debug(type(self).__name__, "upload", url_append, result, "appended")
46
+ debug("upload", url_append, result, "appended")
48
47
  else:
49
- error(type(self).__name__, "upload", self.content_type, self.local_path, "FAIL")
48
+ error("upload", self.content_type, self.local_path, "FAIL")
50
49