lynkr 8.0.0 → 9.0.1

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 (128) hide show
  1. package/.lynkr/telemetry.db +0 -0
  2. package/.lynkr/telemetry.db-shm +0 -0
  3. package/.lynkr/telemetry.db-wal +0 -0
  4. package/README.md +196 -322
  5. package/lynkr-skill.tar.gz +0 -0
  6. package/package.json +4 -3
  7. package/src/api/openai-router.js +64 -13
  8. package/src/api/providers-handler.js +171 -3
  9. package/src/api/router.js +9 -2
  10. package/src/clients/circuit-breaker.js +10 -247
  11. package/src/clients/codex-process.js +342 -0
  12. package/src/clients/codex-utils.js +143 -0
  13. package/src/clients/databricks.js +210 -63
  14. package/src/clients/resilience.js +540 -0
  15. package/src/clients/retry.js +22 -167
  16. package/src/clients/standard-tools.js +23 -0
  17. package/src/config/index.js +77 -0
  18. package/src/context/compression.js +42 -9
  19. package/src/context/distill.js +492 -0
  20. package/src/orchestrator/index.js +48 -8
  21. package/src/routing/complexity-analyzer.js +258 -5
  22. package/src/routing/index.js +12 -2
  23. package/src/routing/latency-tracker.js +148 -0
  24. package/src/routing/model-tiers.js +2 -0
  25. package/src/routing/quality-scorer.js +113 -0
  26. package/src/routing/telemetry.js +464 -0
  27. package/src/server.js +13 -12
  28. package/src/tools/code-graph.js +538 -0
  29. package/src/tools/code-mode.js +304 -0
  30. package/src/tools/index.js +4 -0
  31. package/src/tools/lazy-loader.js +18 -0
  32. package/src/tools/mcp-remote.js +7 -0
  33. package/src/tools/smart-selection.js +11 -0
  34. package/src/tools/tinyfish.js +358 -0
  35. package/src/tools/truncate.js +1 -0
  36. package/src/utils/payload.js +206 -0
  37. package/src/utils/perf-timer.js +80 -0
  38. package/.github/FUNDING.yml +0 -15
  39. package/.github/workflows/README.md +0 -215
  40. package/.github/workflows/ci.yml +0 -69
  41. package/.github/workflows/index.yml +0 -62
  42. package/.github/workflows/web-tools-tests.yml +0 -56
  43. package/CITATIONS.bib +0 -6
  44. package/DEPLOYMENT.md +0 -1001
  45. package/LYNKR-TUI-PLAN.md +0 -984
  46. package/PERFORMANCE-REPORT.md +0 -866
  47. package/PLAN-per-client-model-routing.md +0 -252
  48. package/docs/42642f749da6234f41b6b425c3bb07c9.txt +0 -1
  49. package/docs/BingSiteAuth.xml +0 -4
  50. package/docs/docs-style.css +0 -478
  51. package/docs/docs.html +0 -198
  52. package/docs/google5be250e608e6da39.html +0 -1
  53. package/docs/index.html +0 -577
  54. package/docs/index.md +0 -584
  55. package/docs/robots.txt +0 -4
  56. package/docs/sitemap.xml +0 -44
  57. package/docs/style.css +0 -1223
  58. package/docs/toon-integration-spec.md +0 -130
  59. package/documentation/README.md +0 -101
  60. package/documentation/api.md +0 -806
  61. package/documentation/claude-code-cli.md +0 -679
  62. package/documentation/codex-cli.md +0 -397
  63. package/documentation/contributing.md +0 -571
  64. package/documentation/cursor-integration.md +0 -734
  65. package/documentation/docker.md +0 -874
  66. package/documentation/embeddings.md +0 -762
  67. package/documentation/faq.md +0 -713
  68. package/documentation/features.md +0 -403
  69. package/documentation/headroom.md +0 -519
  70. package/documentation/installation.md +0 -758
  71. package/documentation/memory-system.md +0 -476
  72. package/documentation/production.md +0 -636
  73. package/documentation/providers.md +0 -1009
  74. package/documentation/routing.md +0 -476
  75. package/documentation/testing.md +0 -629
  76. package/documentation/token-optimization.md +0 -325
  77. package/documentation/tools.md +0 -697
  78. package/documentation/troubleshooting.md +0 -969
  79. package/final-test.js +0 -33
  80. package/headroom-sidecar/config.py +0 -93
  81. package/headroom-sidecar/requirements.txt +0 -14
  82. package/headroom-sidecar/server.py +0 -451
  83. package/monitor-agents.sh +0 -31
  84. package/scripts/audit-log-reader.js +0 -399
  85. package/scripts/compact-dictionary.js +0 -204
  86. package/scripts/test-deduplication.js +0 -448
  87. package/src/db/database.sqlite +0 -0
  88. package/te +0 -11622
  89. package/test/README.md +0 -212
  90. package/test/azure-openai-config.test.js +0 -213
  91. package/test/azure-openai-error-resilience.test.js +0 -238
  92. package/test/azure-openai-format-conversion.test.js +0 -354
  93. package/test/azure-openai-integration.test.js +0 -287
  94. package/test/azure-openai-routing.test.js +0 -175
  95. package/test/azure-openai-streaming.test.js +0 -171
  96. package/test/bedrock-integration.test.js +0 -457
  97. package/test/comprehensive-test-suite.js +0 -928
  98. package/test/config-validation.test.js +0 -207
  99. package/test/cursor-integration.test.js +0 -484
  100. package/test/format-conversion.test.js +0 -578
  101. package/test/hybrid-routing-integration.test.js +0 -269
  102. package/test/hybrid-routing-performance.test.js +0 -428
  103. package/test/llamacpp-integration.test.js +0 -882
  104. package/test/lmstudio-integration.test.js +0 -347
  105. package/test/memory/extractor.test.js +0 -398
  106. package/test/memory/retriever.test.js +0 -613
  107. package/test/memory/retriever.test.js.bak +0 -585
  108. package/test/memory/search.test.js +0 -537
  109. package/test/memory/search.test.js.bak +0 -389
  110. package/test/memory/store.test.js +0 -344
  111. package/test/memory/store.test.js.bak +0 -312
  112. package/test/memory/surprise.test.js +0 -300
  113. package/test/memory-performance.test.js +0 -472
  114. package/test/openai-integration.test.js +0 -683
  115. package/test/openrouter-error-resilience.test.js +0 -418
  116. package/test/passthrough-mode.test.js +0 -385
  117. package/test/performance-benchmark.js +0 -351
  118. package/test/performance-tests.js +0 -528
  119. package/test/routing.test.js +0 -225
  120. package/test/toon-compression.test.js +0 -131
  121. package/test/web-tools.test.js +0 -329
  122. package/test-agents-simple.js +0 -43
  123. package/test-cli-connection.sh +0 -33
  124. package/test-learning-unit.js +0 -126
  125. package/test-learning.js +0 -112
  126. package/test-parallel-agents.sh +0 -124
  127. package/test-parallel-direct.js +0 -155
  128. package/test-subagents.sh +0 -117
@@ -1,874 +0,0 @@
1
- # Docker Deployment Guide
2
-
3
- Complete guide to deploying Lynkr with Docker and docker-compose, including GPU support and Kubernetes deployment.
4
-
5
- ---
6
-
7
- ## Quick Start
8
-
9
- ### docker-compose (Recommended)
10
-
11
- **1. Clone repository:**
12
- ```bash
13
- git clone https://github.com/vishalveerareddy123/Lynkr.git
14
- cd Lynkr
15
- ```
16
-
17
- **2. Configure environment:**
18
- ```bash
19
- cp .env.example .env
20
- # Edit .env with your provider credentials
21
- ```
22
-
23
- **3. Start services:**
24
- ```bash
25
- docker-compose up -d
26
- ```
27
-
28
- **4. Verify:**
29
- ```bash
30
- curl http://localhost:8081/health/live
31
- # Expected: {"status":"ok"}
32
- ```
33
-
34
- ---
35
-
36
- ## Docker Compose Configuration
37
-
38
- ### Standard Setup (docker-compose.yml)
39
-
40
- ```yaml
41
- version: '3.8'
42
-
43
- services:
44
- lynkr:
45
- build: .
46
- container_name: lynkr
47
- ports:
48
- - "8081:8081" # Lynkr proxy
49
- env_file:
50
- - .env
51
- volumes:
52
- - ./data:/app/data # Persistent data (memories, sessions)
53
- - ./workspace:/app/workspace # Workspace for file operations
54
- restart: unless-stopped
55
- healthcheck:
56
- test: ["CMD", "curl", "-f", "http://localhost:8081/health/live"]
57
- interval: 30s
58
- timeout: 10s
59
- retries: 3
60
- start_period: 40s
61
- ```
62
-
63
- ### With Ollama (Local LLM)
64
-
65
- ```yaml
66
- version: '3.8'
67
-
68
- services:
69
- # Lynkr proxy
70
- lynkr:
71
- build: .
72
- container_name: lynkr
73
- ports:
74
- - "8081:8081"
75
- environment:
76
- # Tier-based routing: local for simple, cloud for complex
77
- - MODEL_PROVIDER=ollama
78
- - OLLAMA_API_BASE=http://ollama:11434
79
- # Set all 4 TIER_* vars to enable tier-based routing
80
- - TIER_SIMPLE=ollama:llama3.2
81
- - TIER_MEDIUM=ollama:llama3.2
82
- - TIER_COMPLEX=databricks:databricks-claude-sonnet-4-5
83
- - TIER_REASONING=databricks:databricks-claude-sonnet-4-5
84
- - FALLBACK_ENABLED=true
85
- - FALLBACK_PROVIDER=databricks
86
- - DATABRICKS_API_BASE=${DATABRICKS_API_BASE}
87
- - DATABRICKS_API_KEY=${DATABRICKS_API_KEY}
88
- volumes:
89
- - ./data:/app/data
90
- - ./workspace:/app/workspace
91
- depends_on:
92
- - ollama
93
- restart: unless-stopped
94
-
95
- # Ollama local LLM server
96
- ollama:
97
- image: ollama/ollama:latest
98
- container_name: ollama
99
- ports:
100
- - "11434:11434"
101
- volumes:
102
- - ollama_data:/root/.ollama
103
- restart: unless-stopped
104
- healthcheck:
105
- test: ["CMD", "curl", "-f", "http://localhost:11434/api/tags"]
106
- interval: 30s
107
- timeout: 10s
108
- retries: 3
109
-
110
- volumes:
111
- ollama_data:
112
- ```
113
-
114
- **Pull models:**
115
- ```bash
116
- # Enter Ollama container
117
- docker exec -it ollama ollama pull qwen2.5-coder:7b
118
-
119
- # Or from host (if Ollama CLI installed)
120
- ollama pull qwen2.5-coder:7b
121
- ```
122
-
123
- ### With GPU Support (NVIDIA)
124
-
125
- ```yaml
126
- version: '3.8'
127
-
128
- services:
129
- lynkr:
130
- build: .
131
- container_name: lynkr
132
- ports:
133
- - "8081:8081"
134
- environment:
135
- - MODEL_PROVIDER=ollama
136
- - OLLAMA_API_BASE=http://ollama:11434
137
- volumes:
138
- - ./data:/app/data
139
- - ./workspace:/app/workspace
140
- depends_on:
141
- - ollama
142
- restart: unless-stopped
143
-
144
- ollama:
145
- image: ollama/ollama:latest
146
- container_name: ollama
147
- ports:
148
- - "11434:11434"
149
- volumes:
150
- - ollama_data:/root/.ollama
151
- deploy:
152
- resources:
153
- reservations:
154
- devices:
155
- - driver: nvidia
156
- count: all
157
- capabilities: [gpu]
158
- restart: unless-stopped
159
-
160
- volumes:
161
- ollama_data:
162
- ```
163
-
164
- **Prerequisites:**
165
- 1. Install NVIDIA drivers
166
- 2. Install NVIDIA Container Toolkit:
167
- ```bash
168
- # Ubuntu/Debian
169
- distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
170
- curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
171
- curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
172
- sudo tee /etc/apt/sources.list.d/nvidia-docker.list
173
-
174
- sudo apt-get update
175
- sudo apt-get install -y nvidia-container-toolkit
176
- sudo systemctl restart docker
177
- ```
178
-
179
- **Verify GPU access:**
180
- ```bash
181
- docker exec -it ollama nvidia-smi
182
- ```
183
-
184
- ### With Embeddings (for Cursor @Codebase)
185
-
186
- ```yaml
187
- version: '3.8'
188
-
189
- services:
190
- lynkr:
191
- build: .
192
- container_name: lynkr
193
- ports:
194
- - "8081:8081"
195
- environment:
196
- - MODEL_PROVIDER=databricks
197
- - DATABRICKS_API_BASE=${DATABRICKS_API_BASE}
198
- - DATABRICKS_API_KEY=${DATABRICKS_API_KEY}
199
-
200
- # Embeddings via Ollama
201
- - EMBEDDINGS_PROVIDER=ollama
202
- - OLLAMA_API_BASE=http://ollama:11434
203
- - OLLAMA_EMBEDDINGS_MODEL=nomic-embed-text
204
-
205
- # Index workspace for @Codebase
206
- - WORKSPACE_ROOT=/app/workspace
207
- - WORKSPACE_INDEX_ENABLED=true
208
- volumes:
209
- - ./data:/app/data
210
- - ./workspace:/app/workspace
211
- depends_on:
212
- - ollama
213
- restart: unless-stopped
214
-
215
- ollama:
216
- image: ollama/ollama:latest
217
- container_name: ollama
218
- ports:
219
- - "11434:11434"
220
- volumes:
221
- - ollama_data:/root/.ollama
222
- restart: unless-stopped
223
-
224
- volumes:
225
- ollama_data:
226
- ```
227
-
228
- **Pull embedding model:**
229
- ```bash
230
- docker exec -it ollama ollama pull nomic-embed-text
231
- ```
232
-
233
- ---
234
-
235
- ## Standalone Docker
236
-
237
- ### Build Image
238
-
239
- ```bash
240
- # Build from Dockerfile
241
- docker build -t lynkr:latest .
242
-
243
- # Or pull from registry (when available)
244
- docker pull ghcr.io/vishalveerareddy123/lynkr:latest
245
- ```
246
-
247
- ### Run Container
248
-
249
- **With Databricks:**
250
- ```bash
251
- docker run -d \
252
- --name lynkr \
253
- -p 8081:8081 \
254
- -e MODEL_PROVIDER=databricks \
255
- -e DATABRICKS_API_BASE=https://your-workspace.databricks.com \
256
- -e DATABRICKS_API_KEY=your-key \
257
- -v $(pwd)/data:/app/data \
258
- -v $(pwd)/workspace:/app/workspace \
259
- --restart unless-stopped \
260
- lynkr:latest
261
- ```
262
-
263
- **With Ollama:**
264
- ```bash
265
- # Start Ollama first
266
- docker run -d \
267
- --name ollama \
268
- -p 11434:11434 \
269
- -v ollama_data:/root/.ollama \
270
- ollama/ollama:latest
271
-
272
- # Start Lynkr
273
- docker run -d \
274
- --name lynkr \
275
- -p 8081:8081 \
276
- -e MODEL_PROVIDER=ollama \
277
- -e OLLAMA_API_BASE=http://ollama:11434 \
278
- -v $(pwd)/data:/app/data \
279
- -v $(pwd)/workspace:/app/workspace \
280
- --link ollama \
281
- --restart unless-stopped \
282
- lynkr:latest
283
- ```
284
-
285
- **With AWS Bedrock:**
286
- ```bash
287
- docker run -d \
288
- --name lynkr \
289
- -p 8081:8081 \
290
- -e MODEL_PROVIDER=bedrock \
291
- -e AWS_ACCESS_KEY_ID=AKIA... \
292
- -e AWS_SECRET_ACCESS_KEY=... \
293
- -e AWS_BEDROCK_REGION=us-east-1 \
294
- -v $(pwd)/data:/app/data \
295
- -v $(pwd)/workspace:/app/workspace \
296
- --restart unless-stopped \
297
- lynkr:latest
298
- ```
299
-
300
- ---
301
-
302
- ## Dockerfile
303
-
304
- ### Standard Dockerfile
305
-
306
- ```dockerfile
307
- # Use Node.js 18 Alpine for smaller image
308
- FROM node:18-alpine
309
-
310
- # Set working directory
311
- WORKDIR /app
312
-
313
- # Install dependencies
314
- COPY package*.json ./
315
- RUN npm ci --production
316
-
317
- # Copy application code
318
- COPY . .
319
-
320
- # Create data directories
321
- RUN mkdir -p /app/data /app/workspace
322
-
323
- # Expose port
324
- EXPOSE 8081
325
-
326
- # Health check
327
- HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
328
- CMD node -e "require('http').get('http://localhost:8081/health/live', (r) => { process.exit(r.statusCode === 200 ? 0 : 1); })"
329
-
330
- # Run as non-root user
331
- USER node
332
-
333
- # Start application
334
- CMD ["node", "index.js"]
335
- ```
336
-
337
- ### Multi-stage Dockerfile (Smaller Image)
338
-
339
- ```dockerfile
340
- # Build stage
341
- FROM node:18-alpine AS builder
342
-
343
- WORKDIR /app
344
- COPY package*.json ./
345
- RUN npm ci --production
346
-
347
- # Runtime stage
348
- FROM node:18-alpine
349
-
350
- WORKDIR /app
351
-
352
- # Copy dependencies
353
- COPY --from=builder /app/node_modules ./node_modules
354
-
355
- # Copy application
356
- COPY . .
357
-
358
- # Create directories
359
- RUN mkdir -p /app/data /app/workspace && \
360
- chown -R node:node /app
361
-
362
- # Expose port
363
- EXPOSE 8081
364
-
365
- # Health check
366
- HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
367
- CMD node -e "require('http').get('http://localhost:8081/health/live', (r) => { process.exit(r.statusCode === 200 ? 0 : 1); })"
368
-
369
- # Run as non-root user
370
- USER node
371
-
372
- CMD ["node", "index.js"]
373
- ```
374
-
375
- ---
376
-
377
- ## Volume Management
378
-
379
- ### Persistent Data
380
-
381
- **Required volumes:**
382
- ```yaml
383
- volumes:
384
- - ./data:/app/data # SQLite databases (memories, sessions)
385
- - ./workspace:/app/workspace # File operations workspace
386
- ```
387
-
388
- **Data directory structure:**
389
- ```
390
- data/
391
- ├── memories.db # Long-term memory database
392
- ├── sessions.db # Conversation history
393
- └── workspace-index.db # Workspace metadata
394
- ```
395
-
396
- ### Backup Data
397
-
398
- **Backup script:**
399
- ```bash
400
- #!/bin/bash
401
- # backup-lynkr.sh
402
-
403
- BACKUP_DIR="./backups/$(date +%Y%m%d_%H%M%S)"
404
- mkdir -p $BACKUP_DIR
405
-
406
- # Stop container
407
- docker-compose stop lynkr
408
-
409
- # Backup data
410
- cp -r ./data $BACKUP_DIR/
411
- cp -r ./workspace $BACKUP_DIR/
412
-
413
- # Restart container
414
- docker-compose start lynkr
415
-
416
- echo "Backup saved to: $BACKUP_DIR"
417
- ```
418
-
419
- ### Restore Data
420
-
421
- ```bash
422
- #!/bin/bash
423
- # restore-lynkr.sh
424
-
425
- BACKUP_DIR=$1
426
-
427
- if [ -z "$BACKUP_DIR" ]; then
428
- echo "Usage: ./restore-lynkr.sh <backup_directory>"
429
- exit 1
430
- fi
431
-
432
- # Stop container
433
- docker-compose stop lynkr
434
-
435
- # Restore data
436
- rm -rf ./data ./workspace
437
- cp -r $BACKUP_DIR/data ./
438
- cp -r $BACKUP_DIR/workspace ./
439
-
440
- # Restart container
441
- docker-compose start lynkr
442
-
443
- echo "Restored from: $BACKUP_DIR"
444
- ```
445
-
446
- ---
447
-
448
- ## Environment Variables
449
-
450
- ### Core Configuration
451
-
452
- ```yaml
453
- environment:
454
- # Provider
455
- - MODEL_PROVIDER=databricks
456
- - DATABRICKS_API_BASE=https://your-workspace.databricks.com
457
- - DATABRICKS_API_KEY=${DATABRICKS_API_KEY}
458
-
459
- # Tier-based routing (set all 4 to enable)
460
- - TIER_SIMPLE=ollama:llama3.2
461
- - TIER_MEDIUM=openrouter:openai/gpt-4o-mini
462
- - TIER_COMPLEX=databricks:databricks-claude-sonnet-4-5
463
- - TIER_REASONING=databricks:databricks-claude-sonnet-4-5
464
- - FALLBACK_ENABLED=true
465
- - FALLBACK_PROVIDER=databricks
466
-
467
- # Port
468
- - PORT=8081
469
-
470
- # Logging
471
- - LOG_LEVEL=info
472
-
473
- # Memory
474
- - MEMORY_ENABLED=true
475
- - MEMORY_RETRIEVAL_LIMIT=5
476
-
477
- # Caching
478
- - PROMPT_CACHE_ENABLED=true
479
- - PROMPT_CACHE_TTL_MS=300000
480
- ```
481
-
482
- ### Security Configuration
483
-
484
- ```yaml
485
- environment:
486
- # Git policies
487
- - POLICY_GIT_ALLOW_PUSH=false
488
- - POLICY_GIT_REQUIRE_TESTS=true
489
- - POLICY_GIT_TEST_COMMAND=npm test
490
-
491
- # Web fetch policies
492
- - WEB_SEARCH_ALLOWED_HOSTS=github.com,stackoverflow.com
493
-
494
- # Workspace policies
495
- - WORKSPACE_ROOT=/app/workspace
496
- - POLICY_MAX_STEPS=8
497
-
498
- # MCP sandbox
499
- - MCP_SANDBOX_ENABLED=true
500
- - MCP_SANDBOX_IMAGE=ubuntu:22.04
501
- ```
502
-
503
- ---
504
-
505
- ## Docker Commands
506
-
507
- ### Container Management
508
-
509
- ```bash
510
- # Start services
511
- docker-compose up -d
512
-
513
- # Stop services
514
- docker-compose stop
515
-
516
- # Restart services
517
- docker-compose restart
518
-
519
- # View logs
520
- docker-compose logs -f lynkr
521
-
522
- # View logs (last 100 lines)
523
- docker-compose logs --tail=100 lynkr
524
-
525
- # Execute command in container
526
- docker-compose exec lynkr sh
527
-
528
- # Remove containers
529
- docker-compose down
530
-
531
- # Remove containers and volumes
532
- docker-compose down -v
533
- ```
534
-
535
- ### Debugging
536
-
537
- ```bash
538
- # Check container status
539
- docker-compose ps
540
-
541
- # Inspect container
542
- docker inspect lynkr
543
-
544
- # Check resource usage
545
- docker stats lynkr
546
-
547
- # View container logs
548
- docker logs -f lynkr
549
-
550
- # Enter container shell
551
- docker exec -it lynkr sh
552
-
553
- # Check environment variables
554
- docker exec lynkr env
555
-
556
- # Test health endpoint
557
- docker exec lynkr curl http://localhost:8081/health/live
558
- ```
559
-
560
- ---
561
-
562
- ## Kubernetes Deployment
563
-
564
- ### Basic Deployment
565
-
566
- **deployment.yaml:**
567
- ```yaml
568
- apiVersion: apps/v1
569
- kind: Deployment
570
- metadata:
571
- name: lynkr
572
- labels:
573
- app: lynkr
574
- spec:
575
- replicas: 3
576
- selector:
577
- matchLabels:
578
- app: lynkr
579
- template:
580
- metadata:
581
- labels:
582
- app: lynkr
583
- spec:
584
- containers:
585
- - name: lynkr
586
- image: ghcr.io/vishalveerareddy123/lynkr:latest
587
- ports:
588
- - containerPort: 8081
589
- name: http
590
- env:
591
- - name: MODEL_PROVIDER
592
- value: "databricks"
593
- - name: DATABRICKS_API_BASE
594
- valueFrom:
595
- secretKeyRef:
596
- name: lynkr-secrets
597
- key: databricks-api-base
598
- - name: DATABRICKS_API_KEY
599
- valueFrom:
600
- secretKeyRef:
601
- name: lynkr-secrets
602
- key: databricks-api-key
603
- resources:
604
- requests:
605
- cpu: "500m"
606
- memory: "512Mi"
607
- limits:
608
- cpu: "2"
609
- memory: "2Gi"
610
- volumeMounts:
611
- - name: data
612
- mountPath: /app/data
613
- - name: workspace
614
- mountPath: /app/workspace
615
- livenessProbe:
616
- httpGet:
617
- path: /health/live
618
- port: 8081
619
- initialDelaySeconds: 10
620
- periodSeconds: 10
621
- timeoutSeconds: 5
622
- failureThreshold: 3
623
- readinessProbe:
624
- httpGet:
625
- path: /health/ready
626
- port: 8081
627
- initialDelaySeconds: 5
628
- periodSeconds: 5
629
- timeoutSeconds: 3
630
- failureThreshold: 3
631
- volumes:
632
- - name: data
633
- persistentVolumeClaim:
634
- claimName: lynkr-data-pvc
635
- - name: workspace
636
- persistentVolumeClaim:
637
- claimName: lynkr-workspace-pvc
638
- ---
639
- apiVersion: v1
640
- kind: Service
641
- metadata:
642
- name: lynkr
643
- labels:
644
- app: lynkr
645
- spec:
646
- selector:
647
- app: lynkr
648
- ports:
649
- - port: 80
650
- targetPort: 8081
651
- protocol: TCP
652
- name: http
653
- type: LoadBalancer
654
- ```
655
-
656
- **secrets.yaml:**
657
- ```yaml
658
- apiVersion: v1
659
- kind: Secret
660
- metadata:
661
- name: lynkr-secrets
662
- type: Opaque
663
- stringData:
664
- databricks-api-base: "https://your-workspace.databricks.com"
665
- databricks-api-key: "your-api-key"
666
- ```
667
-
668
- **persistent-volumes.yaml:**
669
- ```yaml
670
- apiVersion: v1
671
- kind: PersistentVolumeClaim
672
- metadata:
673
- name: lynkr-data-pvc
674
- spec:
675
- accessModes:
676
- - ReadWriteOnce
677
- resources:
678
- requests:
679
- storage: 10Gi
680
- ---
681
- apiVersion: v1
682
- kind: PersistentVolumeClaim
683
- metadata:
684
- name: lynkr-workspace-pvc
685
- spec:
686
- accessModes:
687
- - ReadWriteOnce
688
- resources:
689
- requests:
690
- storage: 50Gi
691
- ```
692
-
693
- **Deploy:**
694
- ```bash
695
- # Create secrets
696
- kubectl apply -f secrets.yaml
697
-
698
- # Create PVCs
699
- kubectl apply -f persistent-volumes.yaml
700
-
701
- # Deploy application
702
- kubectl apply -f deployment.yaml
703
-
704
- # Check status
705
- kubectl get pods -l app=lynkr
706
- kubectl get svc lynkr
707
-
708
- # View logs
709
- kubectl logs -f deployment/lynkr
710
-
711
- # Scale replicas
712
- kubectl scale deployment/lynkr --replicas=5
713
- ```
714
-
715
- ---
716
-
717
- ## Production Best Practices
718
-
719
- ### Security
720
-
721
- 1. **Run as non-root user:**
722
- ```dockerfile
723
- USER node
724
- ```
725
-
726
- 2. **Read-only root filesystem:**
727
- ```yaml
728
- security_opt:
729
- - no-new-privileges:true
730
- read_only: true
731
- tmpfs:
732
- - /tmp
733
- ```
734
-
735
- 3. **Resource limits:**
736
- ```yaml
737
- deploy:
738
- resources:
739
- limits:
740
- cpus: '2'
741
- memory: 2G
742
- reservations:
743
- cpus: '0.5'
744
- memory: 512M
745
- ```
746
-
747
- ### Monitoring
748
-
749
- 1. **Prometheus metrics:**
750
- ```yaml
751
- # Expose metrics port
752
- ports:
753
- - "8081:8081" # Main port (includes /metrics)
754
- ```
755
-
756
- 2. **Health checks:**
757
- ```yaml
758
- healthcheck:
759
- test: ["CMD", "curl", "-f", "http://localhost:8081/health/live"]
760
- interval: 30s
761
- timeout: 10s
762
- retries: 3
763
- start_period: 40s
764
- ```
765
-
766
- 3. **Logging:**
767
- ```yaml
768
- logging:
769
- driver: "json-file"
770
- options:
771
- max-size: "10m"
772
- max-file: "3"
773
- ```
774
-
775
- ### High Availability
776
-
777
- 1. **Multiple replicas:**
778
- ```yaml
779
- spec:
780
- replicas: 3
781
- ```
782
-
783
- 2. **Load balancer:**
784
- ```yaml
785
- services:
786
- nginx:
787
- image: nginx:alpine
788
- ports:
789
- - "80:80"
790
- volumes:
791
- - ./nginx.conf:/etc/nginx/nginx.conf:ro
792
- depends_on:
793
- - lynkr
794
- ```
795
-
796
- 3. **Shared database:**
797
- ```yaml
798
- volumes:
799
- - lynkr_data:/app/data # Shared volume
800
-
801
- volumes:
802
- lynkr_data:
803
- driver: local
804
- ```
805
-
806
- ---
807
-
808
- ## Troubleshooting
809
-
810
- ### Container Won't Start
811
-
812
- ```bash
813
- # Check logs
814
- docker-compose logs lynkr
815
-
816
- # Common issues:
817
- # 1. Missing environment variables
818
- # 2. Invalid API credentials
819
- # 3. Port already in use
820
- ```
821
-
822
- ### Connection Refused
823
-
824
- ```bash
825
- # Check container is running
826
- docker-compose ps
827
-
828
- # Check port binding
829
- docker port lynkr
830
-
831
- # Test from inside container
832
- docker exec lynkr curl http://localhost:8081/health/live
833
- ```
834
-
835
- ### Out of Memory
836
-
837
- ```bash
838
- # Increase memory limit
839
- docker-compose.yml:
840
- deploy:
841
- resources:
842
- limits:
843
- memory: 4G # Increase from 2G
844
- ```
845
-
846
- ### Slow Performance
847
-
848
- ```bash
849
- # Check resource usage
850
- docker stats lynkr
851
-
852
- # Increase CPU limit
853
- docker-compose.yml:
854
- deploy:
855
- resources:
856
- limits:
857
- cpus: '4' # Increase from 2
858
- ```
859
-
860
- ---
861
-
862
- ## Next Steps
863
-
864
- - **[Production Guide](production.md)** - Production deployment best practices
865
- - **[Monitoring Guide](production.md#monitoring)** - Prometheus + Grafana setup
866
- - **[API Reference](api.md)** - API endpoints
867
- - **[Troubleshooting](troubleshooting.md)** - Common issues
868
-
869
- ---
870
-
871
- ## Getting Help
872
-
873
- - **[GitHub Discussions](https://github.com/vishalveerareddy123/Lynkr/discussions)** - Ask questions
874
- - **[GitHub Issues](https://github.com/vishalveerareddy123/Lynkr/issues)** - Report issues