deepdebug-local-agent 0.3.18 → 1.0.3

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.
@@ -0,0 +1,462 @@
1
+ # DeepDebug Local Agent - Enterprise Deployment Guide
2
+
3
+ ## Table of Contents
4
+
5
+ 1. [Prerequisites](#prerequisites)
6
+ 2. [Deployment Options](#deployment-options)
7
+ 3. [Docker Deployment](#docker-deployment)
8
+ 4. [Kubernetes Deployment](#kubernetes-deployment)
9
+ 5. [Configuration](#configuration)
10
+ 6. [Monitoring](#monitoring)
11
+ 7. [Troubleshooting](#troubleshooting)
12
+
13
+ ---
14
+
15
+ ## Prerequisites
16
+
17
+ ### System Requirements
18
+
19
+ | Component | Minimum | Recommended |
20
+ |-----------|---------|-------------|
21
+ | CPU | 1 core | 2 cores |
22
+ | Memory | 512 MB | 2 GB |
23
+ | Disk | 100 MB | 500 MB |
24
+ | Network | Outbound HTTPS | Outbound HTTPS |
25
+
26
+ ### Network Requirements
27
+
28
+ | Destination | Port | Protocol | Purpose |
29
+ |-------------|------|----------|---------|
30
+ | api.deepdebug.ai | 443 | HTTPS | API communication |
31
+
32
+ ### Credentials Required
33
+
34
+ - DeepDebug Tenant ID (from dashboard)
35
+ - API Key (from dashboard)
36
+
37
+ ---
38
+
39
+ ## Deployment Options
40
+
41
+ ### Option 1: Docker Compose (Recommended for most)
42
+
43
+ Best for: Small to medium teams, single server deployment
44
+
45
+ ### Option 2: Kubernetes with Helm
46
+
47
+ Best for: Large teams, existing K8s infrastructure, high availability
48
+
49
+ ### Option 3: Native Executable
50
+
51
+ Best for: Developer workstations, quick setup
52
+
53
+ ---
54
+
55
+ ## Docker Deployment
56
+
57
+ ### Quick Start
58
+
59
+ ```bash
60
+ # 1. Create project directory
61
+ mkdir deepdebug-agent && cd deepdebug-agent
62
+
63
+ # 2. Download docker-compose.yml
64
+ curl -O https://raw.githubusercontent.com/deepdebug/local-agent/main/docker-compose.yml
65
+
66
+ # 3. Create environment file
67
+ cat > .env << EOF
68
+ DEEPDEBUG_TENANT_ID=your-tenant-id
69
+ PROJECT_PATH=/path/to/your/projects
70
+ EOF
71
+
72
+ # 4. Start the agent
73
+ docker-compose up -d
74
+
75
+ # 5. Verify it's running
76
+ curl http://localhost:5055/health
77
+ ```
78
+
79
+ ### Configuration Options
80
+
81
+ ```yaml
82
+ # docker-compose.yml
83
+ environment:
84
+ # Required
85
+ - DEEPDEBUG_TENANT_ID=${DEEPDEBUG_TENANT_ID}
86
+
87
+ # Optional
88
+ - DEEPDEBUG_API_URL=https://api.deepdebug.ai # Change for on-premise
89
+ - LOG_LEVEL=info # debug, info, warn, error
90
+ - PORT=5055 # Agent port
91
+ ```
92
+
93
+ ### Multiple Projects
94
+
95
+ ```yaml
96
+ volumes:
97
+ # Mount multiple project directories
98
+ - /home/dev/project-a:/workspace/project-a:ro
99
+ - /home/dev/project-b:/workspace/project-b:ro
100
+ - /home/dev/project-c:/workspace/project-c:ro
101
+ ```
102
+
103
+ ### Behind Corporate Proxy
104
+
105
+ ```yaml
106
+ environment:
107
+ - HTTP_PROXY=http://proxy.company.com:8080
108
+ - HTTPS_PROXY=http://proxy.company.com:8080
109
+ - NO_PROXY=localhost,127.0.0.1,.company.com
110
+ ```
111
+
112
+ ---
113
+
114
+ ## Kubernetes Deployment
115
+
116
+ ### Prerequisites
117
+
118
+ - Kubernetes 1.21+
119
+ - Helm 3.0+
120
+ - kubectl configured
121
+
122
+ ### Quick Start
123
+
124
+ ```bash
125
+ # 1. Add Helm repository
126
+ helm repo add deepdebug https://charts.deepdebug.ai
127
+ helm repo update
128
+
129
+ # 2. Create namespace
130
+ kubectl create namespace deepdebug
131
+
132
+ # 3. Create secret with tenant ID
133
+ kubectl create secret generic deepdebug-credentials \
134
+ --namespace deepdebug \
135
+ --from-literal=tenant-id=your-tenant-id
136
+
137
+ # 4. Install the chart
138
+ helm install deepdebug-agent deepdebug/deepdebug-agent \
139
+ --namespace deepdebug \
140
+ --set config.tenantId=your-tenant-id
141
+
142
+ # 5. Verify deployment
143
+ kubectl get pods -n deepdebug
144
+ ```
145
+
146
+ ### Custom Values
147
+
148
+ ```yaml
149
+ # values-production.yaml
150
+ replicaCount: 2
151
+
152
+ resources:
153
+ limits:
154
+ cpu: "2"
155
+ memory: "2Gi"
156
+ requests:
157
+ cpu: "500m"
158
+ memory: "512Mi"
159
+
160
+ config:
161
+ tenantId: "your-tenant-id"
162
+ apiUrl: "https://api.deepdebug.ai"
163
+ logLevel: "info"
164
+
165
+ # Mount code from NFS
166
+ volumes:
167
+ workspace:
168
+ enabled: true
169
+ nfs:
170
+ server: nfs.company.com
171
+ path: /exports/projects
172
+
173
+ # Network policy for security
174
+ networkPolicy:
175
+ enabled: true
176
+ ```
177
+
178
+ Install with custom values:
179
+
180
+ ```bash
181
+ helm install deepdebug-agent deepdebug/deepdebug-agent \
182
+ --namespace deepdebug \
183
+ -f values-production.yaml
184
+ ```
185
+
186
+ ### OpenShift Deployment
187
+
188
+ ```yaml
189
+ # Additional SecurityContextConstraints for OpenShift
190
+ securityContext:
191
+ runAsNonRoot: true
192
+ runAsUser: null # Let OpenShift assign
193
+ ```
194
+
195
+ ---
196
+
197
+ ## Configuration
198
+
199
+ ### Environment Variables
200
+
201
+ | Variable | Required | Default | Description |
202
+ |----------|----------|---------|-------------|
203
+ | `DEEPDEBUG_TENANT_ID` | Yes | - | Your tenant identifier |
204
+ | `DEEPDEBUG_API_URL` | No | https://api.deepdebug.ai | API endpoint |
205
+ | `DEEPDEBUG_WORKSPACE_PATH` | No | /workspace | Path to mounted projects |
206
+ | `PORT` | No | 5055 | Agent listening port |
207
+ | `LOG_LEVEL` | No | info | Logging verbosity |
208
+ | `NODE_ENV` | No | production | Environment mode |
209
+
210
+ ### Configuration File (Optional)
211
+
212
+ ```yaml
213
+ # config.yaml
214
+ tenant:
215
+ id: your-tenant-id
216
+
217
+ api:
218
+ url: https://api.deepdebug.ai
219
+ timeout: 30000
220
+
221
+ workspace:
222
+ path: /workspace
223
+ exclude:
224
+ - node_modules
225
+ - .git
226
+ - target
227
+ - build
228
+
229
+ logging:
230
+ level: info
231
+ format: json
232
+ ```
233
+
234
+ Mount the config file:
235
+
236
+ ```yaml
237
+ volumes:
238
+ - ./config.yaml:/app/config.yaml:ro
239
+ environment:
240
+ - CONFIG_PATH=/app/config.yaml
241
+ ```
242
+
243
+ ---
244
+
245
+ ## Monitoring
246
+
247
+ ### Health Endpoint
248
+
249
+ ```bash
250
+ # Check health
251
+ curl http://localhost:5055/health
252
+
253
+ # Response
254
+ {
255
+ "status": "healthy",
256
+ "version": "1.0.0",
257
+ "uptime": 3600
258
+ }
259
+ ```
260
+
261
+ ### Prometheus Metrics
262
+
263
+ ```bash
264
+ # Metrics endpoint
265
+ curl http://localhost:5055/metrics
266
+ ```
267
+
268
+ Available metrics:
269
+
270
+ | Metric | Type | Description |
271
+ |--------|------|-------------|
272
+ | `deepdebug_requests_total` | Counter | Total API requests |
273
+ | `deepdebug_errors_total` | Counter | Total errors |
274
+ | `deepdebug_analysis_duration_seconds` | Histogram | Analysis duration |
275
+ | `deepdebug_workspace_files_total` | Gauge | Files in workspace |
276
+
277
+ ### Grafana Dashboard
278
+
279
+ Import dashboard ID: `XXXXX` (coming soon)
280
+
281
+ ### Alerts
282
+
283
+ ```yaml
284
+ # prometheus-alerts.yaml
285
+ groups:
286
+ - name: deepdebug
287
+ rules:
288
+ - alert: DeepDebugAgentDown
289
+ expr: up{job="deepdebug-agent"} == 0
290
+ for: 5m
291
+ labels:
292
+ severity: critical
293
+ annotations:
294
+ summary: "DeepDebug Agent is down"
295
+
296
+ - alert: DeepDebugHighErrorRate
297
+ expr: rate(deepdebug_errors_total[5m]) > 0.1
298
+ for: 10m
299
+ labels:
300
+ severity: warning
301
+ annotations:
302
+ summary: "High error rate in DeepDebug Agent"
303
+ ```
304
+
305
+ ---
306
+
307
+ ## Troubleshooting
308
+
309
+ ### Common Issues
310
+
311
+ #### Agent won't start
312
+
313
+ ```bash
314
+ # Check logs
315
+ docker logs deepdebug-agent
316
+
317
+ # Common causes:
318
+ # 1. Missing DEEPDEBUG_TENANT_ID
319
+ # 2. Cannot reach api.deepdebug.ai
320
+ # 3. Port 5055 already in use
321
+ ```
322
+
323
+ #### Cannot connect to API
324
+
325
+ ```bash
326
+ # Test connectivity
327
+ curl -v https://api.deepdebug.ai/health
328
+
329
+ # Check proxy settings
330
+ echo $HTTP_PROXY
331
+ echo $HTTPS_PROXY
332
+ ```
333
+
334
+ #### Permission denied on workspace
335
+
336
+ ```bash
337
+ # Check mount permissions
338
+ ls -la /workspace
339
+
340
+ # Ensure container user can read
341
+ # The container runs as UID 1001
342
+ chown -R 1001:1001 /path/to/projects # If needed
343
+ ```
344
+
345
+ #### High memory usage
346
+
347
+ ```bash
348
+ # Check container resources
349
+ docker stats deepdebug-agent
350
+
351
+ # Increase memory limit if needed
352
+ # In docker-compose.yml:
353
+ deploy:
354
+ resources:
355
+ limits:
356
+ memory: 4G
357
+ ```
358
+
359
+ ### Debug Mode
360
+
361
+ Enable debug logging:
362
+
363
+ ```yaml
364
+ environment:
365
+ - LOG_LEVEL=debug
366
+ ```
367
+
368
+ ### Support
369
+
370
+ - Documentation: https://docs.deepdebug.ai
371
+ - Email: support@deepdebug.ai
372
+ - Enterprise support: enterprise@deepdebug.ai
373
+
374
+ ---
375
+
376
+ ## Appendix
377
+
378
+ ### A. Sample docker-compose.yml
379
+
380
+ ```yaml
381
+ version: '3.8'
382
+
383
+ services:
384
+ deepdebug-agent:
385
+ image: deepdebug/local-agent:1.0.0
386
+ container_name: deepdebug-agent
387
+ restart: unless-stopped
388
+ security_opt:
389
+ - no-new-privileges:true
390
+ read_only: true
391
+ ports:
392
+ - "127.0.0.1:5055:5055"
393
+ volumes:
394
+ - ${PROJECT_PATH}:/workspace:ro
395
+ - agent-tmp:/tmp
396
+ environment:
397
+ - DEEPDEBUG_TENANT_ID=${DEEPDEBUG_TENANT_ID}
398
+ - DEEPDEBUG_API_URL=${DEEPDEBUG_API_URL:-https://api.deepdebug.ai}
399
+ - LOG_LEVEL=${LOG_LEVEL:-info}
400
+ healthcheck:
401
+ test: ["CMD", "curl", "-f", "http://localhost:5055/health"]
402
+ interval: 30s
403
+ timeout: 10s
404
+ retries: 3
405
+
406
+ volumes:
407
+ agent-tmp:
408
+ ```
409
+
410
+ ### B. Kubernetes Manifest (without Helm)
411
+
412
+ ```yaml
413
+ apiVersion: apps/v1
414
+ kind: Deployment
415
+ metadata:
416
+ name: deepdebug-agent
417
+ spec:
418
+ replicas: 1
419
+ selector:
420
+ matchLabels:
421
+ app: deepdebug-agent
422
+ template:
423
+ metadata:
424
+ labels:
425
+ app: deepdebug-agent
426
+ spec:
427
+ securityContext:
428
+ runAsNonRoot: true
429
+ runAsUser: 1001
430
+ containers:
431
+ - name: agent
432
+ image: deepdebug/local-agent:1.0.0
433
+ ports:
434
+ - containerPort: 5055
435
+ env:
436
+ - name: DEEPDEBUG_TENANT_ID
437
+ valueFrom:
438
+ secretKeyRef:
439
+ name: deepdebug-credentials
440
+ key: tenant-id
441
+ resources:
442
+ limits:
443
+ cpu: "2"
444
+ memory: "2Gi"
445
+ requests:
446
+ cpu: "500m"
447
+ memory: "512Mi"
448
+ securityContext:
449
+ readOnlyRootFilesystem: true
450
+ allowPrivilegeEscalation: false
451
+ ---
452
+ apiVersion: v1
453
+ kind: Service
454
+ metadata:
455
+ name: deepdebug-agent
456
+ spec:
457
+ selector:
458
+ app: deepdebug-agent
459
+ ports:
460
+ - port: 5055
461
+ targetPort: 5055
462
+ ```
@@ -0,0 +1,193 @@
1
+ # DeepDebug Local Agent - Quick Start Guide
2
+
3
+ ## 🚀 Get Started in 2 Minutes
4
+
5
+ ### Step 1: Download
6
+
7
+ Download the agent for your operating system:
8
+
9
+ | Platform | Download |
10
+ |----------|----------|
11
+ | 🪟 Windows | [deepdebug-agent-windows.exe](https://downloads.deepdebug.ai/agent/latest/windows) |
12
+ | 🍎 macOS (Intel) | [deepdebug-agent-macos-x64](https://downloads.deepdebug.ai/agent/latest/macos-x64) |
13
+ | 🍎 macOS (Apple Silicon) | [deepdebug-agent-macos-arm64](https://downloads.deepdebug.ai/agent/latest/macos-arm64) |
14
+ | 🐧 Linux | [deepdebug-agent-linux](https://downloads.deepdebug.ai/agent/latest/linux) |
15
+
16
+ ### Step 2: Run
17
+
18
+ #### Windows
19
+
20
+ ```powershell
21
+ # Open PowerShell and run:
22
+ .\deepdebug-agent-windows.exe --tenant-id YOUR_TENANT_ID --workspace "C:\path\to\your\project"
23
+ ```
24
+
25
+ #### macOS / Linux
26
+
27
+ ```bash
28
+ # Make executable
29
+ chmod +x deepdebug-agent-macos
30
+
31
+ # Run
32
+ ./deepdebug-agent-macos --tenant-id YOUR_TENANT_ID --workspace /path/to/your/project
33
+ ```
34
+
35
+ ### Step 3: Verify
36
+
37
+ Open your browser: http://localhost:5055/health
38
+
39
+ You should see:
40
+ ```json
41
+ {"status": "healthy", "version": "1.0.0"}
42
+ ```
43
+
44
+ ---
45
+
46
+ ## 📋 Command Line Options
47
+
48
+ ```
49
+ deepdebug-agent [options]
50
+
51
+ Options:
52
+ --tenant-id <id> Your DeepDebug tenant ID (required)
53
+ --workspace <path> Path to your project (required)
54
+ --port <number> Port to listen on (default: 5055)
55
+ --api-url <url> DeepDebug API URL (default: https://api.deepdebug.ai)
56
+ --log-level <level> Log level: debug, info, warn, error (default: info)
57
+ --help Show help
58
+ --version Show version
59
+ ```
60
+
61
+ ---
62
+
63
+ ## 💡 Examples
64
+
65
+ ### Single Project
66
+
67
+ ```bash
68
+ ./deepdebug-agent \
69
+ --tenant-id abc123 \
70
+ --workspace /home/dev/my-project
71
+ ```
72
+
73
+ ### Multiple Projects
74
+
75
+ ```bash
76
+ ./deepdebug-agent \
77
+ --tenant-id abc123 \
78
+ --workspace /home/dev/project-a \
79
+ --workspace /home/dev/project-b
80
+ ```
81
+
82
+ ### With Debug Logging
83
+
84
+ ```bash
85
+ ./deepdebug-agent \
86
+ --tenant-id abc123 \
87
+ --workspace /home/dev/my-project \
88
+ --log-level debug
89
+ ```
90
+
91
+ ---
92
+
93
+ ## 🔧 Run as Background Service
94
+
95
+ ### macOS (launchd)
96
+
97
+ ```bash
98
+ # Create service file
99
+ cat > ~/Library/LaunchAgents/com.deepdebug.agent.plist << EOF
100
+ <?xml version="1.0" encoding="UTF-8"?>
101
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
102
+ <plist version="1.0">
103
+ <dict>
104
+ <key>Label</key>
105
+ <string>com.deepdebug.agent</string>
106
+ <key>ProgramArguments</key>
107
+ <array>
108
+ <string>/usr/local/bin/deepdebug-agent</string>
109
+ <string>--tenant-id</string>
110
+ <string>YOUR_TENANT_ID</string>
111
+ <string>--workspace</string>
112
+ <string>/path/to/your/project</string>
113
+ </array>
114
+ <key>RunAtLoad</key>
115
+ <true/>
116
+ <key>KeepAlive</key>
117
+ <true/>
118
+ </dict>
119
+ </plist>
120
+ EOF
121
+
122
+ # Load service
123
+ launchctl load ~/Library/LaunchAgents/com.deepdebug.agent.plist
124
+ ```
125
+
126
+ ### Linux (systemd)
127
+
128
+ ```bash
129
+ # Create service file
130
+ sudo cat > /etc/systemd/system/deepdebug-agent.service << EOF
131
+ [Unit]
132
+ Description=DeepDebug Local Agent
133
+ After=network.target
134
+
135
+ [Service]
136
+ Type=simple
137
+ User=$USER
138
+ ExecStart=/usr/local/bin/deepdebug-agent --tenant-id YOUR_TENANT_ID --workspace /path/to/project
139
+ Restart=always
140
+ RestartSec=10
141
+
142
+ [Install]
143
+ WantedBy=multi-user.target
144
+ EOF
145
+
146
+ # Enable and start
147
+ sudo systemctl enable deepdebug-agent
148
+ sudo systemctl start deepdebug-agent
149
+
150
+ # Check status
151
+ sudo systemctl status deepdebug-agent
152
+ ```
153
+
154
+ ### Windows (as Service)
155
+
156
+ ```powershell
157
+ # Using NSSM (Non-Sucking Service Manager)
158
+ # Download from: https://nssm.cc/
159
+
160
+ nssm install DeepDebugAgent "C:\path\to\deepdebug-agent.exe"
161
+ nssm set DeepDebugAgent AppParameters "--tenant-id YOUR_TENANT_ID --workspace C:\path\to\project"
162
+ nssm start DeepDebugAgent
163
+ ```
164
+
165
+ ---
166
+
167
+ ## ❓ FAQ
168
+
169
+ ### Where do I get my Tenant ID?
170
+
171
+ 1. Log in to https://app.deepdebug.ai
172
+ 2. Go to Settings → Organization
173
+ 3. Copy your Tenant ID
174
+
175
+ ### Is my code sent to the cloud?
176
+
177
+ Only small code snippets (error locations) are sent for analysis. Your full codebase never leaves your machine. See our [Security Whitepaper](SECURITY_WHITEPAPER.md) for details.
178
+
179
+ ### Can I use it offline?
180
+
181
+ The agent requires internet connectivity to communicate with the DeepDebug API. For air-gapped environments, contact us about on-premise deployment.
182
+
183
+ ### How do I update?
184
+
185
+ Simply download the latest version and replace the executable. Your configuration is preserved.
186
+
187
+ ---
188
+
189
+ ## 🆘 Need Help?
190
+
191
+ - 📚 Documentation: https://docs.deepdebug.ai
192
+ - 💬 Community: https://community.deepdebug.ai
193
+ - 📧 Support: support@deepdebug.ai