dash 4.1.3 → 4.2.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 (163) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dash/autoscale/connections/builder.rb +51 -0
  3. data/lib/dash/autoscale/connections.rb +102 -0
  4. data/lib/dash/autoscale/controller.rb +296 -0
  5. data/lib/dash/autoscale/cron.rb +75 -0
  6. data/lib/dash/autoscale/decision.rb +89 -0
  7. data/lib/dash/autoscale/duration.rb +19 -0
  8. data/lib/dash/autoscale/evaluation.rb +52 -0
  9. data/lib/dash/autoscale/guard.rb +48 -0
  10. data/lib/dash/autoscale/histogram.rb +48 -0
  11. data/lib/dash/autoscale/lease.rb +55 -0
  12. data/lib/dash/autoscale/lease_held.rb +2 -0
  13. data/lib/dash/autoscale/lease_lost.rb +2 -0
  14. data/lib/dash/autoscale/member.rb +28 -0
  15. data/lib/dash/autoscale/metrics.rb +70 -0
  16. data/lib/dash/autoscale/metrics_server.rb +71 -0
  17. data/lib/dash/autoscale/observation.rb +41 -0
  18. data/lib/dash/autoscale/pause.rb +34 -0
  19. data/lib/dash/autoscale/policy.rb +198 -0
  20. data/lib/dash/autoscale/pool.rb +103 -0
  21. data/lib/dash/autoscale/prometheus_client.rb +76 -0
  22. data/lib/dash/autoscale/provider/base.rb +43 -0
  23. data/lib/dash/autoscale/provider/exec.rb +94 -0
  24. data/lib/dash/autoscale/provider/upcloud.rb +140 -0
  25. data/lib/dash/autoscale/provider.rb +9 -0
  26. data/lib/dash/autoscale/provider_error.rb +4 -0
  27. data/lib/dash/autoscale/read_only_query.rb +38 -0
  28. data/lib/dash/autoscale/reader.rb +17 -0
  29. data/lib/dash/autoscale/recorder.rb +13 -0
  30. data/lib/dash/autoscale/role_state.rb +110 -0
  31. data/lib/dash/autoscale/sample.rb +18 -0
  32. data/lib/dash/autoscale/signal/pgbus.rb +19 -0
  33. data/lib/dash/autoscale/signal/prometheus.rb +8 -0
  34. data/lib/dash/autoscale/signal/proxy.rb +49 -0
  35. data/lib/dash/autoscale/signal/sidekiq.rb +49 -0
  36. data/lib/dash/autoscale/signal.rb +33 -0
  37. data/lib/dash/autoscale/simulation.rb +200 -0
  38. data/lib/dash/autoscale/state_store.rb +132 -0
  39. data/lib/dash/autoscale/timestamp.rb +15 -0
  40. data/lib/dash/autoscale/tunnel.rb +48 -0
  41. data/lib/dash/cli/accessory.rb +16 -0
  42. data/lib/dash/cli/app/boot.rb +69 -44
  43. data/lib/dash/cli/app/boot_state.rb +70 -0
  44. data/lib/dash/cli/app/rollout_boot.rb +28 -9
  45. data/lib/dash/cli/app/running_targets.rb +39 -0
  46. data/lib/dash/cli/app/slot_version.rb +29 -0
  47. data/lib/dash/cli/app.rb +89 -32
  48. data/lib/dash/cli/autoscale.rb +330 -0
  49. data/lib/dash/cli/base.rb +15 -3
  50. data/lib/dash/cli/lock.rb +6 -1
  51. data/lib/dash/cli/main.rb +77 -8
  52. data/lib/dash/cli/proxy/inspection.rb +52 -0
  53. data/lib/dash/cli/proxy/loadbalancer_deploy.rb +20 -0
  54. data/lib/dash/cli/proxy/loadbalancer_reboot.rb +1 -1
  55. data/lib/dash/cli/proxy/reboot.rb +4 -9
  56. data/lib/dash/cli/proxy.rb +12 -7
  57. data/lib/dash/cli/prune.rb +5 -3
  58. data/lib/dash/cli/report.rb +4 -1
  59. data/lib/dash/cli/scale/host_plan.rb +63 -0
  60. data/lib/dash/cli/scale/join.rb +128 -0
  61. data/lib/dash/cli/scale/leave.rb +58 -0
  62. data/lib/dash/cli/scale/placement.rb +54 -0
  63. data/lib/dash/cli/scale/power_off.rb +26 -0
  64. data/lib/dash/cli/scale/replica_join.rb +74 -0
  65. data/lib/dash/cli/scale/replica_leave.rb +121 -0
  66. data/lib/dash/cli/scale.rb +276 -0
  67. data/lib/dash/cli/server.rb +41 -0
  68. data/lib/dash/cli/stats_table.rb +34 -0
  69. data/lib/dash/cli/templates/sample_hooks/post-scale-in.sample +3 -0
  70. data/lib/dash/cli/templates/sample_hooks/post-scale-out.sample +3 -0
  71. data/lib/dash/cli/templates/sample_hooks/pre-scale-in.sample +6 -0
  72. data/lib/dash/cli/templates/sample_hooks/pre-scale-out.sample +6 -0
  73. data/lib/dash/commander.rb +17 -3
  74. data/lib/dash/commands/accessory/proxy.rb +1 -1
  75. data/lib/dash/commands/accessory.rb +21 -2
  76. data/lib/dash/commands/app/containers.rb +28 -3
  77. data/lib/dash/commands/app/logging.rb +13 -2
  78. data/lib/dash/commands/app/proxy.rb +4 -4
  79. data/lib/dash/commands/app.rb +90 -10
  80. data/lib/dash/commands/auditor.rb +2 -2
  81. data/lib/dash/commands/autoscale.rb +133 -0
  82. data/lib/dash/commands/base.rb +4 -0
  83. data/lib/dash/commands/proxy/services.rb +10 -0
  84. data/lib/dash/commands/prune.rb +10 -2
  85. data/lib/dash/commands/server.rb +16 -0
  86. data/lib/dash/configuration/accessory.rb +2 -2
  87. data/lib/dash/configuration/autoscale.rb +123 -0
  88. data/lib/dash/configuration/docs/autoscale.yml +142 -0
  89. data/lib/dash/configuration/docs/configuration.yml +8 -2
  90. data/lib/dash/configuration/docs/proxy.yml +8 -1
  91. data/lib/dash/configuration/docs/role.yml +238 -0
  92. data/lib/dash/configuration/loadbalancer.rb +3 -2
  93. data/lib/dash/configuration/proxy/run.rb +1 -1
  94. data/lib/dash/configuration/proxy.rb +26 -7
  95. data/lib/dash/configuration/role/drain.rb +49 -0
  96. data/lib/dash/configuration/role/replicas.rb +72 -0
  97. data/lib/dash/configuration/role/scale/guard.rb +40 -0
  98. data/lib/dash/configuration/role/scale/signal.rb +93 -0
  99. data/lib/dash/configuration/role/scale/window.rb +37 -0
  100. data/lib/dash/configuration/role/scale.rb +199 -0
  101. data/lib/dash/configuration/role.rb +123 -6
  102. data/lib/dash/configuration/validator/autoscale.rb +126 -0
  103. data/lib/dash/configuration/validator/proxy.rb +13 -0
  104. data/lib/dash/configuration/validator/role.rb +26 -5
  105. data/lib/dash/configuration.rb +131 -15
  106. data/lib/dash/diagnostics/audit.rb +28 -0
  107. data/lib/dash/diagnostics/autoscale_decisions.rb +18 -0
  108. data/lib/dash/diagnostics/autoscale_explain.rb +30 -0
  109. data/lib/dash/diagnostics/autoscale_signal.rb +82 -0
  110. data/lib/dash/diagnostics/base.rb +53 -0
  111. data/lib/dash/diagnostics/config.rb +32 -0
  112. data/lib/dash/diagnostics/container_stats.rb +67 -0
  113. data/lib/dash/diagnostics/containers.rb +20 -0
  114. data/lib/dash/diagnostics/controller_status.rb +44 -0
  115. data/lib/dash/diagnostics/docker_ps.rb +40 -0
  116. data/lib/dash/{cli → diagnostics}/doctor/config_checks.rb +3 -3
  117. data/lib/dash/diagnostics/doctor/controller_checks.rb +46 -0
  118. data/lib/dash/{cli → diagnostics}/doctor/endpoint_checks.rb +12 -4
  119. data/lib/dash/{cli → diagnostics}/doctor/host_checks.rb +5 -4
  120. data/lib/dash/diagnostics/doctor/pool_checks.rb +65 -0
  121. data/lib/dash/diagnostics/doctor/signal_checks.rb +78 -0
  122. data/lib/dash/diagnostics/doctor.rb +182 -0
  123. data/lib/dash/diagnostics/drift.rb +168 -0
  124. data/lib/dash/diagnostics/host_stats.rb +59 -0
  125. data/lib/dash/diagnostics/lines.rb +14 -0
  126. data/lib/dash/diagnostics/lock.rb +27 -0
  127. data/lib/dash/diagnostics/logs.rb +76 -0
  128. data/lib/dash/diagnostics/pool.rb +41 -0
  129. data/lib/dash/diagnostics/proxy_queue.rb +40 -0
  130. data/lib/dash/diagnostics/proxy_services.rb +36 -0
  131. data/lib/dash/diagnostics/redactor.rb +48 -0
  132. data/lib/dash/diagnostics/reports.rb +17 -0
  133. data/lib/dash/diagnostics/scale.rb +51 -0
  134. data/lib/dash/diagnostics/units.rb +31 -0
  135. data/lib/dash/mcp/base_tool.rb +43 -0
  136. data/lib/dash/mcp/runner.rb +28 -0
  137. data/lib/dash/mcp/server.rb +40 -0
  138. data/lib/dash/mcp/session.rb +51 -0
  139. data/lib/dash/mcp/tools/audit_tool.rb +11 -0
  140. data/lib/dash/mcp/tools/autoscale_decisions_tool.rb +22 -0
  141. data/lib/dash/mcp/tools/autoscale_explain_tool.rb +56 -0
  142. data/lib/dash/mcp/tools/config_tool.rb +10 -0
  143. data/lib/dash/mcp/tools/container_stats_tool.rb +15 -0
  144. data/lib/dash/mcp/tools/containers_tool.rb +10 -0
  145. data/lib/dash/mcp/tools/controller_status_tool.rb +18 -0
  146. data/lib/dash/mcp/tools/deploy_reports_tool.rb +10 -0
  147. data/lib/dash/mcp/tools/doctor_tool.rb +13 -0
  148. data/lib/dash/mcp/tools/drift_tool.rb +16 -0
  149. data/lib/dash/mcp/tools/host_stats_tool.rb +14 -0
  150. data/lib/dash/mcp/tools/lock_status_tool.rb +15 -0
  151. data/lib/dash/mcp/tools/logs_tool.rb +41 -0
  152. data/lib/dash/mcp/tools/pool_members_tool.rb +15 -0
  153. data/lib/dash/mcp/tools/proxy_services_tool.rb +10 -0
  154. data/lib/dash/mcp/tools/scale_status_tool.rb +10 -0
  155. data/lib/dash/mcp/tools/signal_sample_tool.rb +21 -0
  156. data/lib/dash/mcp/transport.rb +14 -0
  157. data/lib/dash/mcp.rb +56 -0
  158. data/lib/dash/sshkit_with_ext.rb +4 -4
  159. data/lib/dash/utils.rb +7 -0
  160. data/lib/dash/version.rb +1 -1
  161. data/lib/dash.rb +2 -0
  162. metadata +122 -5
  163. data/lib/dash/cli/doctor.rb +0 -113
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dash
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.3
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson
@@ -177,6 +177,45 @@ files:
177
177
  - README.md
178
178
  - bin/dash
179
179
  - lib/dash.rb
180
+ - lib/dash/autoscale/connections.rb
181
+ - lib/dash/autoscale/connections/builder.rb
182
+ - lib/dash/autoscale/controller.rb
183
+ - lib/dash/autoscale/cron.rb
184
+ - lib/dash/autoscale/decision.rb
185
+ - lib/dash/autoscale/duration.rb
186
+ - lib/dash/autoscale/evaluation.rb
187
+ - lib/dash/autoscale/guard.rb
188
+ - lib/dash/autoscale/histogram.rb
189
+ - lib/dash/autoscale/lease.rb
190
+ - lib/dash/autoscale/lease_held.rb
191
+ - lib/dash/autoscale/lease_lost.rb
192
+ - lib/dash/autoscale/member.rb
193
+ - lib/dash/autoscale/metrics.rb
194
+ - lib/dash/autoscale/metrics_server.rb
195
+ - lib/dash/autoscale/observation.rb
196
+ - lib/dash/autoscale/pause.rb
197
+ - lib/dash/autoscale/policy.rb
198
+ - lib/dash/autoscale/pool.rb
199
+ - lib/dash/autoscale/prometheus_client.rb
200
+ - lib/dash/autoscale/provider.rb
201
+ - lib/dash/autoscale/provider/base.rb
202
+ - lib/dash/autoscale/provider/exec.rb
203
+ - lib/dash/autoscale/provider/upcloud.rb
204
+ - lib/dash/autoscale/provider_error.rb
205
+ - lib/dash/autoscale/read_only_query.rb
206
+ - lib/dash/autoscale/reader.rb
207
+ - lib/dash/autoscale/recorder.rb
208
+ - lib/dash/autoscale/role_state.rb
209
+ - lib/dash/autoscale/sample.rb
210
+ - lib/dash/autoscale/signal.rb
211
+ - lib/dash/autoscale/signal/pgbus.rb
212
+ - lib/dash/autoscale/signal/prometheus.rb
213
+ - lib/dash/autoscale/signal/proxy.rb
214
+ - lib/dash/autoscale/signal/sidekiq.rb
215
+ - lib/dash/autoscale/simulation.rb
216
+ - lib/dash/autoscale/state_store.rb
217
+ - lib/dash/autoscale/timestamp.rb
218
+ - lib/dash/autoscale/tunnel.rb
180
219
  - lib/dash/build/progress_parser.rb
181
220
  - lib/dash/build/report.rb
182
221
  - lib/dash/build/step.rb
@@ -186,17 +225,17 @@ files:
186
225
  - lib/dash/cli/app.rb
187
226
  - lib/dash/cli/app/assets.rb
188
227
  - lib/dash/cli/app/boot.rb
228
+ - lib/dash/cli/app/boot_state.rb
189
229
  - lib/dash/cli/app/error_pages.rb
190
230
  - lib/dash/cli/app/rollout_boot.rb
231
+ - lib/dash/cli/app/running_targets.rb
232
+ - lib/dash/cli/app/slot_version.rb
191
233
  - lib/dash/cli/app/ssl_certificates.rb
234
+ - lib/dash/cli/autoscale.rb
192
235
  - lib/dash/cli/base.rb
193
236
  - lib/dash/cli/build.rb
194
237
  - lib/dash/cli/build/clone.rb
195
238
  - lib/dash/cli/build/port_forwarding.rb
196
- - lib/dash/cli/doctor.rb
197
- - lib/dash/cli/doctor/config_checks.rb
198
- - lib/dash/cli/doctor/endpoint_checks.rb
199
- - lib/dash/cli/doctor/host_checks.rb
200
239
  - lib/dash/cli/healthcheck/barrier.rb
201
240
  - lib/dash/cli/healthcheck/drift_error.rb
202
241
  - lib/dash/cli/healthcheck/error.rb
@@ -207,15 +246,26 @@ files:
207
246
  - lib/dash/cli/main/migrate.rb
208
247
  - lib/dash/cli/proxy.rb
209
248
  - lib/dash/cli/proxy/drift.rb
249
+ - lib/dash/cli/proxy/inspection.rb
210
250
  - lib/dash/cli/proxy/legacy_rename.rb
211
251
  - lib/dash/cli/proxy/loadbalancer_claim.rb
252
+ - lib/dash/cli/proxy/loadbalancer_deploy.rb
212
253
  - lib/dash/cli/proxy/loadbalancer_reboot.rb
213
254
  - lib/dash/cli/proxy/reboot.rb
214
255
  - lib/dash/cli/prune.rb
215
256
  - lib/dash/cli/registry.rb
216
257
  - lib/dash/cli/report.rb
258
+ - lib/dash/cli/scale.rb
259
+ - lib/dash/cli/scale/host_plan.rb
260
+ - lib/dash/cli/scale/join.rb
261
+ - lib/dash/cli/scale/leave.rb
262
+ - lib/dash/cli/scale/placement.rb
263
+ - lib/dash/cli/scale/power_off.rb
264
+ - lib/dash/cli/scale/replica_join.rb
265
+ - lib/dash/cli/scale/replica_leave.rb
217
266
  - lib/dash/cli/secrets.rb
218
267
  - lib/dash/cli/server.rb
268
+ - lib/dash/cli/stats_table.rb
219
269
  - lib/dash/cli/templates/deploy.yml
220
270
  - lib/dash/cli/templates/sample_hooks/docker-setup.sample
221
271
  - lib/dash/cli/templates/sample_hooks/post-app-boot.sample
@@ -223,6 +273,8 @@ files:
223
273
  - lib/dash/cli/templates/sample_hooks/post-deploy.sample
224
274
  - lib/dash/cli/templates/sample_hooks/post-proxy-deploy.sample
225
275
  - lib/dash/cli/templates/sample_hooks/post-proxy-reboot.sample
276
+ - lib/dash/cli/templates/sample_hooks/post-scale-in.sample
277
+ - lib/dash/cli/templates/sample_hooks/post-scale-out.sample
226
278
  - lib/dash/cli/templates/sample_hooks/pre-app-boot.sample
227
279
  - lib/dash/cli/templates/sample_hooks/pre-app-stop.sample
228
280
  - lib/dash/cli/templates/sample_hooks/pre-build.sample
@@ -230,6 +282,8 @@ files:
230
282
  - lib/dash/cli/templates/sample_hooks/pre-deploy.sample
231
283
  - lib/dash/cli/templates/sample_hooks/pre-proxy-deploy.sample
232
284
  - lib/dash/cli/templates/sample_hooks/pre-proxy-reboot.sample
285
+ - lib/dash/cli/templates/sample_hooks/pre-scale-in.sample
286
+ - lib/dash/cli/templates/sample_hooks/pre-scale-out.sample
233
287
  - lib/dash/cli/templates/secrets
234
288
  - lib/dash/commander.rb
235
289
  - lib/dash/commander/specifics.rb
@@ -245,6 +299,7 @@ files:
245
299
  - lib/dash/commands/app/logging.rb
246
300
  - lib/dash/commands/app/proxy.rb
247
301
  - lib/dash/commands/auditor.rb
302
+ - lib/dash/commands/autoscale.rb
248
303
  - lib/dash/commands/base.rb
249
304
  - lib/dash/commands/builder.rb
250
305
  - lib/dash/commands/builder/base.rb
@@ -260,6 +315,7 @@ files:
260
315
  - lib/dash/commands/lock.rb
261
316
  - lib/dash/commands/proxy.rb
262
317
  - lib/dash/commands/proxy/cert_transfer.rb
318
+ - lib/dash/commands/proxy/services.rb
263
319
  - lib/dash/commands/proxy/state.rb
264
320
  - lib/dash/commands/prune.rb
265
321
  - lib/dash/commands/registry.rb
@@ -267,10 +323,12 @@ files:
267
323
  - lib/dash/configuration.rb
268
324
  - lib/dash/configuration/accessory.rb
269
325
  - lib/dash/configuration/alias.rb
326
+ - lib/dash/configuration/autoscale.rb
270
327
  - lib/dash/configuration/boot.rb
271
328
  - lib/dash/configuration/builder.rb
272
329
  - lib/dash/configuration/docs/accessory.yml
273
330
  - lib/dash/configuration/docs/alias.yml
331
+ - lib/dash/configuration/docs/autoscale.yml
274
332
  - lib/dash/configuration/docs/boot.yml
275
333
  - lib/dash/configuration/docs/builder.yml
276
334
  - lib/dash/configuration/docs/configuration.yml
@@ -296,7 +354,13 @@ files:
296
354
  - lib/dash/configuration/registry.rb
297
355
  - lib/dash/configuration/report.rb
298
356
  - lib/dash/configuration/role.rb
357
+ - lib/dash/configuration/role/drain.rb
299
358
  - lib/dash/configuration/role/healthcheck.rb
359
+ - lib/dash/configuration/role/replicas.rb
360
+ - lib/dash/configuration/role/scale.rb
361
+ - lib/dash/configuration/role/scale/guard.rb
362
+ - lib/dash/configuration/role/scale/signal.rb
363
+ - lib/dash/configuration/role/scale/window.rb
300
364
  - lib/dash/configuration/servers.rb
301
365
  - lib/dash/configuration/ssh.rb
302
366
  - lib/dash/configuration/sshkit.rb
@@ -304,6 +368,7 @@ files:
304
368
  - lib/dash/configuration/validator.rb
305
369
  - lib/dash/configuration/validator/accessory.rb
306
370
  - lib/dash/configuration/validator/alias.rb
371
+ - lib/dash/configuration/validator/autoscale.rb
307
372
  - lib/dash/configuration/validator/builder.rb
308
373
  - lib/dash/configuration/validator/configuration.rb
309
374
  - lib/dash/configuration/validator/env.rb
@@ -312,6 +377,35 @@ files:
312
377
  - lib/dash/configuration/validator/role.rb
313
378
  - lib/dash/configuration/validator/servers.rb
314
379
  - lib/dash/configuration/volume.rb
380
+ - lib/dash/diagnostics/audit.rb
381
+ - lib/dash/diagnostics/autoscale_decisions.rb
382
+ - lib/dash/diagnostics/autoscale_explain.rb
383
+ - lib/dash/diagnostics/autoscale_signal.rb
384
+ - lib/dash/diagnostics/base.rb
385
+ - lib/dash/diagnostics/config.rb
386
+ - lib/dash/diagnostics/container_stats.rb
387
+ - lib/dash/diagnostics/containers.rb
388
+ - lib/dash/diagnostics/controller_status.rb
389
+ - lib/dash/diagnostics/docker_ps.rb
390
+ - lib/dash/diagnostics/doctor.rb
391
+ - lib/dash/diagnostics/doctor/config_checks.rb
392
+ - lib/dash/diagnostics/doctor/controller_checks.rb
393
+ - lib/dash/diagnostics/doctor/endpoint_checks.rb
394
+ - lib/dash/diagnostics/doctor/host_checks.rb
395
+ - lib/dash/diagnostics/doctor/pool_checks.rb
396
+ - lib/dash/diagnostics/doctor/signal_checks.rb
397
+ - lib/dash/diagnostics/drift.rb
398
+ - lib/dash/diagnostics/host_stats.rb
399
+ - lib/dash/diagnostics/lines.rb
400
+ - lib/dash/diagnostics/lock.rb
401
+ - lib/dash/diagnostics/logs.rb
402
+ - lib/dash/diagnostics/pool.rb
403
+ - lib/dash/diagnostics/proxy_queue.rb
404
+ - lib/dash/diagnostics/proxy_services.rb
405
+ - lib/dash/diagnostics/redactor.rb
406
+ - lib/dash/diagnostics/reports.rb
407
+ - lib/dash/diagnostics/scale.rb
408
+ - lib/dash/diagnostics/units.rb
315
409
  - lib/dash/docker.rb
316
410
  - lib/dash/dockerfile/analyzer.rb
317
411
  - lib/dash/dockerfile/context.rb
@@ -340,6 +434,29 @@ files:
340
434
  - lib/dash/dockerfile/stage.rb
341
435
  - lib/dash/env_file.rb
342
436
  - lib/dash/git.rb
437
+ - lib/dash/mcp.rb
438
+ - lib/dash/mcp/base_tool.rb
439
+ - lib/dash/mcp/runner.rb
440
+ - lib/dash/mcp/server.rb
441
+ - lib/dash/mcp/session.rb
442
+ - lib/dash/mcp/tools/audit_tool.rb
443
+ - lib/dash/mcp/tools/autoscale_decisions_tool.rb
444
+ - lib/dash/mcp/tools/autoscale_explain_tool.rb
445
+ - lib/dash/mcp/tools/config_tool.rb
446
+ - lib/dash/mcp/tools/container_stats_tool.rb
447
+ - lib/dash/mcp/tools/containers_tool.rb
448
+ - lib/dash/mcp/tools/controller_status_tool.rb
449
+ - lib/dash/mcp/tools/deploy_reports_tool.rb
450
+ - lib/dash/mcp/tools/doctor_tool.rb
451
+ - lib/dash/mcp/tools/drift_tool.rb
452
+ - lib/dash/mcp/tools/host_stats_tool.rb
453
+ - lib/dash/mcp/tools/lock_status_tool.rb
454
+ - lib/dash/mcp/tools/logs_tool.rb
455
+ - lib/dash/mcp/tools/pool_members_tool.rb
456
+ - lib/dash/mcp/tools/proxy_services_tool.rb
457
+ - lib/dash/mcp/tools/scale_status_tool.rb
458
+ - lib/dash/mcp/tools/signal_sample_tool.rb
459
+ - lib/dash/mcp/transport.rb
343
460
  - lib/dash/otel_shipper.rb
344
461
  - lib/dash/output/base_logger.rb
345
462
  - lib/dash/output/file_logger.rb
@@ -1,113 +0,0 @@
1
- require "dash/sshkit_with_ext"
2
-
3
- # Runs read-only deploy readiness checks and collects the results, without ever
4
- # raising on a broken environment - failures become failing results instead.
5
- class Dash::Cli::Doctor
6
- include SSHKit::DSL
7
-
8
- HOST_CHECKS = %i[ ssh docker registry proxy_image proxy_version proxy_socket ports ]
9
-
10
- CHECK_TITLES = {
11
- ssh: "SSH",
12
- docker: "Docker",
13
- registry: "Registry",
14
- proxy_image: "Proxy image",
15
- proxy_version: "Proxy version",
16
- proxy_socket: "Proxy docker socket",
17
- ports: "Ports",
18
- dns: "DNS",
19
- certificate: "Certificates",
20
- readiness: "Readiness",
21
- dockerfile: "Dockerfile"
22
- }.freeze
23
-
24
- STATUS_COLORS = { ok: :green, warn: :yellow, fail: :red }.freeze
25
-
26
- Result = Struct.new(:check, :target, :status, :detail) do
27
- def ok?
28
- status == :ok
29
- end
30
-
31
- def warn?
32
- status == :warn
33
- end
34
-
35
- def fail?
36
- status == :fail
37
- end
38
-
39
- def title
40
- CHECK_TITLES[check]
41
- end
42
-
43
- def to_s
44
- "#{status.to_s.upcase} #{target}: #{detail}"
45
- end
46
- end
47
-
48
- attr_reader :results
49
-
50
- def initialize
51
- @results = []
52
- end
53
-
54
- def run
55
- @results = host_check_results + endpoint_check_results + config_check_results
56
- end
57
-
58
- def failures
59
- results.select(&:fail?)
60
- end
61
-
62
- def warnings
63
- results.select(&:warn?)
64
- end
65
-
66
- def successful?
67
- failures.none?
68
- end
69
-
70
- private
71
- def host_check_results
72
- results_by_host = collect_host_checks
73
-
74
- HOST_CHECKS.flat_map do |check|
75
- DASH.hosts.filter_map { |host| results_by_host.dig(host, check) }
76
- end
77
- end
78
-
79
- def collect_host_checks
80
- results_by_host = {}
81
- mutex = Mutex.new
82
- proxy_hosts = DASH.proxy_hosts
83
- error = nil
84
-
85
- begin
86
- on(DASH.hosts) do |host|
87
- checks = Dash::Cli::Doctor::HostChecks.new(host.hostname, self, proxy_host: proxy_hosts.include?(host.hostname)).run
88
- mutex.synchronize { results_by_host[host.hostname] = checks }
89
- end
90
- # Only ExecuteError: sshkit 1.25 has no MultipleExecuteError, and naming
91
- # a constant that does not exist turns "a host's checks failed" into a
92
- # NameError - the opposite of the doctor's never-crash contract.
93
- rescue SSHKit::Runner::ExecuteError => e
94
- # Per-check errors are captured inside HostChecks; getting here means a
95
- # host's checks never completed at all. Record those as SSH failures below.
96
- error = e
97
- end
98
-
99
- DASH.hosts.each do |host|
100
- results_by_host[host] ||= { ssh: Result.new(:ssh, host, :fail, "could not run checks (#{error&.message || "connection failed"})") }
101
- end
102
-
103
- results_by_host
104
- end
105
-
106
- def endpoint_check_results
107
- Dash::Cli::Doctor::EndpointChecks.new.run
108
- end
109
-
110
- def config_check_results
111
- Dash::Cli::Doctor::ConfigChecks.new.run
112
- end
113
- end