nedo-vision-worker 1.0.0__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 (98) hide show
  1. nedo_vision_worker-1.0.0/PKG-INFO +563 -0
  2. nedo_vision_worker-1.0.0/README.md +510 -0
  3. nedo_vision_worker-1.0.0/nedo_vision_worker/__init__.py +10 -0
  4. nedo_vision_worker-1.0.0/nedo_vision_worker/cli.py +195 -0
  5. nedo_vision_worker-1.0.0/nedo_vision_worker/config/ConfigurationManager.py +196 -0
  6. nedo_vision_worker-1.0.0/nedo_vision_worker/config/__init__.py +1 -0
  7. nedo_vision_worker-1.0.0/nedo_vision_worker/database/DatabaseManager.py +219 -0
  8. nedo_vision_worker-1.0.0/nedo_vision_worker/database/__init__.py +1 -0
  9. nedo_vision_worker-1.0.0/nedo_vision_worker/doctor.py +453 -0
  10. nedo_vision_worker-1.0.0/nedo_vision_worker/initializer/AppInitializer.py +78 -0
  11. nedo_vision_worker-1.0.0/nedo_vision_worker/initializer/__init__.py +1 -0
  12. nedo_vision_worker-1.0.0/nedo_vision_worker/models/__init__.py +15 -0
  13. nedo_vision_worker-1.0.0/nedo_vision_worker/models/ai_model.py +29 -0
  14. nedo_vision_worker-1.0.0/nedo_vision_worker/models/auth.py +14 -0
  15. nedo_vision_worker-1.0.0/nedo_vision_worker/models/config.py +9 -0
  16. nedo_vision_worker-1.0.0/nedo_vision_worker/models/dataset_source.py +30 -0
  17. nedo_vision_worker-1.0.0/nedo_vision_worker/models/logs.py +9 -0
  18. nedo_vision_worker-1.0.0/nedo_vision_worker/models/ppe_detection.py +39 -0
  19. nedo_vision_worker-1.0.0/nedo_vision_worker/models/ppe_detection_label.py +20 -0
  20. nedo_vision_worker-1.0.0/nedo_vision_worker/models/restricted_area_violation.py +20 -0
  21. nedo_vision_worker-1.0.0/nedo_vision_worker/models/user.py +10 -0
  22. nedo_vision_worker-1.0.0/nedo_vision_worker/models/worker_source.py +19 -0
  23. nedo_vision_worker-1.0.0/nedo_vision_worker/models/worker_source_pipeline.py +21 -0
  24. nedo_vision_worker-1.0.0/nedo_vision_worker/models/worker_source_pipeline_config.py +24 -0
  25. nedo_vision_worker-1.0.0/nedo_vision_worker/models/worker_source_pipeline_debug.py +15 -0
  26. nedo_vision_worker-1.0.0/nedo_vision_worker/models/worker_source_pipeline_detection.py +14 -0
  27. nedo_vision_worker-1.0.0/nedo_vision_worker/protos/AIModelService_pb2.py +46 -0
  28. nedo_vision_worker-1.0.0/nedo_vision_worker/protos/AIModelService_pb2_grpc.py +140 -0
  29. nedo_vision_worker-1.0.0/nedo_vision_worker/protos/DatasetSourceService_pb2.py +46 -0
  30. nedo_vision_worker-1.0.0/nedo_vision_worker/protos/DatasetSourceService_pb2_grpc.py +140 -0
  31. nedo_vision_worker-1.0.0/nedo_vision_worker/protos/HumanDetectionService_pb2.py +44 -0
  32. nedo_vision_worker-1.0.0/nedo_vision_worker/protos/HumanDetectionService_pb2_grpc.py +140 -0
  33. nedo_vision_worker-1.0.0/nedo_vision_worker/protos/PPEDetectionService_pb2.py +46 -0
  34. nedo_vision_worker-1.0.0/nedo_vision_worker/protos/PPEDetectionService_pb2_grpc.py +140 -0
  35. nedo_vision_worker-1.0.0/nedo_vision_worker/protos/VisionWorkerService_pb2.py +72 -0
  36. nedo_vision_worker-1.0.0/nedo_vision_worker/protos/VisionWorkerService_pb2_grpc.py +471 -0
  37. nedo_vision_worker-1.0.0/nedo_vision_worker/protos/WorkerSourcePipelineService_pb2.py +64 -0
  38. nedo_vision_worker-1.0.0/nedo_vision_worker/protos/WorkerSourcePipelineService_pb2_grpc.py +312 -0
  39. nedo_vision_worker-1.0.0/nedo_vision_worker/protos/WorkerSourceService_pb2.py +50 -0
  40. nedo_vision_worker-1.0.0/nedo_vision_worker/protos/WorkerSourceService_pb2_grpc.py +183 -0
  41. nedo_vision_worker-1.0.0/nedo_vision_worker/protos/__init__.py +1 -0
  42. nedo_vision_worker-1.0.0/nedo_vision_worker/repositories/AIModelRepository.py +44 -0
  43. nedo_vision_worker-1.0.0/nedo_vision_worker/repositories/DatasetSourceRepository.py +150 -0
  44. nedo_vision_worker-1.0.0/nedo_vision_worker/repositories/PPEDetectionRepository.py +112 -0
  45. nedo_vision_worker-1.0.0/nedo_vision_worker/repositories/RestrictedAreaRepository.py +88 -0
  46. nedo_vision_worker-1.0.0/nedo_vision_worker/repositories/WorkerSourcePipelineDebugRepository.py +90 -0
  47. nedo_vision_worker-1.0.0/nedo_vision_worker/repositories/WorkerSourcePipelineDetectionRepository.py +48 -0
  48. nedo_vision_worker-1.0.0/nedo_vision_worker/repositories/WorkerSourcePipelineRepository.py +174 -0
  49. nedo_vision_worker-1.0.0/nedo_vision_worker/repositories/WorkerSourceRepository.py +46 -0
  50. nedo_vision_worker-1.0.0/nedo_vision_worker/repositories/__init__.py +1 -0
  51. nedo_vision_worker-1.0.0/nedo_vision_worker/services/AIModelClient.py +362 -0
  52. nedo_vision_worker-1.0.0/nedo_vision_worker/services/ConnectionInfoClient.py +57 -0
  53. nedo_vision_worker-1.0.0/nedo_vision_worker/services/DatasetSourceClient.py +88 -0
  54. nedo_vision_worker-1.0.0/nedo_vision_worker/services/FileToRTMPServer.py +78 -0
  55. nedo_vision_worker-1.0.0/nedo_vision_worker/services/GrpcClientBase.py +155 -0
  56. nedo_vision_worker-1.0.0/nedo_vision_worker/services/GrpcClientManager.py +141 -0
  57. nedo_vision_worker-1.0.0/nedo_vision_worker/services/ImageUploadClient.py +82 -0
  58. nedo_vision_worker-1.0.0/nedo_vision_worker/services/PPEDetectionClient.py +108 -0
  59. nedo_vision_worker-1.0.0/nedo_vision_worker/services/RTSPtoRTMPStreamer.py +98 -0
  60. nedo_vision_worker-1.0.0/nedo_vision_worker/services/RestrictedAreaClient.py +100 -0
  61. nedo_vision_worker-1.0.0/nedo_vision_worker/services/SystemUsageClient.py +77 -0
  62. nedo_vision_worker-1.0.0/nedo_vision_worker/services/VideoStreamClient.py +161 -0
  63. nedo_vision_worker-1.0.0/nedo_vision_worker/services/WorkerSourceClient.py +215 -0
  64. nedo_vision_worker-1.0.0/nedo_vision_worker/services/WorkerSourcePipelineClient.py +393 -0
  65. nedo_vision_worker-1.0.0/nedo_vision_worker/services/WorkerSourceUpdater.py +134 -0
  66. nedo_vision_worker-1.0.0/nedo_vision_worker/services/WorkerStatusClient.py +65 -0
  67. nedo_vision_worker-1.0.0/nedo_vision_worker/services/__init__.py +1 -0
  68. nedo_vision_worker-1.0.0/nedo_vision_worker/util/HardwareID.py +104 -0
  69. nedo_vision_worker-1.0.0/nedo_vision_worker/util/ImageUploader.py +92 -0
  70. nedo_vision_worker-1.0.0/nedo_vision_worker/util/Networking.py +94 -0
  71. nedo_vision_worker-1.0.0/nedo_vision_worker/util/PlatformDetector.py +50 -0
  72. nedo_vision_worker-1.0.0/nedo_vision_worker/util/SystemMonitor.py +299 -0
  73. nedo_vision_worker-1.0.0/nedo_vision_worker/util/VideoProbeUtil.py +120 -0
  74. nedo_vision_worker-1.0.0/nedo_vision_worker/util/__init__.py +1 -0
  75. nedo_vision_worker-1.0.0/nedo_vision_worker/worker/CoreActionWorker.py +125 -0
  76. nedo_vision_worker-1.0.0/nedo_vision_worker/worker/DataSenderWorker.py +168 -0
  77. nedo_vision_worker-1.0.0/nedo_vision_worker/worker/DataSyncWorker.py +143 -0
  78. nedo_vision_worker-1.0.0/nedo_vision_worker/worker/DatasetFrameSender.py +208 -0
  79. nedo_vision_worker-1.0.0/nedo_vision_worker/worker/DatasetFrameWorker.py +412 -0
  80. nedo_vision_worker-1.0.0/nedo_vision_worker/worker/PPEDetectionManager.py +86 -0
  81. nedo_vision_worker-1.0.0/nedo_vision_worker/worker/PipelineActionWorker.py +129 -0
  82. nedo_vision_worker-1.0.0/nedo_vision_worker/worker/PipelineImageWorker.py +116 -0
  83. nedo_vision_worker-1.0.0/nedo_vision_worker/worker/RabbitMQListener.py +170 -0
  84. nedo_vision_worker-1.0.0/nedo_vision_worker/worker/RestrictedAreaManager.py +85 -0
  85. nedo_vision_worker-1.0.0/nedo_vision_worker/worker/SystemUsageManager.py +111 -0
  86. nedo_vision_worker-1.0.0/nedo_vision_worker/worker/VideoStreamWorker.py +139 -0
  87. nedo_vision_worker-1.0.0/nedo_vision_worker/worker/WorkerManager.py +155 -0
  88. nedo_vision_worker-1.0.0/nedo_vision_worker/worker/__init__.py +1 -0
  89. nedo_vision_worker-1.0.0/nedo_vision_worker/worker_service.py +264 -0
  90. nedo_vision_worker-1.0.0/nedo_vision_worker.egg-info/PKG-INFO +563 -0
  91. nedo_vision_worker-1.0.0/nedo_vision_worker.egg-info/SOURCES.txt +96 -0
  92. nedo_vision_worker-1.0.0/nedo_vision_worker.egg-info/dependency_links.txt +1 -0
  93. nedo_vision_worker-1.0.0/nedo_vision_worker.egg-info/entry_points.txt +2 -0
  94. nedo_vision_worker-1.0.0/nedo_vision_worker.egg-info/requires.txt +25 -0
  95. nedo_vision_worker-1.0.0/nedo_vision_worker.egg-info/top_level.txt +1 -0
  96. nedo_vision_worker-1.0.0/pyproject.toml +149 -0
  97. nedo_vision_worker-1.0.0/setup.cfg +4 -0
  98. nedo_vision_worker-1.0.0/setup.py +13 -0
@@ -0,0 +1,563 @@
1
+ Metadata-Version: 2.4
2
+ Name: nedo-vision-worker
3
+ Version: 1.0.0
4
+ Summary: Nedo Vision Worker Service Library for AI Vision Processing
5
+ Author-email: Willy Achmat Fauzi <willy.achmat@gmail.com>
6
+ Maintainer-email: Willy Achmat Fauzi <willy.achmat@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://gitlab.com/sindika/research/nedo-vision/nedo-vision-worker-service
9
+ Project-URL: Documentation, https://gitlab.com/sindika/research/nedo-vision/nedo-vision-worker-service/-/blob/main/README.md
10
+ Project-URL: Repository, https://gitlab.com/sindika/research/nedo-vision/nedo-vision-worker-service
11
+ Project-URL: Bug Reports, https://gitlab.com/sindika/research/nedo-vision/nedo-vision-worker-service/-/issues
12
+ Keywords: computer-vision,machine-learning,ai,worker-service,deep-learning,object-detection,neural-networks,video-processing
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Operating System :: Microsoft :: Windows
18
+ Classifier: Operating System :: MacOS
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3 :: Only
21
+ Classifier: Programming Language :: Python :: 3.8
22
+ Classifier: Programming Language :: Python :: 3.9
23
+ Classifier: Programming Language :: Python :: 3.10
24
+ Classifier: Programming Language :: Python :: 3.11
25
+ Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Programming Language :: Python :: 3.13
27
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
+ Classifier: Topic :: Multimedia :: Video
29
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
30
+ Classifier: Topic :: System :: Hardware
31
+ Classifier: Environment :: GPU
32
+ Classifier: Environment :: No Input/Output (Daemon)
33
+ Requires-Python: >=3.8
34
+ Description-Content-Type: text/markdown
35
+ Requires-Dist: alembic>=1.8.0
36
+ Requires-Dist: ffmpeg-python>=0.2.0
37
+ Requires-Dist: grpcio>=1.50.0
38
+ Requires-Dist: pika>=1.3.0
39
+ Requires-Dist: protobuf>=3.20.0
40
+ Requires-Dist: psutil>=5.9.0
41
+ Requires-Dist: requests>=2.28.0
42
+ Requires-Dist: SQLAlchemy>=1.4.0
43
+ Requires-Dist: opencv-python>=4.6.0; platform_machine not in "aarch64 armv7l"
44
+ Requires-Dist: opencv-python-headless>=4.6.0; platform_machine in "aarch64 armv7l"
45
+ Requires-Dist: pynvml>=11.4.1; platform_system != "Darwin" or platform_machine != "arm64"
46
+ Provides-Extra: dev
47
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
48
+ Requires-Dist: black>=22.0.0; extra == "dev"
49
+ Requires-Dist: isort>=5.10.0; extra == "dev"
50
+ Requires-Dist: mypy>=0.950; extra == "dev"
51
+ Requires-Dist: flake8>=4.0.0; extra == "dev"
52
+ Requires-Dist: pre-commit>=2.17.0; extra == "dev"
53
+
54
+ # Nedo Vision Worker Service
55
+
56
+ A high-performance, multiplatform Python worker service for the Nedo Vision system that handles AI-powered computer vision tasks with GPU acceleration support.
57
+
58
+ ## 🚀 Features
59
+
60
+ - **🎯 AI-Powered Computer Vision** - Advanced object detection and video processing
61
+ - **🔐 Token-Based Authentication** - Secure worker registration and management
62
+ - **⚡ GPU Acceleration** - NVIDIA CUDA support for high-performance inference
63
+ - **🌍 Multiplatform Support** - Linux, Windows, macOS, ARM devices, and cloud platforms
64
+ - **🚀 Jetson Optimized** - Native support for NVIDIA Jetson devices
65
+ - **☁️ Cloud Ready** - Docker, Kubernetes, and major cloud platform support
66
+ - **🔧 Self-Diagnostic** - Built-in system requirements checker
67
+ - **📊 Real-time Monitoring** - System usage and performance metrics
68
+
69
+ ## 📋 System Requirements
70
+
71
+ ### Minimum Requirements
72
+
73
+ - **Python**: 3.8+
74
+ - **CPU**: 2 cores, 1.5 GHz
75
+ - **RAM**: 2 GB
76
+ - **Storage**: 1 GB free space
77
+
78
+ ### Recommended Requirements
79
+
80
+ - **CPU**: 4+ cores, 2.0+ GHz
81
+ - **RAM**: 4+ GB (8+ GB for GPU acceleration)
82
+ - **GPU**: NVIDIA GPU with CUDA support (optional)
83
+ - **Storage**: 5+ GB free space
84
+
85
+ ### Supported Platforms
86
+
87
+ - **Linux** (x86_64, ARM64, ARMv7) - Ubuntu, Debian, CentOS, Alpine
88
+ - **Windows** (x86_64) - Windows 10+, Server 2019+
89
+ - **macOS** (x86_64, Apple Silicon) - macOS 10.15+
90
+ - **NVIDIA Jetson** - Nano, Xavier NX, Xavier AGX, Orin
91
+ - **Cloud Platforms** - AWS, GCP, Azure (with GPU instance support)
92
+
93
+ ## 🛠️ Installation
94
+
95
+ ### Quick Install (PyPI)
96
+
97
+ ```bash
98
+ pip install nedo-vision-worker
99
+ ```
100
+
101
+ ### Platform-Specific Installation
102
+
103
+ #### Standard Linux/Windows/macOS
104
+
105
+ ```bash
106
+ # Install from PyPI
107
+ pip install nedo-vision-worker
108
+
109
+ # Verify installation
110
+ nedo-worker doctor
111
+ ```
112
+
113
+ #### NVIDIA Jetson Devices
114
+
115
+ ```bash
116
+ # Use system OpenCV for optimal performance
117
+ sudo apt install python3-opencv
118
+
119
+ # Install without OpenCV dependency
120
+ pip install nedo-vision-worker --no-deps
121
+ pip install alembic ffmpeg-python grpcio pika protobuf psutil pynvml requests SQLAlchemy
122
+
123
+ # Verify Jetson-specific features
124
+ nedo-worker doctor
125
+ ```
126
+
127
+ #### ARM Devices (Raspberry Pi, etc.)
128
+
129
+ ```bash
130
+ # Install with ARM-optimized packages
131
+ pip install nedo-vision-worker
132
+
133
+ # For headless servers, use lightweight OpenCV
134
+ pip install opencv-python-headless --upgrade
135
+ ```
136
+
137
+ #### Docker Deployment
138
+
139
+ ```dockerfile
140
+ # GPU-enabled container
141
+ FROM nvidia/cuda:11.8-runtime-ubuntu20.04
142
+ RUN pip install nedo-vision-worker
143
+
144
+ # CPU-only container
145
+ FROM python:3.9-slim
146
+ RUN apt-get update && apt-get install -y ffmpeg
147
+ RUN pip install nedo-vision-worker
148
+ ```
149
+
150
+ ### Development Installation
151
+
152
+ ```bash
153
+ # Clone the repository
154
+ git clone https://gitlab.com/sindika/research/nedo-vision/nedo-vision-worker-service
155
+ cd nedo-vision-worker-service
156
+
157
+ # Create virtual environment
158
+ python -m venv venv
159
+ source venv/bin/activate # On Windows: venv\Scripts\activate
160
+
161
+ # Install in development mode
162
+ pip install -e .
163
+
164
+ # Install development dependencies
165
+ pip install -e .[dev]
166
+ ```
167
+
168
+ ## 🔍 System Diagnostics
169
+
170
+ Before running the worker service, use the built-in diagnostic tool to verify your system:
171
+
172
+ ```bash
173
+ nedo-worker doctor
174
+ ```
175
+
176
+ This will check:
177
+
178
+ - ✅ Platform compatibility and architecture
179
+ - ✅ Python version and dependencies
180
+ - ✅ FFmpeg installation and functionality
181
+ - ✅ OpenCV installation and optimizations
182
+ - ✅ gRPC connectivity
183
+ - ✅ NVIDIA GPU support and capabilities
184
+ - ✅ Storage permissions
185
+ - ✅ Network connectivity
186
+
187
+ ## 📖 Quick Start
188
+
189
+ ### 1. Get Your Worker Token
190
+
191
+ 1. Access the Nedo Vision frontend
192
+ 2. Navigate to Worker Management
193
+ 3. Create a new worker
194
+ 4. Copy the generated authentication token
195
+
196
+ ### 2. Run System Check
197
+
198
+ ```bash
199
+ nedo-worker doctor
200
+ ```
201
+
202
+ ### 3. Start the Worker Service
203
+
204
+ ```bash
205
+ # Basic usage
206
+ nedo-worker run --token YOUR_TOKEN_HERE
207
+
208
+ # With custom configuration
209
+ nedo-worker run --token YOUR_TOKEN_HERE \
210
+ --server-host custom.server.com \
211
+ --storage-path /custom/storage/path \
212
+ --system-usage-interval 60
213
+ ```
214
+
215
+ ## 💻
216
+
217
+ ## 💻 Usage
218
+
219
+ ### Command Line Interface
220
+
221
+ The service uses a modern CLI with subcommands:
222
+
223
+ ```bash
224
+ # Check system compatibility and requirements
225
+ nedo-worker doctor
226
+
227
+ # Run the worker service
228
+ nedo-worker run --token YOUR_TOKEN
229
+
230
+ # Get help
231
+ nedo-worker --help
232
+ nedo-worker run --help
233
+ nedo-worker doctor --help
234
+ ```
235
+
236
+ ### Available Commands
237
+
238
+ #### `doctor` - System Diagnostics
239
+
240
+ ```bash
241
+ # Run comprehensive system check
242
+ nedo-worker doctor
243
+
244
+ # Check specific components
245
+ nedo-worker doctor --verbose
246
+ ```
247
+
248
+ #### `run` - Start Worker Service
249
+
250
+ ```bash
251
+ # Basic usage
252
+ nedo-worker run --token YOUR_TOKEN
253
+
254
+ # Advanced configuration
255
+ nedo-worker run \
256
+ --token YOUR_TOKEN \
257
+ --server-host be.vision.sindika.co.id \
258
+ --server-port 50051 \
259
+ --storage-path ./data \
260
+ --system-usage-interval 30
261
+ ```
262
+
263
+ ### Configuration Options
264
+
265
+ | Parameter | Description | Default | Required |
266
+ | ------------------------- | --------------------------------- | ------------------------- | -------- |
267
+ | `--token` | Worker authentication token | - | ✅ |
268
+ | `--server-host` | Backend server hostname | `be.vision.sindika.co.id` | ❌ |
269
+ | `--server-port` | Backend server port | `50051` | ❌ |
270
+ | `--storage-path` | Local storage directory ⚠️\* | `./data` | ❌ |
271
+ | `--system-usage-interval` | System metrics interval (seconds) | `30` | ❌ |
272
+
273
+ > **⚠️ Storage Path Note**: If using **Nedo Vision Worker Core**, both services must use the **same storage path** for proper data sharing and model access.
274
+
275
+ ### Programmatic Usage
276
+
277
+ ```python
278
+ from nedo_vision_worker.worker_service import WorkerService
279
+
280
+ # Create service instance
281
+ service = WorkerService(
282
+ server_host="be.vision.sindika.co.id",
283
+ token="your-token-here",
284
+ storage_path="./custom_storage",
285
+ system_usage_interval=60
286
+ )
287
+
288
+ # Initialize and run
289
+ if service.initialize():
290
+ print("Service initialized successfully")
291
+ service.run() # This blocks until service stops
292
+ else:
293
+ print("Failed to initialize service")
294
+ ```
295
+
296
+ ### Connection Information Client
297
+
298
+ ```python
299
+ from nedo_vision_worker.services.ConnectionInfoClient import ConnectionInfoClient
300
+
301
+ # Create client
302
+ client = ConnectionInfoClient(
303
+ host="be.vision.sindika.co.id",
304
+ port=50051,
305
+ token="your-token-here"
306
+ )
307
+
308
+ # Get connection information
309
+ result = client.get_connection_info()
310
+ if result["success"]:
311
+ print(f"RabbitMQ Host: {result['rabbitmq_host']}")
312
+ print(f"RabbitMQ Port: {result['rabbitmq_port']}")
313
+ print(f"Database URL: {result['database_url']}")
314
+ else:
315
+ print(f"Error: {result['error']}")
316
+ ```
317
+
318
+ ## 🔐 Authentication Flow
319
+
320
+ 1. **Worker Registration**: Create a worker through the Nedo Vision frontend
321
+ 2. **Token Generation**: System generates a unique authentication token
322
+ 3. **Service Initialization**: Worker service authenticates using the token
323
+ 4. **Connection Setup**: Service establishes secure connections to backend services
324
+ 5. **Task Processing**: Worker receives and processes computer vision tasks
325
+ 6. **Monitoring**: Continuous system monitoring and health reporting
326
+
327
+ ## ⚙️ Configuration Management
328
+
329
+ ## ⚙️ Configuration Management
330
+
331
+ > **⚠️ Important Notice - Storage Path Coordination**
332
+ >
333
+ > If you're using **Nedo Vision Worker Core** alongside this service, ensure both services use the **same storage path**. This is critical for proper data sharing and model access between services.
334
+ >
335
+ > ```bash
336
+ > # Example: Both services should use identical storage paths
337
+ > nedo-worker run --token YOUR_TOKEN --storage-path /shared/nedo/storage
338
+ > nedo-worker-core --storage-path /shared/nedo/storage
339
+ > ```
340
+ >
341
+ > The storage path contains:
342
+ >
343
+ > - 📁 **Models** - Shared AI models and weights
344
+ > - 📁 **Temporary files** - Processing artifacts and cache
345
+ > - 📁 **Logs** - Service operation logs
346
+ > - 📁 **Configurations** - Runtime settings and preferences
347
+
348
+ ### Environment Variables (Legacy Support)
349
+
350
+ ```bash
351
+ export NEDO_WORKER_TOKEN="your-token-here"
352
+ export NEDO_SERVER_HOST="be.vision.sindika.co.id"
353
+ export NEDO_STORAGE_PATH="./data"
354
+
355
+ # Run with environment variables (deprecated)
356
+ nedo-worker run
357
+ ```
358
+
359
+ ### Configuration Priority
360
+
361
+ 1. **Command-line arguments** (highest priority)
362
+ 2. **Environment variables** (legacy support)
363
+ 3. **Default values** (lowest priority)
364
+
365
+ ## 🚀 Platform-Specific Setup
366
+
367
+ ### Windows Setup
368
+
369
+ #### Prerequisites
370
+
371
+ ```powershell
372
+ # Install Chocolatey (package manager)
373
+ Set-ExecutionPolicy Bypass -Scope Process -Force
374
+ [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
375
+ iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
376
+
377
+ # Install FFmpeg
378
+ choco install ffmpeg -y
379
+
380
+ # Verify installation
381
+ ffmpeg -version
382
+ ```
383
+
384
+ #### Worker Installation
385
+
386
+ ```powershell
387
+ # Install Python package
388
+ pip install nedo-vision-worker
389
+
390
+ # Run system check
391
+ nedo-worker doctor
392
+
393
+ # Start worker
394
+ nedo-worker run --token YOUR_TOKEN
395
+ ```
396
+
397
+ ### Linux Setup
398
+
399
+ #### Ubuntu/Debian
400
+
401
+ ```bash
402
+ # Update system
403
+ sudo apt update
404
+
405
+ # Install FFmpeg
406
+ sudo apt install ffmpeg python3-pip
407
+
408
+ # Install worker
409
+ pip3 install nedo-vision-worker
410
+
411
+ # Run diagnostics
412
+ nedo-worker doctor
413
+ ```
414
+
415
+ #### CentOS/RHEL
416
+
417
+ ```bash
418
+ # Install EPEL repository
419
+ sudo yum install epel-release
420
+
421
+ # Install dependencies
422
+ sudo yum install ffmpeg python3-pip
423
+
424
+ # Install worker
425
+ pip3 install nedo-vision-worker
426
+ ```
427
+
428
+ ### NVIDIA Jetson Setup
429
+
430
+ ```bash
431
+ # Ensure JetPack is installed
432
+ sudo apt update
433
+
434
+ # Use system OpenCV (optimized for Jetson)
435
+ sudo apt install python3-opencv
436
+
437
+ # Install worker without OpenCV
438
+ pip3 install nedo-vision-worker --no-deps
439
+ pip3 install alembic ffmpeg-python grpcio pika protobuf psutil pynvml requests SQLAlchemy
440
+
441
+ # Verify GPU support
442
+ nedo-worker doctor
443
+
444
+ # Check Jetson stats
445
+ sudo /usr/bin/tegrastats
446
+ ```
447
+
448
+ ### macOS Setup
449
+
450
+ ```bash
451
+ # Install Homebrew (if not installed)
452
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
453
+
454
+ # Install FFmpeg
455
+ brew install ffmpeg
456
+
457
+ # Install worker
458
+ pip3 install nedo-vision-worker
459
+
460
+ # Run diagnostics
461
+ nedo-worker doctor
462
+ ```
463
+
464
+ ## 🔧 Troubleshooting
465
+
466
+ ### Common Issues
467
+
468
+ #### 1. FFmpeg Not Found
469
+
470
+ ```bash
471
+ # Check if FFmpeg is installed
472
+ ffmpeg -version
473
+
474
+ # Install FFmpeg
475
+ # Ubuntu/Debian: sudo apt install ffmpeg
476
+ # Windows: choco install ffmpeg
477
+ # macOS: brew install ffmpeg
478
+ ```
479
+
480
+ #### 2. OpenCV Issues on ARM
481
+
482
+ ```bash
483
+ # For ARM devices, try headless version
484
+ pip uninstall opencv-python
485
+ pip install opencv-python-headless
486
+ ```
487
+
488
+ #### 3. GPU Not Detected
489
+
490
+ ```bash
491
+ # Check NVIDIA drivers
492
+ nvidia-smi
493
+
494
+ # Check CUDA installation
495
+ nvcc --version
496
+
497
+ # Run system diagnostics
498
+ nedo-worker doctor
499
+ ```
500
+
501
+ #### 4. Connection Issues
502
+
503
+ ```bash
504
+ # Test network connectivity
505
+ ping be.vision.sindika.co.id
506
+
507
+ # Check firewall settings
508
+ # Ensure port 50051 is accessible
509
+
510
+ # Verify token
511
+ nedo-worker run --token YOUR_TOKEN --verbose
512
+ ```
513
+
514
+ ### Debug Mode
515
+
516
+ ```bash
517
+ # Run with verbose logging
518
+ nedo-worker run --token YOUR_TOKEN --verbose
519
+
520
+ # Check logs
521
+ tail -f ~/.nedo_worker/logs/worker.log
522
+ ```
523
+
524
+ ### Performance Optimization
525
+
526
+ #### For High-Performance Workloads
527
+
528
+ ```bash
529
+ # Increase system usage interval
530
+ nedo-worker run --token YOUR_TOKEN --system-usage-interval 60
531
+
532
+ # Use dedicated storage path
533
+ nedo-worker run --token YOUR_TOKEN --storage-path /fast/ssd/storage
534
+ ```
535
+
536
+ #### For Resource-Constrained Devices
537
+
538
+ ```bash
539
+ # Use minimal configuration
540
+ nedo-worker run --token YOUR_TOKEN --system-usage-interval 120
541
+ ```
542
+
543
+ ### Development Setup
544
+
545
+ ```bash
546
+ # Clone and setup
547
+ git clone https://gitlab.com/sindika/research/nedo-vision/nedo-vision-worker-service
548
+ cd nedo-vision-worker-service
549
+
550
+ # Create virtual environment
551
+ python -m venv venv
552
+ source venv/bin/activate
553
+
554
+ # Install in development mode
555
+ pip install -e .[dev]
556
+
557
+ # Run tests
558
+ pytest
559
+
560
+ # Format code
561
+ black .
562
+ isort .
563
+ ```