@atomic-chat/core 0.5.1 → 0.13.2
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.
- package/README.md +22 -0
- package/dist/app-daemon.js +20 -67
- package/dist/app-daemon.js.map +1 -1
- package/dist/backend/advisor/advisor.d.ts +132 -0
- package/dist/backend/advisor/advisor.js +537 -0
- package/dist/backend/advisor/advisor.js.map +1 -0
- package/dist/backend/advisor/index.d.ts +6 -0
- package/dist/backend/advisor/index.js +7 -0
- package/dist/backend/advisor/index.js.map +1 -0
- package/dist/backend/advisor/policy.d.ts +81 -0
- package/dist/backend/advisor/policy.js +154 -0
- package/dist/backend/advisor/policy.js.map +1 -0
- package/dist/backend/catalog/archive.d.ts +21 -7
- package/dist/backend/catalog/archive.js +57 -17
- package/dist/backend/catalog/archive.js.map +1 -1
- package/dist/backend/catalog/bundled-manifest-baseline.js +42 -26
- package/dist/backend/catalog/bundled-manifest-baseline.js.map +1 -1
- package/dist/backend/catalog/cuda-family.d.ts +12 -2
- package/dist/backend/catalog/cuda-family.js +30 -7
- package/dist/backend/catalog/cuda-family.js.map +1 -1
- package/dist/backend/catalog/index.d.ts +5 -0
- package/dist/backend/catalog/index.js +5 -0
- package/dist/backend/catalog/index.js.map +1 -1
- package/dist/backend/catalog/manifest.d.ts +5 -3
- package/dist/backend/catalog/manifest.js +12 -9
- package/dist/backend/catalog/manifest.js.map +1 -1
- package/dist/backend/catalog/migrate.d.ts +8 -6
- package/dist/backend/catalog/migrate.js +26 -15
- package/dist/backend/catalog/migrate.js.map +1 -1
- package/dist/backend/catalog/prism-catalog.d.ts +42 -0
- package/dist/backend/catalog/prism-catalog.js +101 -0
- package/dist/backend/catalog/prism-catalog.js.map +1 -0
- package/dist/backend/catalog/prism-manifest-baseline.d.ts +2 -0
- package/dist/backend/catalog/prism-manifest-baseline.js +11 -0
- package/dist/backend/catalog/prism-manifest-baseline.js.map +1 -0
- package/dist/backend/catalog/prism-manifest-baseline.json +134 -0
- package/dist/backend/catalog/prism-manifest.d.ts +90 -0
- package/dist/backend/catalog/prism-manifest.js +171 -0
- package/dist/backend/catalog/prism-manifest.js.map +1 -0
- package/dist/backend/catalog/turboquant-catalog.d.ts +60 -0
- package/dist/backend/catalog/turboquant-catalog.js +162 -0
- package/dist/backend/catalog/turboquant-catalog.js.map +1 -0
- package/dist/backend/catalog/turboquant-index.d.ts +104 -0
- package/dist/backend/catalog/turboquant-index.js +260 -0
- package/dist/backend/catalog/turboquant-index.js.map +1 -0
- package/dist/backend/index.d.ts +1 -0
- package/dist/backend/index.js +1 -0
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/install/runtime-backend.d.ts +6 -6
- package/dist/backend/install/runtime-backend.js +23 -20
- package/dist/backend/install/runtime-backend.js.map +1 -1
- package/dist/backend/install/service.d.ts +106 -5
- package/dist/backend/install/service.js +247 -21
- package/dist/backend/install/service.js.map +1 -1
- package/dist/backend/installed/bundled.d.ts +19 -0
- package/dist/backend/installed/bundled.js +45 -0
- package/dist/backend/installed/bundled.js.map +1 -0
- package/dist/backend/installed/index.d.ts +1 -0
- package/dist/backend/installed/index.js +1 -0
- package/dist/backend/installed/index.js.map +1 -1
- package/dist/backend/installed/installed.js +3 -0
- package/dist/backend/installed/installed.js.map +1 -1
- package/dist/backend/optimal/optimal-cache.d.ts +27 -8
- package/dist/backend/optimal/optimal-cache.js +38 -19
- package/dist/backend/optimal/optimal-cache.js.map +1 -1
- package/dist/backend/optimal/optimal-store.js +1 -1
- package/dist/backend/optimal/optimal-store.js.map +1 -1
- package/dist/backend/select/categories.d.ts +2 -1
- package/dist/backend/select/categories.js +8 -1
- package/dist/backend/select/categories.js.map +1 -1
- package/dist/backend/select/features.d.ts +13 -5
- package/dist/backend/select/features.js +36 -6
- package/dist/backend/select/features.js.map +1 -1
- package/dist/backend/select/index.d.ts +2 -0
- package/dist/backend/select/index.js +2 -0
- package/dist/backend/select/index.js.map +1 -1
- package/dist/backend/select/prism.d.ts +54 -0
- package/dist/backend/select/prism.js +212 -0
- package/dist/backend/select/prism.js.map +1 -0
- package/dist/backend/select/recovery.d.ts +4 -2
- package/dist/backend/select/recovery.js +17 -5
- package/dist/backend/select/recovery.js.map +1 -1
- package/dist/backend/select/tiers.d.ts +20 -11
- package/dist/backend/select/tiers.js +49 -11
- package/dist/backend/select/tiers.js.map +1 -1
- package/dist/backend/select/turboquant-tiers.d.ts +45 -0
- package/dist/backend/select/turboquant-tiers.js +114 -0
- package/dist/backend/select/turboquant-tiers.js.map +1 -0
- package/dist/backend/types.d.ts +6 -69
- package/dist/cli/commands/backends.d.ts +10 -0
- package/dist/cli/commands/backends.js +142 -0
- package/dist/cli/commands/backends.js.map +1 -0
- package/dist/cli/commands/hardware.d.ts +13 -0
- package/dist/cli/commands/hardware.js +71 -0
- package/dist/cli/commands/hardware.js.map +1 -0
- package/dist/cli/commands/host-step.d.ts +28 -0
- package/dist/cli/commands/host-step.js +67 -0
- package/dist/cli/commands/host-step.js.map +1 -0
- package/dist/cli/commands/index.d.ts +4 -1
- package/dist/cli/commands/index.js +4 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/serve.js +4 -4
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/shared.d.ts +6 -1
- package/dist/cli/commands/shared.js +7 -0
- package/dist/cli/commands/shared.js.map +1 -1
- package/dist/cli/io.d.ts +11 -0
- package/dist/cli/io.js +28 -3
- package/dist/cli/io.js.map +1 -1
- package/dist/cli/launch.js +2 -2
- package/dist/cli/launch.js.map +1 -1
- package/dist/cli/main.d.ts +1 -1
- package/dist/cli/main.js +11 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/client/control-client.d.ts +128 -7
- package/dist/client/control-client.js +211 -12
- package/dist/client/control-client.js.map +1 -1
- package/dist/cloud/registry.js +9 -1
- package/dist/cloud/registry.js.map +1 -1
- package/dist/config/paths.d.ts +137 -0
- package/dist/config/paths.js +163 -0
- package/dist/config/paths.js.map +1 -1
- package/dist/contracts/backend-advisor.d.ts +225 -0
- package/dist/contracts/backend-advisor.js +14 -0
- package/dist/contracts/backend-advisor.js.map +1 -0
- package/dist/contracts/control-api.d.ts +7 -1
- package/dist/contracts/control-api.js +7 -1
- package/dist/contracts/control-api.js.map +1 -1
- package/dist/contracts/decision.d.ts +394 -0
- package/dist/contracts/decision.js +69 -0
- package/dist/contracts/decision.js.map +1 -0
- package/dist/contracts/diffusion.d.ts +62 -9
- package/dist/contracts/embedding.d.ts +103 -0
- package/dist/contracts/embedding.js +24 -0
- package/dist/contracts/embedding.js.map +1 -0
- package/dist/contracts/engine-builds.d.ts +108 -0
- package/dist/contracts/engine-builds.js +11 -0
- package/dist/contracts/engine-builds.js.map +1 -0
- package/dist/contracts/engines.d.ts +157 -0
- package/dist/contracts/engines.js +50 -0
- package/dist/contracts/engines.js.map +1 -0
- package/dist/contracts/environment.d.ts +774 -0
- package/dist/contracts/environment.js +116 -0
- package/dist/contracts/environment.js.map +1 -0
- package/dist/contracts/errors.d.ts +43 -2
- package/dist/contracts/errors.js +41 -0
- package/dist/contracts/errors.js.map +1 -1
- package/dist/contracts/events.d.ts +82 -4
- package/dist/contracts/hardware.d.ts +79 -6
- package/dist/contracts/hardware.js +9 -5
- package/dist/contracts/hardware.js.map +1 -1
- package/dist/contracts/index.d.ts +8 -0
- package/dist/contracts/index.js +8 -0
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/model-compatibility.d.ts +97 -0
- package/dist/contracts/model-compatibility.js +6 -0
- package/dist/contracts/model-compatibility.js.map +1 -0
- package/dist/contracts/model-setup.d.ts +115 -0
- package/dist/contracts/model-setup.js +33 -0
- package/dist/contracts/model-setup.js.map +1 -0
- package/dist/contracts/model-yml.d.ts +14 -0
- package/dist/contracts/model-yml.js +1 -0
- package/dist/contracts/model-yml.js.map +1 -1
- package/dist/contracts/session.d.ts +45 -2
- package/dist/contracts/session.js +14 -1
- package/dist/contracts/session.js.map +1 -1
- package/dist/contracts/settings.d.ts +44 -1
- package/dist/contracts/settings.js.map +1 -1
- package/dist/core/atomic-core.d.ts +44 -5
- package/dist/core/atomic-core.js +24 -0
- package/dist/core/atomic-core.js.map +1 -1
- package/dist/core/create.js +517 -23
- package/dist/core/create.js.map +1 -1
- package/dist/core/gpu/index.d.ts +6 -0
- package/dist/core/gpu/index.js +7 -0
- package/dist/core/gpu/index.js.map +1 -0
- package/dist/core/gpu/policy.d.ts +68 -0
- package/dist/core/gpu/policy.js +99 -0
- package/dist/core/gpu/policy.js.map +1 -0
- package/dist/core/gpu/residency.d.ts +44 -0
- package/dist/core/gpu/residency.js +101 -0
- package/dist/core/gpu/residency.js.map +1 -0
- package/dist/core/gpu-residency.d.ts +39 -0
- package/dist/core/gpu-residency.js +32 -0
- package/dist/core/gpu-residency.js.map +1 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/managed-engines.d.ts +207 -0
- package/dist/core/managed-engines.js +579 -0
- package/dist/core/managed-engines.js.map +1 -0
- package/dist/core/managed-environment.d.ts +72 -0
- package/dist/core/managed-environment.js +218 -0
- package/dist/core/managed-environment.js.map +1 -0
- package/dist/core/model-setup/index.d.ts +4 -0
- package/dist/core/model-setup/index.js +5 -0
- package/dist/core/model-setup/index.js.map +1 -0
- package/dist/core/model-setup/plan.d.ts +56 -0
- package/dist/core/model-setup/plan.js +158 -0
- package/dist/core/model-setup/plan.js.map +1 -0
- package/dist/core/model-setup/service.d.ts +92 -0
- package/dist/core/model-setup/service.js +329 -0
- package/dist/core/model-setup/service.js.map +1 -0
- package/dist/core/model-setup/store.d.ts +29 -0
- package/dist/core/model-setup/store.js +116 -0
- package/dist/core/model-setup/store.js.map +1 -0
- package/dist/core/model-setup/wiring.d.ts +59 -0
- package/dist/core/model-setup/wiring.js +132 -0
- package/dist/core/model-setup/wiring.js.map +1 -0
- package/dist/core/prism.d.ts +36 -0
- package/dist/core/prism.js +42 -0
- package/dist/core/prism.js.map +1 -0
- package/dist/core/public-server.d.ts +7 -0
- package/dist/core/public-server.js +2 -0
- package/dist/core/public-server.js.map +1 -1
- package/dist/core/sessions.d.ts +6 -1
- package/dist/core/sessions.js +18 -14
- package/dist/core/sessions.js.map +1 -1
- package/dist/core/types.d.ts +27 -1
- package/dist/core/types.js.map +1 -1
- package/dist/decision/args.d.ts +110 -0
- package/dist/decision/args.js +126 -0
- package/dist/decision/args.js.map +1 -0
- package/dist/decision/backoff.d.ts +25 -0
- package/dist/decision/backoff.js +33 -0
- package/dist/decision/backoff.js.map +1 -0
- package/dist/decision/engine-candidates.d.ts +52 -0
- package/dist/decision/engine-candidates.js +138 -0
- package/dist/decision/engine-candidates.js.map +1 -0
- package/dist/decision/engine-fallback.d.ts +41 -0
- package/dist/decision/engine-fallback.js +57 -0
- package/dist/decision/engine-fallback.js.map +1 -0
- package/dist/decision/engine-version.d.ts +27 -0
- package/dist/decision/engine-version.js +54 -0
- package/dist/decision/engine-version.js.map +1 -0
- package/dist/decision/engine.d.ts +114 -0
- package/dist/decision/engine.js +253 -0
- package/dist/decision/engine.js.map +1 -0
- package/dist/decision/http.d.ts +36 -0
- package/dist/decision/http.js +73 -0
- package/dist/decision/http.js.map +1 -0
- package/dist/decision/index.d.ts +20 -0
- package/dist/decision/index.js +21 -0
- package/dist/decision/index.js.map +1 -0
- package/dist/decision/model-facts.d.ts +32 -0
- package/dist/decision/model-facts.js +40 -0
- package/dist/decision/model-facts.js.map +1 -0
- package/dist/decision/outcome.d.ts +35 -0
- package/dist/decision/outcome.js +105 -0
- package/dist/decision/outcome.js.map +1 -0
- package/dist/decision/process.d.ts +67 -0
- package/dist/decision/process.js +133 -0
- package/dist/decision/process.js.map +1 -0
- package/dist/decision/readiness.d.ts +74 -0
- package/dist/decision/readiness.js +165 -0
- package/dist/decision/readiness.js.map +1 -0
- package/dist/decision/request.d.ts +11 -0
- package/dist/decision/request.js +56 -0
- package/dist/decision/request.js.map +1 -0
- package/dist/decision/service.d.ts +202 -0
- package/dist/decision/service.js +711 -0
- package/dist/decision/service.js.map +1 -0
- package/dist/decision/upstream-version.d.ts +23 -0
- package/dist/decision/upstream-version.js +34 -0
- package/dist/decision/upstream-version.js.map +1 -0
- package/dist/decision/wiring.d.ts +67 -0
- package/dist/decision/wiring.js +101 -0
- package/dist/decision/wiring.js.map +1 -0
- package/dist/diffusion/args.d.ts +4 -2
- package/dist/diffusion/args.js +10 -3
- package/dist/diffusion/args.js.map +1 -1
- package/dist/diffusion/image-job.js +1 -1
- package/dist/diffusion/image-job.js.map +1 -1
- package/dist/diffusion/install.d.ts +35 -11
- package/dist/diffusion/install.js +74 -49
- package/dist/diffusion/install.js.map +1 -1
- package/dist/diffusion/job-kind.d.ts +33 -7
- package/dist/diffusion/jobs.d.ts +6 -1
- package/dist/diffusion/jobs.js +60 -18
- package/dist/diffusion/jobs.js.map +1 -1
- package/dist/diffusion/parse.d.ts +1 -2
- package/dist/diffusion/parse.js +1 -13
- package/dist/diffusion/parse.js.map +1 -1
- package/dist/diffusion/progress.js +3 -0
- package/dist/diffusion/progress.js.map +1 -1
- package/dist/diffusion/server-process.d.ts +6 -0
- package/dist/diffusion/server-process.js +3 -2
- package/dist/diffusion/server-process.js.map +1 -1
- package/dist/diffusion/service.d.ts +52 -6
- package/dist/diffusion/service.js +215 -40
- package/dist/diffusion/service.js.map +1 -1
- package/dist/diffusion/session.d.ts +27 -3
- package/dist/diffusion/session.js +108 -17
- package/dist/diffusion/session.js.map +1 -1
- package/dist/diffusion/state.d.ts +19 -1
- package/dist/diffusion/state.js +10 -0
- package/dist/diffusion/state.js.map +1 -1
- package/dist/diffusion/tracker.d.ts +15 -1
- package/dist/diffusion/tracker.js +32 -6
- package/dist/diffusion/tracker.js.map +1 -1
- package/dist/diffusion/types.d.ts +7 -0
- package/dist/diffusion/types.js +11 -0
- package/dist/diffusion/types.js.map +1 -1
- package/dist/diffusion/video-estimate.d.ts +214 -0
- package/dist/diffusion/video-estimate.js +402 -0
- package/dist/diffusion/video-estimate.js.map +1 -0
- package/dist/diffusion/video-eta.d.ts +90 -0
- package/dist/diffusion/video-eta.js +248 -0
- package/dist/diffusion/video-eta.js.map +1 -0
- package/dist/diffusion/video-history.d.ts +45 -0
- package/dist/diffusion/video-history.js +121 -0
- package/dist/diffusion/video-history.js.map +1 -0
- package/dist/diffusion/video-job.d.ts +13 -5
- package/dist/diffusion/video-job.js +42 -15
- package/dist/diffusion/video-job.js.map +1 -1
- package/dist/diffusion/video-recipe.js +3 -0
- package/dist/diffusion/video-recipe.js.map +1 -1
- package/dist/diffusion/video-tiling.d.ts +54 -0
- package/dist/diffusion/video-tiling.js +70 -0
- package/dist/diffusion/video-tiling.js.map +1 -0
- package/dist/diffusion/wiring.d.ts +14 -1
- package/dist/diffusion/wiring.js +7 -0
- package/dist/diffusion/wiring.js.map +1 -1
- package/dist/downloads/protocol.d.ts +3 -8
- package/dist/downloads/protocol.js.map +1 -1
- package/dist/embedding/args.d.ts +39 -0
- package/dist/embedding/args.js +46 -0
- package/dist/embedding/args.js.map +1 -0
- package/dist/embedding/engine.d.ts +50 -0
- package/dist/embedding/engine.js +100 -0
- package/dist/embedding/engine.js.map +1 -0
- package/dist/embedding/ffmpeg.d.ts +18 -0
- package/dist/embedding/ffmpeg.js +63 -0
- package/dist/embedding/ffmpeg.js.map +1 -0
- package/dist/embedding/index.d.ts +16 -0
- package/dist/embedding/index.js +17 -0
- package/dist/embedding/index.js.map +1 -0
- package/dist/embedding/model-facts.d.ts +51 -0
- package/dist/embedding/model-facts.js +84 -0
- package/dist/embedding/model-facts.js.map +1 -0
- package/dist/embedding/process.d.ts +66 -0
- package/dist/embedding/process.js +131 -0
- package/dist/embedding/process.js.map +1 -0
- package/dist/embedding/readiness.d.ts +56 -0
- package/dist/embedding/readiness.js +114 -0
- package/dist/embedding/readiness.js.map +1 -0
- package/dist/embedding/request.d.ts +43 -0
- package/dist/embedding/request.js +285 -0
- package/dist/embedding/request.js.map +1 -0
- package/dist/embedding/service.d.ts +152 -0
- package/dist/embedding/service.js +602 -0
- package/dist/embedding/service.js.map +1 -0
- package/dist/embedding/wiring.d.ts +51 -0
- package/dist/embedding/wiring.js +79 -0
- package/dist/embedding/wiring.js.map +1 -0
- package/dist/engine-builds/builds.d.ts +54 -0
- package/dist/engine-builds/builds.js +151 -0
- package/dist/engine-builds/builds.js.map +1 -0
- package/dist/engine-builds/index.d.ts +10 -0
- package/dist/engine-builds/index.js +11 -0
- package/dist/engine-builds/index.js.map +1 -0
- package/dist/engine-builds/install.d.ts +42 -0
- package/dist/engine-builds/install.js +100 -0
- package/dist/engine-builds/install.js.map +1 -0
- package/dist/engine-builds/manifest.d.ts +121 -0
- package/dist/engine-builds/manifest.js +254 -0
- package/dist/engine-builds/manifest.js.map +1 -0
- package/dist/engine-builds/order.d.ts +24 -0
- package/dist/engine-builds/order.js +44 -0
- package/dist/engine-builds/order.js.map +1 -0
- package/dist/engine-builds/select.d.ts +123 -0
- package/dist/engine-builds/select.js +223 -0
- package/dist/engine-builds/select.js.map +1 -0
- package/dist/engine-builds/service.d.ts +123 -0
- package/dist/engine-builds/service.js +392 -0
- package/dist/engine-builds/service.js.map +1 -0
- package/dist/engines/descriptor-order.d.ts +28 -0
- package/dist/engines/descriptor-order.js +60 -0
- package/dist/engines/descriptor-order.js.map +1 -0
- package/dist/engines/engine-build.d.ts +23 -0
- package/dist/engines/engine-build.js +58 -0
- package/dist/engines/engine-build.js.map +1 -0
- package/dist/engines/index.d.ts +10 -0
- package/dist/engines/index.js +11 -0
- package/dist/engines/index.js.map +1 -0
- package/dist/engines/llamacpp.d.ts +71 -0
- package/dist/engines/llamacpp.js +176 -0
- package/dist/engines/llamacpp.js.map +1 -0
- package/dist/engines/managed.d.ts +49 -0
- package/dist/engines/managed.js +88 -0
- package/dist/engines/managed.js.map +1 -0
- package/dist/engines/service.d.ts +46 -0
- package/dist/engines/service.js +61 -0
- package/dist/engines/service.js.map +1 -0
- package/dist/engines/versions.d.ts +65 -0
- package/dist/engines/versions.js +259 -0
- package/dist/engines/versions.js.map +1 -0
- package/dist/hardware/cpu-flags.d.ts +44 -0
- package/dist/hardware/cpu-flags.js +206 -0
- package/dist/hardware/cpu-flags.js.map +1 -0
- package/dist/hardware/drm-sysfs.d.ts +51 -0
- package/dist/hardware/drm-sysfs.js +67 -0
- package/dist/hardware/drm-sysfs.js.map +1 -0
- package/dist/hardware/facts.d.ts +42 -0
- package/dist/hardware/facts.js +92 -0
- package/dist/hardware/facts.js.map +1 -0
- package/dist/hardware/index.d.ts +19 -3
- package/dist/hardware/index.js +19 -3
- package/dist/hardware/index.js.map +1 -1
- package/dist/hardware/merge.d.ts +55 -0
- package/dist/hardware/merge.js +141 -0
- package/dist/hardware/merge.js.map +1 -0
- package/dist/hardware/nvidia-smi.d.ts +43 -0
- package/dist/hardware/nvidia-smi.js +118 -0
- package/dist/hardware/nvidia-smi.js.map +1 -0
- package/dist/hardware/probe-common.d.ts +72 -0
- package/dist/hardware/probe-common.js +106 -0
- package/dist/hardware/probe-common.js.map +1 -0
- package/dist/hardware/probe-darwin.d.ts +20 -0
- package/dist/hardware/probe-darwin.js +76 -0
- package/dist/hardware/probe-darwin.js.map +1 -0
- package/dist/hardware/probe-linux.d.ts +9 -0
- package/dist/hardware/probe-linux.js +133 -0
- package/dist/hardware/probe-linux.js.map +1 -0
- package/dist/hardware/probe-windows.d.ts +7 -0
- package/dist/hardware/probe-windows.js +50 -0
- package/dist/hardware/probe-windows.js.map +1 -0
- package/dist/hardware/probe.d.ts +16 -0
- package/dist/hardware/probe.js +65 -0
- package/dist/hardware/probe.js.map +1 -0
- package/dist/hardware/service.d.ts +60 -0
- package/dist/hardware/service.js +114 -0
- package/dist/hardware/service.js.map +1 -0
- package/dist/hardware/vulkan.d.ts +47 -0
- package/dist/hardware/vulkan.js +148 -0
- package/dist/hardware/vulkan.js.map +1 -0
- package/dist/hardware/windows-video.d.ts +97 -0
- package/dist/hardware/windows-video.js +214 -0
- package/dist/hardware/windows-video.js.map +1 -0
- package/dist/host/app-daemon.d.ts +47 -0
- package/dist/host/app-daemon.js +146 -0
- package/dist/host/app-daemon.js.map +1 -0
- package/dist/host/index.d.ts +5 -3
- package/dist/host/index.js +5 -3
- package/dist/host/index.js.map +1 -1
- package/dist/host/log-file.d.ts +74 -0
- package/dist/host/log-file.js +214 -0
- package/dist/host/log-file.js.map +1 -0
- package/dist/host/recipes/enable-wsl.d.ts +63 -0
- package/dist/host/recipes/enable-wsl.js +73 -0
- package/dist/host/recipes/enable-wsl.js.map +1 -0
- package/dist/host/recipes/executor-io-windows.d.ts +69 -0
- package/dist/host/recipes/executor-io-windows.js +235 -0
- package/dist/host/recipes/executor-io-windows.js.map +1 -0
- package/dist/host/recipes/executor-io.d.ts +80 -0
- package/dist/host/recipes/executor-io.js +211 -0
- package/dist/host/recipes/executor-io.js.map +1 -0
- package/dist/host/recipes/executor.d.ts +81 -0
- package/dist/host/recipes/executor.js +678 -0
- package/dist/host/recipes/executor.js.map +1 -0
- package/dist/host/recipes/guest-executor.d.ts +29 -0
- package/dist/host/recipes/guest-executor.js +76 -0
- package/dist/host/recipes/guest-executor.js.map +1 -0
- package/dist/host/recipes/index.d.ts +16 -0
- package/dist/host/recipes/index.js +17 -0
- package/dist/host/recipes/index.js.map +1 -0
- package/dist/host/recipes/install-container-runtime.d.ts +389 -0
- package/dist/host/recipes/install-container-runtime.js +796 -0
- package/dist/host/recipes/install-container-runtime.js.map +1 -0
- package/dist/host/recipes/openpgp.d.ts +23 -0
- package/dist/host/recipes/openpgp.js +153 -0
- package/dist/host/recipes/openpgp.js.map +1 -0
- package/dist/host/recipes/request-file.d.ts +96 -0
- package/dist/host/recipes/request-file.js +103 -0
- package/dist/host/recipes/request-file.js.map +1 -0
- package/dist/lock/process-journal.d.ts +5 -2
- package/dist/lock/process-journal.js.map +1 -1
- package/dist/models/capabilities.d.ts +7 -0
- package/dist/models/capabilities.js +17 -1
- package/dist/models/capabilities.js.map +1 -1
- package/dist/models/compatibility/index.d.ts +10 -0
- package/dist/models/compatibility/index.js +11 -0
- package/dist/models/compatibility/index.js.map +1 -0
- package/dist/models/compatibility/inspect.d.ts +19 -0
- package/dist/models/compatibility/inspect.js +59 -0
- package/dist/models/compatibility/inspect.js.map +1 -0
- package/dist/models/compatibility/resolve.d.ts +59 -0
- package/dist/models/compatibility/resolve.js +219 -0
- package/dist/models/compatibility/resolve.js.map +1 -0
- package/dist/models/compatibility/rules-baseline.d.ts +2 -0
- package/dist/models/compatibility/rules-baseline.js +10 -0
- package/dist/models/compatibility/rules-baseline.js.map +1 -0
- package/dist/models/compatibility/rules-baseline.json +292 -0
- package/dist/models/compatibility/rules-service.d.ts +36 -0
- package/dist/models/compatibility/rules-service.js +109 -0
- package/dist/models/compatibility/rules-service.js.map +1 -0
- package/dist/models/compatibility/rules.d.ts +81 -0
- package/dist/models/compatibility/rules.js +164 -0
- package/dist/models/compatibility/rules.js.map +1 -0
- package/dist/models/compatibility/service.d.ts +59 -0
- package/dist/models/compatibility/service.js +137 -0
- package/dist/models/compatibility/service.js.map +1 -0
- package/dist/models/decision-checkpoint.d.ts +22 -0
- package/dist/models/decision-checkpoint.js +33 -0
- package/dist/models/decision-checkpoint.js.map +1 -0
- package/dist/models/gguf/classify.d.ts +27 -1
- package/dist/models/gguf/classify.js +78 -2
- package/dist/models/gguf/classify.js.map +1 -1
- package/dist/models/gguf/index.d.ts +1 -0
- package/dist/models/gguf/index.js +1 -0
- package/dist/models/gguf/index.js.map +1 -1
- package/dist/models/gguf/tensors.d.ts +56 -0
- package/dist/models/gguf/tensors.js +236 -0
- package/dist/models/gguf/tensors.js.map +1 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/models/index.js.map +1 -1
- package/dist/router/resolve.d.ts +7 -1
- package/dist/router/resolve.js +14 -1
- package/dist/router/resolve.js.map +1 -1
- package/dist/runtime/container/argv.d.ts +88 -0
- package/dist/runtime/container/argv.js +406 -0
- package/dist/runtime/container/argv.js.map +1 -0
- package/dist/runtime/container/docker-binary.d.ts +4 -0
- package/dist/runtime/container/docker-binary.js +34 -0
- package/dist/runtime/container/docker-binary.js.map +1 -0
- package/dist/runtime/container/env.d.ts +17 -0
- package/dist/runtime/container/env.js +52 -0
- package/dist/runtime/container/env.js.map +1 -0
- package/dist/runtime/container/exec.d.ts +27 -0
- package/dist/runtime/container/exec.js +79 -0
- package/dist/runtime/container/exec.js.map +1 -0
- package/dist/runtime/container/execution-journal.d.ts +55 -0
- package/dist/runtime/container/execution-journal.js +167 -0
- package/dist/runtime/container/execution-journal.js.map +1 -0
- package/dist/runtime/container/heartbeat.d.ts +47 -0
- package/dist/runtime/container/heartbeat.js +78 -0
- package/dist/runtime/container/heartbeat.js.map +1 -0
- package/dist/runtime/container/index.d.ts +30 -0
- package/dist/runtime/container/index.js +31 -0
- package/dist/runtime/container/index.js.map +1 -0
- package/dist/runtime/container/operations.d.ts +40 -0
- package/dist/runtime/container/operations.js +233 -0
- package/dist/runtime/container/operations.js.map +1 -0
- package/dist/runtime/container/pull.d.ts +48 -0
- package/dist/runtime/container/pull.js +280 -0
- package/dist/runtime/container/pull.js.map +1 -0
- package/dist/runtime/container/reconcile.d.ts +34 -0
- package/dist/runtime/container/reconcile.js +79 -0
- package/dist/runtime/container/reconcile.js.map +1 -0
- package/dist/runtime/container/types.d.ts +124 -0
- package/dist/runtime/container/types.js +2 -0
- package/dist/runtime/container/types.js.map +1 -0
- package/dist/runtime/container/watchdog.d.ts +114 -0
- package/dist/runtime/container/watchdog.js +418 -0
- package/dist/runtime/container/watchdog.js.map +1 -0
- package/dist/runtime/container/wiring.d.ts +78 -0
- package/dist/runtime/container/wiring.js +92 -0
- package/dist/runtime/container/wiring.js.map +1 -0
- package/dist/runtime/container/wsl-exec.d.ts +13 -0
- package/dist/runtime/container/wsl-exec.js +18 -0
- package/dist/runtime/container/wsl-exec.js.map +1 -0
- package/dist/runtime/environment/cached-document.d.ts +128 -0
- package/dist/runtime/environment/cached-document.js +218 -0
- package/dist/runtime/environment/cached-document.js.map +1 -0
- package/dist/runtime/environment/canonical-json.d.ts +78 -0
- package/dist/runtime/environment/canonical-json.js +86 -0
- package/dist/runtime/environment/canonical-json.js.map +1 -0
- package/dist/runtime/environment/descriptor-provider.d.ts +121 -0
- package/dist/runtime/environment/descriptor-provider.js +159 -0
- package/dist/runtime/environment/descriptor-provider.js.map +1 -0
- package/dist/runtime/environment/descriptor.d.ts +35 -0
- package/dist/runtime/environment/descriptor.js +239 -0
- package/dist/runtime/environment/descriptor.js.map +1 -0
- package/dist/runtime/environment/diagnostics.d.ts +50 -0
- package/dist/runtime/environment/diagnostics.js +114 -0
- package/dist/runtime/environment/diagnostics.js.map +1 -0
- package/dist/runtime/environment/document-fields.d.ts +39 -0
- package/dist/runtime/environment/document-fields.js +96 -0
- package/dist/runtime/environment/document-fields.js.map +1 -0
- package/dist/runtime/environment/environment-manifest-provider.d.ts +65 -0
- package/dist/runtime/environment/environment-manifest-provider.js +89 -0
- package/dist/runtime/environment/environment-manifest-provider.js.map +1 -0
- package/dist/runtime/environment/environment-manifest.d.ts +35 -0
- package/dist/runtime/environment/environment-manifest.js +131 -0
- package/dist/runtime/environment/environment-manifest.js.map +1 -0
- package/dist/runtime/environment/guest-host.d.ts +43 -0
- package/dist/runtime/environment/guest-host.js +88 -0
- package/dist/runtime/environment/guest-host.js.map +1 -0
- package/dist/runtime/environment/host-exec.d.ts +38 -0
- package/dist/runtime/environment/host-exec.js +145 -0
- package/dist/runtime/environment/host-exec.js.map +1 -0
- package/dist/runtime/environment/host-step-failure.d.ts +33 -0
- package/dist/runtime/environment/host-step-failure.js +34 -0
- package/dist/runtime/environment/host-step-failure.js.map +1 -0
- package/dist/runtime/environment/index.d.ts +56 -0
- package/dist/runtime/environment/index.js +57 -0
- package/dist/runtime/environment/index.js.map +1 -0
- package/dist/runtime/environment/installations.d.ts +25 -0
- package/dist/runtime/environment/installations.js +70 -0
- package/dist/runtime/environment/installations.js.map +1 -0
- package/dist/runtime/environment/inventory.d.ts +42 -0
- package/dist/runtime/environment/inventory.js +57 -0
- package/dist/runtime/environment/inventory.js.map +1 -0
- package/dist/runtime/environment/linux-blockers.d.ts +130 -0
- package/dist/runtime/environment/linux-blockers.js +251 -0
- package/dist/runtime/environment/linux-blockers.js.map +1 -0
- package/dist/runtime/environment/linux-docker-facts.d.ts +200 -0
- package/dist/runtime/environment/linux-docker-facts.js +342 -0
- package/dist/runtime/environment/linux-docker-facts.js.map +1 -0
- package/dist/runtime/environment/linux-docker-network.d.ts +80 -0
- package/dist/runtime/environment/linux-docker-network.js +195 -0
- package/dist/runtime/environment/linux-docker-network.js.map +1 -0
- package/dist/runtime/environment/linux-host.d.ts +22 -0
- package/dist/runtime/environment/linux-host.js +98 -0
- package/dist/runtime/environment/linux-host.js.map +1 -0
- package/dist/runtime/environment/linux-plan.d.ts +126 -0
- package/dist/runtime/environment/linux-plan.js +392 -0
- package/dist/runtime/environment/linux-plan.js.map +1 -0
- package/dist/runtime/environment/linux-probe.d.ts +245 -0
- package/dist/runtime/environment/linux-probe.js +315 -0
- package/dist/runtime/environment/linux-probe.js.map +1 -0
- package/dist/runtime/environment/linux-provisioner.d.ts +102 -0
- package/dist/runtime/environment/linux-provisioner.js +734 -0
- package/dist/runtime/environment/linux-provisioner.js.map +1 -0
- package/dist/runtime/environment/provisioner-descriptors.d.ts +17 -0
- package/dist/runtime/environment/provisioner-descriptors.js +62 -0
- package/dist/runtime/environment/provisioner-descriptors.js.map +1 -0
- package/dist/runtime/environment/recovery.d.ts +74 -0
- package/dist/runtime/environment/recovery.js +121 -0
- package/dist/runtime/environment/recovery.js.map +1 -0
- package/dist/runtime/environment/rootfs-download.d.ts +2 -0
- package/dist/runtime/environment/rootfs-download.js +47 -0
- package/dist/runtime/environment/rootfs-download.js.map +1 -0
- package/dist/runtime/environment/service.d.ts +280 -0
- package/dist/runtime/environment/service.js +776 -0
- package/dist/runtime/environment/service.js.map +1 -0
- package/dist/runtime/environment/state.d.ts +163 -0
- package/dist/runtime/environment/state.js +479 -0
- package/dist/runtime/environment/state.js.map +1 -0
- package/dist/runtime/environment/store-models.d.ts +19 -0
- package/dist/runtime/environment/store-models.js +30 -0
- package/dist/runtime/environment/store-models.js.map +1 -0
- package/dist/runtime/environment/store.d.ts +210 -0
- package/dist/runtime/environment/store.js +438 -0
- package/dist/runtime/environment/store.js.map +1 -0
- package/dist/runtime/environment/windows-environment-record.d.ts +48 -0
- package/dist/runtime/environment/windows-environment-record.js +89 -0
- package/dist/runtime/environment/windows-environment-record.js.map +1 -0
- package/dist/runtime/environment/windows-forwarding.d.ts +27 -0
- package/dist/runtime/environment/windows-forwarding.js +84 -0
- package/dist/runtime/environment/windows-forwarding.js.map +1 -0
- package/dist/runtime/environment/windows-guest-setup.d.ts +48 -0
- package/dist/runtime/environment/windows-guest-setup.js +157 -0
- package/dist/runtime/environment/windows-guest-setup.js.map +1 -0
- package/dist/runtime/environment/windows-host.d.ts +46 -0
- package/dist/runtime/environment/windows-host.js +163 -0
- package/dist/runtime/environment/windows-host.js.map +1 -0
- package/dist/runtime/environment/windows-plan.d.ts +78 -0
- package/dist/runtime/environment/windows-plan.js +216 -0
- package/dist/runtime/environment/windows-plan.js.map +1 -0
- package/dist/runtime/environment/windows-probe.d.ts +135 -0
- package/dist/runtime/environment/windows-probe.js +261 -0
- package/dist/runtime/environment/windows-probe.js.map +1 -0
- package/dist/runtime/environment/windows-provisioner.d.ts +113 -0
- package/dist/runtime/environment/windows-provisioner.js +782 -0
- package/dist/runtime/environment/windows-provisioner.js.map +1 -0
- package/dist/runtime/environment/wiring.d.ts +117 -0
- package/dist/runtime/environment/wiring.js +354 -0
- package/dist/runtime/environment/wiring.js.map +1 -0
- package/dist/runtime/foundation-models/runtime.d.ts +8 -0
- package/dist/runtime/foundation-models/runtime.js +5 -2
- package/dist/runtime/foundation-models/runtime.js.map +1 -1
- package/dist/runtime/llamacpp/args.d.ts +10 -1
- package/dist/runtime/llamacpp/args.js +43 -7
- package/dist/runtime/llamacpp/args.js.map +1 -1
- package/dist/runtime/llamacpp/fit-margin.d.ts +46 -0
- package/dist/runtime/llamacpp/fit-margin.js +47 -0
- package/dist/runtime/llamacpp/fit-margin.js.map +1 -0
- package/dist/runtime/llamacpp/index.d.ts +1 -0
- package/dist/runtime/llamacpp/index.js +1 -0
- package/dist/runtime/llamacpp/index.js.map +1 -1
- package/dist/runtime/llamacpp/load-plan.d.ts +23 -1
- package/dist/runtime/llamacpp/load-plan.js +82 -1
- package/dist/runtime/llamacpp/load-plan.js.map +1 -1
- package/dist/runtime/llamacpp/policy.d.ts +16 -0
- package/dist/runtime/llamacpp/policy.js +20 -0
- package/dist/runtime/llamacpp/policy.js.map +1 -1
- package/dist/runtime/llamacpp/probe.d.ts +21 -1
- package/dist/runtime/llamacpp/probe.js +32 -6
- package/dist/runtime/llamacpp/probe.js.map +1 -1
- package/dist/runtime/llamacpp/runtime.d.ts +56 -1
- package/dist/runtime/llamacpp/runtime.js +142 -15
- package/dist/runtime/llamacpp/runtime.js.map +1 -1
- package/dist/runtime/managed-engines/index.d.ts +8 -0
- package/dist/runtime/managed-engines/index.js +9 -0
- package/dist/runtime/managed-engines/index.js.map +1 -0
- package/dist/runtime/managed-engines/runtime.d.ts +140 -0
- package/dist/runtime/managed-engines/runtime.js +402 -0
- package/dist/runtime/managed-engines/runtime.js.map +1 -0
- package/dist/runtime/managed-engines/spec.d.ts +70 -0
- package/dist/runtime/managed-engines/spec.js +39 -0
- package/dist/runtime/managed-engines/spec.js.map +1 -0
- package/dist/runtime/managed-models/check.d.ts +50 -0
- package/dist/runtime/managed-models/check.js +157 -0
- package/dist/runtime/managed-models/check.js.map +1 -0
- package/dist/runtime/managed-models/compatibility.d.ts +256 -0
- package/dist/runtime/managed-models/compatibility.js +594 -0
- package/dist/runtime/managed-models/compatibility.js.map +1 -0
- package/dist/runtime/managed-models/delete.d.ts +15 -0
- package/dist/runtime/managed-models/delete.js +60 -0
- package/dist/runtime/managed-models/delete.js.map +1 -0
- package/dist/runtime/managed-models/guest-files.d.ts +8 -0
- package/dist/runtime/managed-models/guest-files.js +49 -0
- package/dist/runtime/managed-models/guest-files.js.map +1 -0
- package/dist/runtime/managed-models/index.d.ts +17 -0
- package/dist/runtime/managed-models/index.js +18 -0
- package/dist/runtime/managed-models/index.js.map +1 -0
- package/dist/runtime/managed-models/location.d.ts +22 -0
- package/dist/runtime/managed-models/location.js +53 -0
- package/dist/runtime/managed-models/location.js.map +1 -0
- package/dist/runtime/managed-models/migrate.d.ts +30 -0
- package/dist/runtime/managed-models/migrate.js +119 -0
- package/dist/runtime/managed-models/migrate.js.map +1 -0
- package/dist/runtime/managed-models/model-dir.d.ts +36 -0
- package/dist/runtime/managed-models/model-dir.js +136 -0
- package/dist/runtime/managed-models/model-dir.js.map +1 -0
- package/dist/runtime/managed-models/quant-format.d.ts +71 -0
- package/dist/runtime/managed-models/quant-format.js +299 -0
- package/dist/runtime/managed-models/quant-format.js.map +1 -0
- package/dist/runtime/managed-models/registry.d.ts +26 -0
- package/dist/runtime/managed-models/registry.js +66 -0
- package/dist/runtime/managed-models/registry.js.map +1 -0
- package/dist/runtime/managed-text/adapter.d.ts +266 -0
- package/dist/runtime/managed-text/adapter.js +96 -0
- package/dist/runtime/managed-text/adapter.js.map +1 -0
- package/dist/runtime/managed-text/backend-target.d.ts +3 -0
- package/dist/runtime/managed-text/backend-target.js +52 -0
- package/dist/runtime/managed-text/backend-target.js.map +1 -0
- package/dist/runtime/managed-text/deployment.d.ts +14 -0
- package/dist/runtime/managed-text/deployment.js +32 -0
- package/dist/runtime/managed-text/deployment.js.map +1 -0
- package/dist/runtime/managed-text/engine-cache.d.ts +15 -0
- package/dist/runtime/managed-text/engine-cache.js +64 -0
- package/dist/runtime/managed-text/engine-cache.js.map +1 -0
- package/dist/runtime/managed-text/gateway.d.ts +158 -0
- package/dist/runtime/managed-text/gateway.js +535 -0
- package/dist/runtime/managed-text/gateway.js.map +1 -0
- package/dist/runtime/managed-text/generation-defaults.d.ts +23 -0
- package/dist/runtime/managed-text/generation-defaults.js +51 -0
- package/dist/runtime/managed-text/generation-defaults.js.map +1 -0
- package/dist/runtime/managed-text/index.d.ts +26 -0
- package/dist/runtime/managed-text/index.js +27 -0
- package/dist/runtime/managed-text/index.js.map +1 -0
- package/dist/runtime/managed-text/lifecycle.d.ts +276 -0
- package/dist/runtime/managed-text/lifecycle.js +859 -0
- package/dist/runtime/managed-text/lifecycle.js.map +1 -0
- package/dist/runtime/managed-text/load-policy.d.ts +47 -0
- package/dist/runtime/managed-text/load-policy.js +111 -0
- package/dist/runtime/managed-text/load-policy.js.map +1 -0
- package/dist/runtime/managed-text/mount-source.d.ts +14 -0
- package/dist/runtime/managed-text/mount-source.js +18 -0
- package/dist/runtime/managed-text/mount-source.js.map +1 -0
- package/dist/runtime/managed-text/readiness.d.ts +13 -0
- package/dist/runtime/managed-text/readiness.js +24 -0
- package/dist/runtime/managed-text/readiness.js.map +1 -0
- package/dist/runtime/managed-text/request-rules.d.ts +18 -0
- package/dist/runtime/managed-text/request-rules.js +62 -0
- package/dist/runtime/managed-text/request-rules.js.map +1 -0
- package/dist/runtime/managed-text/types.d.ts +88 -0
- package/dist/runtime/managed-text/types.js +12 -0
- package/dist/runtime/managed-text/types.js.map +1 -0
- package/dist/runtime/managed-text/wsl-deployment.d.ts +24 -0
- package/dist/runtime/managed-text/wsl-deployment.js +70 -0
- package/dist/runtime/managed-text/wsl-deployment.js.map +1 -0
- package/dist/runtime/mlx/errors.d.ts +6 -1
- package/dist/runtime/mlx/errors.js +7 -2
- package/dist/runtime/mlx/errors.js.map +1 -1
- package/dist/runtime/mlx/runtime.d.ts +36 -1
- package/dist/runtime/mlx/runtime.js +85 -4
- package/dist/runtime/mlx/runtime.js.map +1 -1
- package/dist/runtime/shared/backend-output.d.ts +23 -0
- package/dist/runtime/shared/backend-output.js +32 -0
- package/dist/runtime/shared/backend-output.js.map +1 -0
- package/dist/runtime/shared/bounded-output.d.ts +24 -0
- package/dist/runtime/shared/bounded-output.js +63 -0
- package/dist/runtime/shared/bounded-output.js.map +1 -0
- package/dist/runtime/shared/external-sessions.js +9 -1
- package/dist/runtime/shared/external-sessions.js.map +1 -1
- package/dist/runtime/shared/gpu-occupancy.d.ts +60 -0
- package/dist/runtime/shared/gpu-occupancy.js +10 -0
- package/dist/runtime/shared/gpu-occupancy.js.map +1 -0
- package/dist/runtime/shared/index.d.ts +4 -0
- package/dist/runtime/shared/index.js +4 -0
- package/dist/runtime/shared/index.js.map +1 -1
- package/dist/runtime/shared/local-runtime.d.ts +35 -0
- package/dist/runtime/shared/ports.d.ts +6 -0
- package/dist/runtime/shared/ports.js +12 -1
- package/dist/runtime/shared/ports.js.map +1 -1
- package/dist/runtime/shared/process.d.ts +11 -0
- package/dist/runtime/shared/process.js +20 -0
- package/dist/runtime/shared/process.js.map +1 -1
- package/dist/runtime/shared/redact-args.d.ts +7 -0
- package/dist/runtime/shared/redact-args.js +26 -0
- package/dist/runtime/shared/redact-args.js.map +1 -0
- package/dist/runtime/shared/sidecar.d.ts +15 -0
- package/dist/runtime/shared/sidecar.js +43 -8
- package/dist/runtime/shared/sidecar.js.map +1 -1
- package/dist/runtime/tensorrt-llm/adapter.d.ts +250 -0
- package/dist/runtime/tensorrt-llm/adapter.js +1011 -0
- package/dist/runtime/tensorrt-llm/adapter.js.map +1 -0
- package/dist/runtime/tensorrt-llm/check.d.ts +12 -0
- package/dist/runtime/tensorrt-llm/check.js +21 -0
- package/dist/runtime/tensorrt-llm/check.js.map +1 -0
- package/dist/runtime/tensorrt-llm/compatibility.d.ts +100 -0
- package/dist/runtime/tensorrt-llm/compatibility.js +181 -0
- package/dist/runtime/tensorrt-llm/compatibility.js.map +1 -0
- package/dist/runtime/tensorrt-llm/engine.d.ts +3 -0
- package/dist/runtime/tensorrt-llm/engine.js +24 -0
- package/dist/runtime/tensorrt-llm/engine.js.map +1 -0
- package/dist/runtime/tensorrt-llm/host-facts.d.ts +55 -0
- package/dist/runtime/tensorrt-llm/host-facts.js +87 -0
- package/dist/runtime/tensorrt-llm/host-facts.js.map +1 -0
- package/dist/runtime/tensorrt-llm/index.d.ts +30 -0
- package/dist/runtime/tensorrt-llm/index.js +31 -0
- package/dist/runtime/tensorrt-llm/index.js.map +1 -0
- package/dist/runtime/tensorrt-llm/installation.d.ts +23 -0
- package/dist/runtime/tensorrt-llm/installation.js +53 -0
- package/dist/runtime/tensorrt-llm/installation.js.map +1 -0
- package/dist/runtime/tensorrt-llm/kv-cache.d.ts +25 -0
- package/dist/runtime/tensorrt-llm/kv-cache.js +28 -0
- package/dist/runtime/tensorrt-llm/kv-cache.js.map +1 -0
- package/dist/runtime/tensorrt-llm/prelaunch.d.ts +20 -0
- package/dist/runtime/tensorrt-llm/prelaunch.js +168 -0
- package/dist/runtime/tensorrt-llm/prelaunch.js.map +1 -0
- package/dist/runtime/tensorrt-llm/route-policy.d.ts +19 -0
- package/dist/runtime/tensorrt-llm/route-policy.js +17 -0
- package/dist/runtime/tensorrt-llm/route-policy.js.map +1 -0
- package/dist/runtime/tensorrt-llm/settings.d.ts +7 -0
- package/dist/runtime/tensorrt-llm/settings.js +48 -0
- package/dist/runtime/tensorrt-llm/settings.js.map +1 -0
- package/dist/runtime/vllm/adapter.d.ts +46 -0
- package/dist/runtime/vllm/adapter.js +425 -0
- package/dist/runtime/vllm/adapter.js.map +1 -0
- package/dist/runtime/vllm/engine.d.ts +16 -0
- package/dist/runtime/vllm/engine.js +37 -0
- package/dist/runtime/vllm/engine.js.map +1 -0
- package/dist/runtime/vllm/index.d.ts +11 -0
- package/dist/runtime/vllm/index.js +12 -0
- package/dist/runtime/vllm/index.js.map +1 -0
- package/dist/runtime/vllm/memory.d.ts +69 -0
- package/dist/runtime/vllm/memory.js +123 -0
- package/dist/runtime/vllm/memory.js.map +1 -0
- package/dist/runtime/vllm/settings.d.ts +52 -0
- package/dist/runtime/vllm/settings.js +151 -0
- package/dist/runtime/vllm/settings.js.map +1 -0
- package/dist/runtime/wsl/guest-paths.d.ts +33 -0
- package/dist/runtime/wsl/guest-paths.js +83 -0
- package/dist/runtime/wsl/guest-paths.js.map +1 -0
- package/dist/runtime/wsl/guest-scope.d.ts +14 -0
- package/dist/runtime/wsl/guest-scope.js +98 -0
- package/dist/runtime/wsl/guest-scope.js.map +1 -0
- package/dist/runtime/wsl/index.d.ts +12 -0
- package/dist/runtime/wsl/index.js +13 -0
- package/dist/runtime/wsl/index.js.map +1 -0
- package/dist/runtime/wsl/keeper.d.ts +29 -0
- package/dist/runtime/wsl/keeper.js +48 -0
- package/dist/runtime/wsl/keeper.js.map +1 -0
- package/dist/runtime/wsl/transport.d.ts +106 -0
- package/dist/runtime/wsl/transport.js +181 -0
- package/dist/runtime/wsl/transport.js.map +1 -0
- package/dist/server/control/index.d.ts +1 -1
- package/dist/server/control/router.js +15 -0
- package/dist/server/control/router.js.map +1 -1
- package/dist/server/control/routes/backends.js +26 -0
- package/dist/server/control/routes/backends.js.map +1 -1
- package/dist/server/control/routes/decision.d.ts +10 -0
- package/dist/server/control/routes/decision.js +43 -0
- package/dist/server/control/routes/decision.js.map +1 -0
- package/dist/server/control/routes/diffusion-video.js +4 -0
- package/dist/server/control/routes/diffusion-video.js.map +1 -1
- package/dist/server/control/routes/diffusion.d.ts +1 -1
- package/dist/server/control/routes/diffusion.js +4 -9
- package/dist/server/control/routes/diffusion.js.map +1 -1
- package/dist/server/control/routes/embedding.d.ts +9 -0
- package/dist/server/control/routes/embedding.js +43 -0
- package/dist/server/control/routes/embedding.js.map +1 -0
- package/dist/server/control/routes/engine-builds.d.ts +14 -0
- package/dist/server/control/routes/engine-builds.js +82 -0
- package/dist/server/control/routes/engine-builds.js.map +1 -0
- package/dist/server/control/routes/engines.d.ts +17 -0
- package/dist/server/control/routes/engines.js +152 -0
- package/dist/server/control/routes/engines.js.map +1 -0
- package/dist/server/control/routes/environments.d.ts +16 -0
- package/dist/server/control/routes/environments.js +207 -0
- package/dist/server/control/routes/environments.js.map +1 -0
- package/dist/server/control/routes/hardware.d.ts +1 -1
- package/dist/server/control/routes/hardware.js +11 -6
- package/dist/server/control/routes/hardware.js.map +1 -1
- package/dist/server/control/routes/model-setups.d.ts +11 -0
- package/dist/server/control/routes/model-setups.js +55 -0
- package/dist/server/control/routes/model-setups.js.map +1 -0
- package/dist/server/control/routes/models.d.ts +3 -2
- package/dist/server/control/routes/models.js +45 -2
- package/dist/server/control/routes/models.js.map +1 -1
- package/dist/server/control/types.d.ts +167 -9
- package/dist/server/control/types.js.map +1 -1
- package/dist/server/http.d.ts +9 -1
- package/dist/server/http.js +51 -1
- package/dist/server/http.js.map +1 -1
- package/dist/server/public/decision-preview.d.ts +17 -0
- package/dist/server/public/decision-preview.js +119 -0
- package/dist/server/public/decision-preview.js.map +1 -0
- package/dist/server/public/decision.d.ts +32 -0
- package/dist/server/public/decision.js +135 -0
- package/dist/server/public/decision.js.map +1 -0
- package/dist/server/public/embedding.d.ts +31 -0
- package/dist/server/public/embedding.js +126 -0
- package/dist/server/public/embedding.js.map +1 -0
- package/dist/server/public/errors.d.ts +2 -1
- package/dist/server/public/errors.js +5 -2
- package/dist/server/public/errors.js.map +1 -1
- package/dist/server/public/forward.js +75 -3
- package/dist/server/public/forward.js.map +1 -1
- package/dist/server/public/gates.d.ts +13 -0
- package/dist/server/public/gates.js +37 -14
- package/dist/server/public/gates.js.map +1 -1
- package/dist/server/public/index.d.ts +5 -2
- package/dist/server/public/index.js +14 -1
- package/dist/server/public/index.js.map +1 -1
- package/dist/server/public/listing.d.ts +13 -2
- package/dist/server/public/listing.js +33 -9
- package/dist/server/public/listing.js.map +1 -1
- package/dist/server/public/policy.d.ts +9 -0
- package/dist/server/public/policy.js +68 -0
- package/dist/server/public/policy.js.map +1 -0
- package/dist/server/public/responses.js +10 -0
- package/dist/server/public/responses.js.map +1 -1
- package/dist/server/public/trace.d.ts +2 -2
- package/dist/server/public/trace.js +6 -2
- package/dist/server/public/trace.js.map +1 -1
- package/dist/server/public/types.d.ts +84 -1
- package/dist/settings/decision.d.ts +15 -0
- package/dist/settings/decision.js +88 -0
- package/dist/settings/decision.js.map +1 -0
- package/dist/settings/embedding.d.ts +12 -0
- package/dist/settings/embedding.js +82 -0
- package/dist/settings/embedding.js.map +1 -0
- package/dist/settings/index.d.ts +2 -0
- package/dist/settings/index.js +2 -0
- package/dist/settings/index.js.map +1 -1
- package/dist/settings/schema/atomic-prism.json +433 -0
- package/dist/settings/schema/tensorrt-llm.json +253 -0
- package/dist/settings/schema/vllm.json +273 -0
- package/dist/settings/schema.js +58 -0
- package/dist/settings/schema.js.map +1 -1
- package/dist/settings/store.d.ts +13 -2
- package/dist/settings/store.js +44 -0
- package/dist/settings/store.js.map +1 -1
- package/dist/util/index.d.ts +1 -0
- package/dist/util/index.js +1 -0
- package/dist/util/index.js.map +1 -1
- package/dist/util/result.d.ts +19 -0
- package/dist/util/result.js +15 -0
- package/dist/util/result.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/src/settings/schema/atomic-prism.json +433 -0
- package/src/settings/schema/tensorrt-llm.json +253 -0
- package/src/settings/schema/vllm.json +273 -0
|
@@ -0,0 +1,734 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Linux host recipe behind `EnvironmentService` (task 2.6): what a setup and a removal of a
|
|
3
|
+
* managed engine actually do on a Linux machine with system Docker, one method per effect the
|
|
4
|
+
* reducer (`state.ts`) can ask for.
|
|
5
|
+
*
|
|
6
|
+
* - **probe** reads the machine (`probeLinux`), judges it (`assessLinux`) against the descriptor the
|
|
7
|
+
* operation installs and the environment manifest (which distributions the install recipe is
|
|
8
|
+
* qualified for; change `extract-environment-manifest`), and answers with a plan whose digest binds the consent: the system changes,
|
|
9
|
+
* the GPU set and whether the free space where the image lands suffices (carry item 1). When the plan needs the
|
|
10
|
+
* privileged step, the step carries the recipe's validated parameters and their digest, built by
|
|
11
|
+
* the recipe itself (`HostRecipeBinding`, task 2.5), plus a fresh single-use nonce.
|
|
12
|
+
* - **verifyHostStep** probes again after a receipt; the helper's word is never the evidence.
|
|
13
|
+
* - **prepare** pulls the small GPU-check image by digest and runs `nvidia-smi` in it on the chosen
|
|
14
|
+
* card (`--gpus device=<uuid>`) before a single byte of the engine image moves (design D6).
|
|
15
|
+
* - **pull** pulls the engine image by the digest for this host's platform with byte progress;
|
|
16
|
+
* **verify** inspects it and confirms the digest; **activate** writes the installation record
|
|
17
|
+
* pinned to the descriptor (design D7).
|
|
18
|
+
* - **remove** unloads a loaded session of the engine first (an injected callback; the provider is
|
|
19
|
+
* task 2.14), then removes this engine's own containers, the image by digest unless a foreign
|
|
20
|
+
* container uses it, the engine caches, the models only when asked, and the installation record.
|
|
21
|
+
* Docker, the toolkit, the group, repositories and anything not ours are never touched.
|
|
22
|
+
*
|
|
23
|
+
* Nothing here branches on which engine it is: the engine, image, probe image and requirements all
|
|
24
|
+
* come from the descriptor and the operation's target. Every docker call goes through the one
|
|
25
|
+
* executor core startup wired (`docker`), never a second one.
|
|
26
|
+
*/
|
|
27
|
+
import { randomUUID } from 'node:crypto';
|
|
28
|
+
import { AtomicCoreError } from '../../contracts/index.js';
|
|
29
|
+
import { containersUsingImage, inspectImage, pullImage, removeContainer, removeImage, runOnce, stopContainer, } from '../container/index.js';
|
|
30
|
+
import { canonicalDigest, planDigest } from './canonical-json.js';
|
|
31
|
+
import { descriptorForProbe as resolveProbeDescriptor, pinnedDescriptor as resolvePinnedDescriptor, } from './provisioner-descriptors.js';
|
|
32
|
+
import { assessLinux, compareDottedVersions } from './linux-plan.js';
|
|
33
|
+
import { daemonJsonSetsAddressPools } from './linux-docker-network.js';
|
|
34
|
+
import { probeLinux } from './linux-probe.js';
|
|
35
|
+
import { otherEngines, storeModelsChange } from './store-models.js';
|
|
36
|
+
export const NOTHING_LOADED = async () => ({ unloaded: 0 });
|
|
37
|
+
const ZERO_DIGEST = `sha256:${'0'.repeat(64)}`;
|
|
38
|
+
/** Checkpoints at which part or all of the engine image is already in Docker's layer store. */
|
|
39
|
+
const PULL_PHASES = ['pulling-image', 'verifying', 'activating'];
|
|
40
|
+
const STOP_TIMEOUT_SECONDS = 10;
|
|
41
|
+
const DIAGNOSTIC_TAIL = 1_000;
|
|
42
|
+
const platformFor = (architecture) => architecture === 'x86_64' ? 'linux/amd64' : architecture === 'aarch64' ? 'linux/arm64' : null;
|
|
43
|
+
const tail = (text) => (text.length > DIAGNOSTIC_TAIL ? text.slice(-DIAGNOSTIC_TAIL) : text);
|
|
44
|
+
/** How an image this operation pulled is named among its `owned_resource_ids`. */
|
|
45
|
+
export const ownedImageId = (image) => `image:${image.repository}@${image.digest}`;
|
|
46
|
+
/**
|
|
47
|
+
* A structured `LinuxBlocker` on the wire. A relogin is its own code: the operation waits on it. A
|
|
48
|
+
* missing environment manifest is missing metadata, not a host prerequisite (spec
|
|
49
|
+
* `runtime-environment-manifest`, "Без манифеста не предлагается только автоматическая установка").
|
|
50
|
+
*/
|
|
51
|
+
export function toManagedBlocker(blocker) {
|
|
52
|
+
return {
|
|
53
|
+
code: blocker.reason === 'relogin-required'
|
|
54
|
+
? 'MANAGED_RELOGIN_REQUIRED'
|
|
55
|
+
: blocker.reason === 'environment-manifest-unavailable'
|
|
56
|
+
? 'MANAGED_METADATA_INVALID'
|
|
57
|
+
: 'MANAGED_PREREQUISITE_BLOCKED',
|
|
58
|
+
message: blocker.message,
|
|
59
|
+
details: blocker.reason,
|
|
60
|
+
reason: blocker.reason,
|
|
61
|
+
...(blocker.params === undefined ? {} : { params: blocker.params }),
|
|
62
|
+
...(blocker.commands === undefined ? {} : { commands: blocker.commands }),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The card the GPU check runs on, and the one a first load would pick: the largest memory among
|
|
67
|
+
* cards new enough for the descriptor; a unified-memory card (no VRAM of its own) counts as zero.
|
|
68
|
+
*/
|
|
69
|
+
export function pickGpu(gpus, minimumComputeCapability) {
|
|
70
|
+
const eligible = gpus.filter((gpu) => compareDottedVersions(gpu.compute_capability, minimumComputeCapability) >= 0);
|
|
71
|
+
return eligible.reduce((best, gpu) => (best === null || (gpu.total_vram_bytes ?? 0) > (best.total_vram_bytes ?? 0) ? gpu : best), null);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A repository as Docker names it in `RepoDigests`: a Docker Hub image without its registry
|
|
75
|
+
* (`docker.io/vllm/vllm-openai` → `vllm/vllm-openai`) and an official one by its bare name
|
|
76
|
+
* (`docker.io/library/ubuntu` → `ubuntu`); every other registry as written (`nvcr.io/…`).
|
|
77
|
+
*/
|
|
78
|
+
export function dockerRepositoryName(repository) {
|
|
79
|
+
const short = repository.replace(/^(?:docker\.io|index\.docker\.io|registry-1\.docker\.io)\//, '');
|
|
80
|
+
if (short === repository)
|
|
81
|
+
return repository;
|
|
82
|
+
return short.replace(/^library\/(?=[^/]+$)/, '');
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Whether `inspectImage`'s answer names exactly `image` among its repo digests. The digest must be
|
|
86
|
+
* the pinned one; the repository is compared in the form Docker reports it in, since Docker drops
|
|
87
|
+
* the registry of a Docker Hub image (vLLM's `docker.io/vllm/vllm-openai`, change
|
|
88
|
+
* `add-vllm-runtime`; found in the live run on Windows).
|
|
89
|
+
*/
|
|
90
|
+
export function imageMatchesDigest(inspected, image) {
|
|
91
|
+
const digests = inspected?.RepoDigests;
|
|
92
|
+
if (!Array.isArray(digests))
|
|
93
|
+
return false;
|
|
94
|
+
const expected = `${dockerRepositoryName(image.repository)}@${image.digest}`;
|
|
95
|
+
return digests.some((entry) => {
|
|
96
|
+
if (typeof entry !== 'string')
|
|
97
|
+
return false;
|
|
98
|
+
const at = entry.lastIndexOf('@');
|
|
99
|
+
return at > 0 && `${dockerRepositoryName(entry.slice(0, at))}${entry.slice(at)}` === expected;
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
const blockedPlan = (record, environmentId, availability, blocker) => ({
|
|
103
|
+
plan_digest: canonicalDigest({ blocked: blocker.code, reason: blocker.reason ?? null }),
|
|
104
|
+
environment_id: environmentId,
|
|
105
|
+
target: record.machine.operation.target,
|
|
106
|
+
availability,
|
|
107
|
+
recipe_id: 'none',
|
|
108
|
+
recipe_digest: ZERO_DIGEST,
|
|
109
|
+
descriptor_id: null,
|
|
110
|
+
environment_manifest_id: null,
|
|
111
|
+
image_digest: null,
|
|
112
|
+
adopts_existing_engine: false,
|
|
113
|
+
system_changes: [],
|
|
114
|
+
download_bytes: null,
|
|
115
|
+
required_disk_bytes: null,
|
|
116
|
+
docker_root_dir: null,
|
|
117
|
+
free_disk_bytes: null,
|
|
118
|
+
requires_elevation: false,
|
|
119
|
+
may_require_relogin: false,
|
|
120
|
+
may_require_reboot: false,
|
|
121
|
+
blockers: [blocker],
|
|
122
|
+
warnings: [],
|
|
123
|
+
});
|
|
124
|
+
export function createLinuxProvisioner(deps) {
|
|
125
|
+
const newId = deps.newId ?? randomUUID;
|
|
126
|
+
const now = deps.now ?? (() => new Date());
|
|
127
|
+
const pull = deps.pull ?? pullImage;
|
|
128
|
+
const unload = deps.unloadEngineSessions ?? NOTHING_LOADED;
|
|
129
|
+
/**
|
|
130
|
+
* One probe of the machine shared by every caller that asks while it runs — recovery asks four
|
|
131
|
+
* questions at once — and never reused after it settles: a receipt that arrives a second after a
|
|
132
|
+
* probe must be judged against the machine as it is now.
|
|
133
|
+
*/
|
|
134
|
+
let inFlight = null;
|
|
135
|
+
const facts = () => {
|
|
136
|
+
inFlight ??= probeLinux(deps.host.probeDeps, deps.host.options()).finally(() => {
|
|
137
|
+
inFlight = null;
|
|
138
|
+
});
|
|
139
|
+
return inFlight;
|
|
140
|
+
};
|
|
141
|
+
const dockerOrThrow = async () => {
|
|
142
|
+
const docker = await deps.docker();
|
|
143
|
+
if (docker === null) {
|
|
144
|
+
throw new AtomicCoreError('MANAGED_PREREQUISITE_BLOCKED', 'No docker CLI was found in the system directories (/usr/bin, /usr/local/bin, /bin).');
|
|
145
|
+
}
|
|
146
|
+
return docker;
|
|
147
|
+
};
|
|
148
|
+
const descriptorForProbe = (record) => resolveProbeDescriptor(deps.descriptors, record);
|
|
149
|
+
const pinnedDescriptor = (record) => resolvePinnedDescriptor(deps.descriptors, record);
|
|
150
|
+
/**
|
|
151
|
+
* The environment manifest a probe judges the host against (design D4 of change
|
|
152
|
+
* `extract-environment-manifest`). Once work began under a consent, only the consented manifest,
|
|
153
|
+
* from the cache — a manifest published during a sign-in wait or across a core restart never
|
|
154
|
+
* changes what the user agreed to; a consent given with no manifest stays without one. Before
|
|
155
|
+
* that, the newest one: a plan offered now is judged against what conf says now, and a manifest
|
|
156
|
+
* published between the probe and the consent changes the plan's digest, so the consent is asked
|
|
157
|
+
* again. Null when none is available — never an error by itself: only a host that needs an
|
|
158
|
+
* install is blocked by it (`assessLinux`, gate `manifest-unavailable`).
|
|
159
|
+
*
|
|
160
|
+
* A consented manifest missing from the cache (its write failed — `latest()` never fails on that)
|
|
161
|
+
* is fetched again and used only if conf still serves that very `manifest_id`: an id's content
|
|
162
|
+
* never changes, so this is the consented manifest, not a newer one.
|
|
163
|
+
*/
|
|
164
|
+
const manifestForProbe = async (record) => {
|
|
165
|
+
const consented = record.machine.consented ?? null;
|
|
166
|
+
if (consented !== null) {
|
|
167
|
+
const id = consented.environment_manifest_id ?? null;
|
|
168
|
+
if (id === null)
|
|
169
|
+
return null;
|
|
170
|
+
const pinned = await deps.environmentManifests.pinned(id);
|
|
171
|
+
if (pinned.kind === 'available')
|
|
172
|
+
return pinned.manifest;
|
|
173
|
+
const again = await deps.environmentManifests.latest();
|
|
174
|
+
return again.kind === 'available' && again.manifest.manifest_id === id ? again.manifest : null;
|
|
175
|
+
}
|
|
176
|
+
const latest = await deps.environmentManifests.latest();
|
|
177
|
+
return latest.kind === 'available' ? latest.manifest : null;
|
|
178
|
+
};
|
|
179
|
+
const hostPlatform = async () => {
|
|
180
|
+
const uname = await deps.host.probeDeps.exec('uname', ['-m']);
|
|
181
|
+
const platform = uname.code === 0 ? platformFor(uname.stdout.trim().replace(/^arm64$/, 'aarch64')) : null;
|
|
182
|
+
if (platform === null) {
|
|
183
|
+
throw new AtomicCoreError('MANAGED_PREREQUISITE_BLOCKED', 'This machine’s architecture is not supported.');
|
|
184
|
+
}
|
|
185
|
+
return platform;
|
|
186
|
+
};
|
|
187
|
+
const installationId = (record) => {
|
|
188
|
+
const target = record.machine.operation.target;
|
|
189
|
+
return target.kind === 'runtime' ? target.installation_id : null;
|
|
190
|
+
};
|
|
191
|
+
/** Absent by Docker's own answer. A failed inspect proves nothing, and is not "absent". */
|
|
192
|
+
const imageAbsent = async (docker, image) => {
|
|
193
|
+
const inspected = await inspectImage(docker.exec, image).catch(() => null);
|
|
194
|
+
return inspected !== null && !inspected.found;
|
|
195
|
+
};
|
|
196
|
+
const imagePresent = async (image) => {
|
|
197
|
+
const docker = await deps.docker();
|
|
198
|
+
if (docker === null)
|
|
199
|
+
return false;
|
|
200
|
+
const inspected = await inspectImage(docker.exec, image).catch(() => null);
|
|
201
|
+
return inspected !== null && inspected.found && imageMatchesDigest(inspected.value, image);
|
|
202
|
+
};
|
|
203
|
+
/** A removal plan: what is deleted, nothing about the host's readiness (a blocked host can still uninstall). */
|
|
204
|
+
const removalProbe = async (record) => {
|
|
205
|
+
const target = record.machine.operation.target;
|
|
206
|
+
if (target.kind !== 'runtime') {
|
|
207
|
+
return {
|
|
208
|
+
plan: blockedPlan(record, deps.environmentId, 'setup-required', {
|
|
209
|
+
code: 'MANAGED_PREREQUISITE_BLOCKED',
|
|
210
|
+
message: 'Only an engine installation can be removed; the container environment itself stays.',
|
|
211
|
+
reason: 'remove-environment',
|
|
212
|
+
}),
|
|
213
|
+
host_step: null,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
const existing = await deps.installations.read(target.installation_id);
|
|
217
|
+
const retainModels = record.request.retain_models !== false;
|
|
218
|
+
const usedBy = await otherEngines(deps.installations, target);
|
|
219
|
+
const changes = [
|
|
220
|
+
{
|
|
221
|
+
code: 'unload-sessions',
|
|
222
|
+
text: `Unload any loaded ${target.engine_id} model, waiting until its container has stopped.`,
|
|
223
|
+
},
|
|
224
|
+
{ code: 'remove-containers', text: `Remove this app's own ${target.engine_id} containers.` },
|
|
225
|
+
...(existing === null
|
|
226
|
+
? []
|
|
227
|
+
: [
|
|
228
|
+
{
|
|
229
|
+
code: 'remove-image',
|
|
230
|
+
text: `Remove the engine image ${existing.image.repository}@${existing.image.digest}, unless another container still uses it.`,
|
|
231
|
+
params: { image: `${existing.image.repository}@${existing.image.digest}` },
|
|
232
|
+
},
|
|
233
|
+
...(existing.probe_image === undefined
|
|
234
|
+
? []
|
|
235
|
+
: [
|
|
236
|
+
{
|
|
237
|
+
code: 'remove-probe-image',
|
|
238
|
+
text: `Remove the GPU check image ${existing.probe_image.repository}@${existing.probe_image.digest}, unless something else still uses it.`,
|
|
239
|
+
params: { image: `${existing.probe_image.repository}@${existing.probe_image.digest}` },
|
|
240
|
+
},
|
|
241
|
+
]),
|
|
242
|
+
{
|
|
243
|
+
code: 'remove-engine-caches',
|
|
244
|
+
text: 'Remove the engine caches built for this installation.',
|
|
245
|
+
params: { descriptor_id: existing.installation.active_descriptor_id ?? '' },
|
|
246
|
+
},
|
|
247
|
+
]),
|
|
248
|
+
...storeModelsChange(retainModels, usedBy),
|
|
249
|
+
{ code: 'remove-installation', text: 'Forget the installation.' },
|
|
250
|
+
];
|
|
251
|
+
const plan = {
|
|
252
|
+
plan_digest: canonicalDigest({
|
|
253
|
+
kind: 'remove',
|
|
254
|
+
target,
|
|
255
|
+
installation: existing === null
|
|
256
|
+
? null
|
|
257
|
+
: { descriptor_id: existing.installation.active_descriptor_id, image: existing.image },
|
|
258
|
+
retain_models: retainModels,
|
|
259
|
+
system_changes: changes,
|
|
260
|
+
}),
|
|
261
|
+
environment_id: deps.environmentId,
|
|
262
|
+
target,
|
|
263
|
+
availability: existing === null ? 'setup-required' : 'supported',
|
|
264
|
+
recipe_id: 'none',
|
|
265
|
+
recipe_digest: ZERO_DIGEST,
|
|
266
|
+
descriptor_id: existing?.installation.active_descriptor_id ?? null,
|
|
267
|
+
// A removal judges nothing against the environment: no manifest is read or pinned.
|
|
268
|
+
environment_manifest_id: null,
|
|
269
|
+
image_digest: existing?.image.digest ?? null,
|
|
270
|
+
adopts_existing_engine: true,
|
|
271
|
+
system_changes: changes,
|
|
272
|
+
download_bytes: null,
|
|
273
|
+
required_disk_bytes: null,
|
|
274
|
+
// A removal reads nothing off the disk.
|
|
275
|
+
docker_root_dir: null,
|
|
276
|
+
free_disk_bytes: null,
|
|
277
|
+
requires_elevation: false,
|
|
278
|
+
may_require_relogin: false,
|
|
279
|
+
may_require_reboot: false,
|
|
280
|
+
blockers: [],
|
|
281
|
+
warnings: [],
|
|
282
|
+
};
|
|
283
|
+
return { plan, host_step: null };
|
|
284
|
+
};
|
|
285
|
+
const setupProbe = async (record) => {
|
|
286
|
+
// Fetched alongside the descriptor and the host probe, not after them: two conf documents with
|
|
287
|
+
// their own timeouts must not add up on a network that drops packets. Never rejects: a failure
|
|
288
|
+
// is "no manifest", which `assessLinux` handles.
|
|
289
|
+
const manifestPending = manifestForProbe(record).catch(() => null);
|
|
290
|
+
const resolved = await descriptorForProbe(record);
|
|
291
|
+
if ('blocker' in resolved) {
|
|
292
|
+
const plan = blockedPlan(record, deps.environmentId, 'unsupported', resolved.blocker);
|
|
293
|
+
deps.onAssessment?.({ availability: 'unsupported', gpus: [], blockers: plan.blockers, selinux: null });
|
|
294
|
+
return { plan, host_step: null };
|
|
295
|
+
}
|
|
296
|
+
const { descriptor } = resolved;
|
|
297
|
+
const target = record.machine.operation.target;
|
|
298
|
+
const machine = await facts();
|
|
299
|
+
const user = deps.host.options().user;
|
|
300
|
+
const platform = platformFor(machine.architecture);
|
|
301
|
+
const image = platform === null ? null : descriptor.image[platform];
|
|
302
|
+
const existing = target.kind === 'runtime' ? await deps.installations.read(target.installation_id) : null;
|
|
303
|
+
const present = target.kind === 'runtime' && image !== null && machine.docker.daemon_reachable
|
|
304
|
+
? await imagePresent(image)
|
|
305
|
+
: false;
|
|
306
|
+
const readyInstallation = existing !== null &&
|
|
307
|
+
existing.installation.status === 'ready' &&
|
|
308
|
+
existing.installation.active_descriptor_id === descriptor.descriptor_id;
|
|
309
|
+
// What the engine image still needs on disk (review r1, item 1): nothing once it is there by
|
|
310
|
+
// digest — whatever the installation record says, since an image deleted outside the app is
|
|
311
|
+
// pulled again and needs the space again (review r2, item D); not checkable once a pull has
|
|
312
|
+
// begun — Docker's layer store already holds part of it, and counting the free space that is
|
|
313
|
+
// left against the whole image would fail every restart mid-pull. Otherwise the whole
|
|
314
|
+
// `required_disk_bytes`. An environment-only setup pulls no engine image at all.
|
|
315
|
+
// A ready installation of this descriptor on a daemon this probe cannot reach: whether its image
|
|
316
|
+
// is there is unknown, which is not "absent" — no disk blocker on a guess (review r3, N4).
|
|
317
|
+
const pullStarted = PULL_PHASES.includes(record.machine.checkpoint ?? 'checking');
|
|
318
|
+
const presenceUnknown = readyInstallation && !machine.docker.daemon_reachable;
|
|
319
|
+
const stillNeeded = target.kind !== 'runtime' || present || pullStarted || presenceUnknown
|
|
320
|
+
? null
|
|
321
|
+
: descriptor.required_disk_bytes;
|
|
322
|
+
const manifest = await manifestPending;
|
|
323
|
+
// A manifest without this recipe qualifies no distribution for it: `unqualified`, not unavailable.
|
|
324
|
+
const recipe = manifest?.recipes.find((entry) => entry.recipe_id === deps.recipe.recipe_id);
|
|
325
|
+
const assessment = assessLinux(machine, {
|
|
326
|
+
recipeId: deps.recipe.recipe_id,
|
|
327
|
+
recipeDistributions: manifest === null ? null : (recipe?.distributions ?? []),
|
|
328
|
+
minimumDriverVersion: descriptor.minimum_driver_version,
|
|
329
|
+
minimumComputeCapability: descriptor.minimum_compute_capability,
|
|
330
|
+
requiredDiskBytes: stillNeeded,
|
|
331
|
+
currentUser: user,
|
|
332
|
+
});
|
|
333
|
+
const blockers = assessment.blockers.map(toManagedBlocker);
|
|
334
|
+
if (target.kind === 'runtime' && target.engine_id !== descriptor.engine_id) {
|
|
335
|
+
blockers.push({
|
|
336
|
+
code: 'MANAGED_METADATA_INVALID',
|
|
337
|
+
message: `The descriptor ${descriptor.descriptor_id} is for ${descriptor.engine_id}, not ${target.engine_id}.`,
|
|
338
|
+
reason: 'engine-mismatch',
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
if (existing !== null && existing.installation.active_descriptor_id !== descriptor.descriptor_id) {
|
|
342
|
+
// An installation keeps its descriptor until an update, which is not part of this change
|
|
343
|
+
// (design D7): a new release applies after remove + setup, never by setting up over it.
|
|
344
|
+
blockers.push({
|
|
345
|
+
code: 'MANAGED_OPERATION_CONFLICT',
|
|
346
|
+
message: `This engine is already installed from ${String(existing.installation.active_descriptor_id)}; remove it before setting up ${descriptor.descriptor_id}.`,
|
|
347
|
+
reason: 'installed-with-other-descriptor',
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
let hostStep = null;
|
|
351
|
+
const installPlan = assessment.install_plan;
|
|
352
|
+
if (blockers.length === 0 && installPlan !== null && installPlan.requires_elevation) {
|
|
353
|
+
const distribution = machine.distribution;
|
|
354
|
+
try {
|
|
355
|
+
if (distribution === null || (distribution.family !== 'apt' && distribution.family !== 'dnf')) {
|
|
356
|
+
throw new AtomicCoreError('MANAGED_HOST_STEP_INVALID', 'The recipe has no package manager for this system.');
|
|
357
|
+
}
|
|
358
|
+
const parameters = deps.recipe.parameters(installPlan, {
|
|
359
|
+
user,
|
|
360
|
+
arch: machine.architecture,
|
|
361
|
+
family: distribution.family,
|
|
362
|
+
distro_id: distribution.id,
|
|
363
|
+
version_id: distribution.version_id,
|
|
364
|
+
});
|
|
365
|
+
hostStep = {
|
|
366
|
+
step_id: `host-step-${newId()}`,
|
|
367
|
+
action: 'linux.install-container-runtime',
|
|
368
|
+
recipe_id: deps.recipe.recipe_id,
|
|
369
|
+
recipe_digest: deps.recipe.recipe_digest,
|
|
370
|
+
parameters_digest: deps.recipe.parametersDigest(parameters),
|
|
371
|
+
parameters,
|
|
372
|
+
nonce: newId(),
|
|
373
|
+
// Stamped with the real revision when the step is issued (`state.ts`, `afterConsent`).
|
|
374
|
+
expected_operation_revision: 0,
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
catch (error) {
|
|
378
|
+
blockers.push({
|
|
379
|
+
code: 'MANAGED_HOST_STEP_INVALID',
|
|
380
|
+
message: error instanceof Error ? error.message : String(error),
|
|
381
|
+
reason: 'recipe-refused-plan',
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
const systemChanges = (installPlan?.system_changes ?? []).map((change) => ({
|
|
386
|
+
code: change.code,
|
|
387
|
+
text: change.text,
|
|
388
|
+
...(change.params === undefined ? {} : { params: change.params }),
|
|
389
|
+
}));
|
|
390
|
+
const availability = blockers.length > 0
|
|
391
|
+
? assessment.availability === 'setup-required'
|
|
392
|
+
? 'prerequisite-blocked'
|
|
393
|
+
: assessment.availability
|
|
394
|
+
: readyInstallation
|
|
395
|
+
? 'supported'
|
|
396
|
+
: assessment.availability;
|
|
397
|
+
const plan = {
|
|
398
|
+
plan_digest: planDigest({
|
|
399
|
+
target,
|
|
400
|
+
recipe_id: deps.recipe.recipe_id,
|
|
401
|
+
recipe_digest: deps.recipe.recipe_digest,
|
|
402
|
+
adopts_existing_engine: assessment.adopts_existing_engine,
|
|
403
|
+
system_changes: systemChanges,
|
|
404
|
+
requires_elevation: installPlan?.requires_elevation ?? false,
|
|
405
|
+
may_require_relogin: installPlan?.may_require_relogin ?? false,
|
|
406
|
+
may_require_reboot: false,
|
|
407
|
+
descriptor: image === null ? null : { descriptor_id: descriptor.descriptor_id, image_digest: image.digest },
|
|
408
|
+
environment_manifest_id: manifest?.manifest_id ?? null,
|
|
409
|
+
host: {
|
|
410
|
+
gpu_ids: machine.gpus.map((gpu) => gpu.gpu_id).sort(),
|
|
411
|
+
disk_sufficient: stillNeeded === null
|
|
412
|
+
? true
|
|
413
|
+
: machine.free_disk_bytes === null
|
|
414
|
+
? null
|
|
415
|
+
: machine.free_disk_bytes >= stillNeeded,
|
|
416
|
+
docker_root_dir: machine.docker.docker_root_dir,
|
|
417
|
+
},
|
|
418
|
+
}),
|
|
419
|
+
environment_id: deps.environmentId,
|
|
420
|
+
target,
|
|
421
|
+
availability,
|
|
422
|
+
recipe_id: deps.recipe.recipe_id,
|
|
423
|
+
recipe_digest: deps.recipe.recipe_digest,
|
|
424
|
+
descriptor_id: descriptor.descriptor_id,
|
|
425
|
+
environment_manifest_id: manifest?.manifest_id ?? null,
|
|
426
|
+
image_digest: target.kind === 'runtime' ? (image?.digest ?? null) : null,
|
|
427
|
+
adopts_existing_engine: assessment.adopts_existing_engine,
|
|
428
|
+
system_changes: systemChanges,
|
|
429
|
+
download_bytes: descriptor.download_bytes,
|
|
430
|
+
required_disk_bytes: descriptor.required_disk_bytes,
|
|
431
|
+
// Where and how much the probe measured — the numbers `insufficient-disk` was judged on — or
|
|
432
|
+
// neither when the read failed (task 2.22, R-core-6). Not in `plan_digest`: its `host` keeps
|
|
433
|
+
// `docker info`'s own `DockerRootDir` and `disk_sufficient`, exactly as before, so reporting
|
|
434
|
+
// them changes no digest and asks for no new consent.
|
|
435
|
+
docker_root_dir: machine.free_disk_bytes === null ? null : machine.free_disk_path,
|
|
436
|
+
free_disk_bytes: machine.free_disk_bytes,
|
|
437
|
+
requires_elevation: installPlan?.requires_elevation ?? false,
|
|
438
|
+
may_require_relogin: installPlan?.may_require_relogin ?? false,
|
|
439
|
+
may_require_reboot: false,
|
|
440
|
+
blockers,
|
|
441
|
+
// What the plan's reader should know before consenting (task 2.23, F-4). Not in `plan_digest`:
|
|
442
|
+
// a warning asks for no new consent, and its input (the routing table, a VPN switched on or
|
|
443
|
+
// off) moves on its own; the consent covers what the plan changes, which a warning never does.
|
|
444
|
+
warnings: assessment.warnings.map((warning) => ({
|
|
445
|
+
code: warning.code,
|
|
446
|
+
text: warning.text,
|
|
447
|
+
...(warning.params === undefined ? {} : { params: warning.params }),
|
|
448
|
+
})),
|
|
449
|
+
};
|
|
450
|
+
deps.onAssessment?.({
|
|
451
|
+
availability,
|
|
452
|
+
gpus: machine.gpus,
|
|
453
|
+
blockers,
|
|
454
|
+
selinux: machine.docker.daemon_reachable ? machine.docker.selinux : null,
|
|
455
|
+
});
|
|
456
|
+
return { plan, host_step: hostStep, image_present: present };
|
|
457
|
+
};
|
|
458
|
+
const probe = (record) => record.request.kind === 'remove' ? removalProbe(record) : setupProbe(record);
|
|
459
|
+
const needsRelogin = async (record) => {
|
|
460
|
+
if (record.request.kind === 'remove')
|
|
461
|
+
return false;
|
|
462
|
+
const machine = await facts();
|
|
463
|
+
// Carry item 7: the group is configured but not in this session, and the daemon is running —
|
|
464
|
+
// only a sign-in is missing. Root never needs one (design D4).
|
|
465
|
+
return (!machine.docker.daemon_reachable &&
|
|
466
|
+
machine.docker_group.configured === true &&
|
|
467
|
+
!machine.docker_group.effective &&
|
|
468
|
+
machine.docker.service_active === true &&
|
|
469
|
+
deps.host.options().user !== 'root');
|
|
470
|
+
};
|
|
471
|
+
const inventory = {
|
|
472
|
+
async inspect(effect, record) {
|
|
473
|
+
if (record.request.kind === 'remove')
|
|
474
|
+
return { kind: 'absent' };
|
|
475
|
+
try {
|
|
476
|
+
if (effect.kind === 'pull-image' || effect.kind === 'verify') {
|
|
477
|
+
const descriptor = await pinnedDescriptor(record);
|
|
478
|
+
const image = descriptor.image[await hostPlatform()];
|
|
479
|
+
return (await imagePresent(image))
|
|
480
|
+
? { kind: 'completed', owned_resource_ids: [] }
|
|
481
|
+
: { kind: 'absent' };
|
|
482
|
+
}
|
|
483
|
+
if (effect.kind === 'activate') {
|
|
484
|
+
const id = installationId(record);
|
|
485
|
+
const existing = id === null ? null : await deps.installations.read(id);
|
|
486
|
+
// Compared by id, never resolved: a cache entry gone since the activation must not make
|
|
487
|
+
// a committed activation look undone (review r2, item C).
|
|
488
|
+
const planned = record.machine.consented?.descriptor_id ?? record.requirement_plan?.descriptor_id ?? null;
|
|
489
|
+
// Status too (N-1), not only the id: a removal that failed part-way leaves the record
|
|
490
|
+
// `removing` with the same descriptor id it activated. Treating that as a completed
|
|
491
|
+
// activation would let recovery skip re-running it, and the record would never reach
|
|
492
|
+
// `ready` again.
|
|
493
|
+
return existing !== null &&
|
|
494
|
+
existing.installation.active_descriptor_id === planned &&
|
|
495
|
+
existing.installation.status === 'ready'
|
|
496
|
+
? { kind: 'completed', owned_resource_ids: [] }
|
|
497
|
+
: { kind: 'absent' };
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
catch {
|
|
501
|
+
// Nothing this core can check (no descriptor cached, no architecture): the effect runs
|
|
502
|
+
// again, and fails there with its own reason if it still cannot.
|
|
503
|
+
}
|
|
504
|
+
return { kind: 'absent' };
|
|
505
|
+
},
|
|
506
|
+
needsRelogin,
|
|
507
|
+
needsReboot: async () => false,
|
|
508
|
+
async verifyCompletedSteps(record) {
|
|
509
|
+
const steps = record.machine.operation.completed_step_ids;
|
|
510
|
+
if (steps.length === 0)
|
|
511
|
+
return [];
|
|
512
|
+
const machine = await facts();
|
|
513
|
+
// What the step installed is still there; otherwise it no longer counts as done.
|
|
514
|
+
return machine.docker.cli && machine.toolkit_installed ? steps : [];
|
|
515
|
+
},
|
|
516
|
+
async currentPlanDigest(record) {
|
|
517
|
+
return (await probe(record).catch(() => null))?.plan.plan_digest ?? null;
|
|
518
|
+
},
|
|
519
|
+
};
|
|
520
|
+
return {
|
|
521
|
+
probe: (record) => probe(record),
|
|
522
|
+
async addressPoolsConfigured() {
|
|
523
|
+
// Read-only, the same contract as the probe's own read: null is "no file", a rejection "unreadable".
|
|
524
|
+
const read = await deps.host.probeDeps.readFile('/etc/docker/daemon.json').then((text) => ({ text, unreadable: false }), () => ({ text: null, unreadable: true }));
|
|
525
|
+
return daemonJsonSetsAddressPools(read);
|
|
526
|
+
},
|
|
527
|
+
async verifyHostStep(record) {
|
|
528
|
+
const answer = await setupProbe(record);
|
|
529
|
+
const { blockers } = answer.plan;
|
|
530
|
+
if (blockers.length === 1 && blockers[0]?.code === 'MANAGED_RELOGIN_REQUIRED') {
|
|
531
|
+
return { prerequisites_met: false, needs_relogin: true, error: null };
|
|
532
|
+
}
|
|
533
|
+
if (blockers.length > 0) {
|
|
534
|
+
const first = blockers[0];
|
|
535
|
+
return {
|
|
536
|
+
prerequisites_met: false,
|
|
537
|
+
needs_relogin: false,
|
|
538
|
+
error: {
|
|
539
|
+
code: first.code,
|
|
540
|
+
message: `The system change was reported as done, but the machine says: ${blockers
|
|
541
|
+
.map((entry) => entry.message)
|
|
542
|
+
.join(' ')}`,
|
|
543
|
+
details: blockers.map((entry) => entry.reason ?? entry.code).join(','),
|
|
544
|
+
},
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
if (answer.host_step !== null) {
|
|
548
|
+
const missing = {
|
|
549
|
+
code: 'MANAGED_PREREQUISITE_BLOCKED',
|
|
550
|
+
message: `The system change was reported as done, but the machine still needs: ${answer.plan.system_changes
|
|
551
|
+
.map((change) => change.text)
|
|
552
|
+
.join(' ')}`,
|
|
553
|
+
details: answer.plan.system_changes.map((change) => change.code).join(','),
|
|
554
|
+
};
|
|
555
|
+
return { prerequisites_met: false, needs_relogin: false, error: missing };
|
|
556
|
+
}
|
|
557
|
+
return { prerequisites_met: true, needs_relogin: false, error: null };
|
|
558
|
+
},
|
|
559
|
+
async prepare(record, signal, own) {
|
|
560
|
+
const descriptor = await pinnedDescriptor(record);
|
|
561
|
+
const machine = await facts();
|
|
562
|
+
const platform = platformFor(machine.architecture);
|
|
563
|
+
if (platform === null) {
|
|
564
|
+
throw new AtomicCoreError('MANAGED_PREREQUISITE_BLOCKED', 'This machine’s architecture is not supported.');
|
|
565
|
+
}
|
|
566
|
+
const gpu = pickGpu(machine.gpus, descriptor.minimum_compute_capability);
|
|
567
|
+
if (gpu === null) {
|
|
568
|
+
throw new AtomicCoreError('MANAGED_PREREQUISITE_BLOCKED', `No GPU with compute capability ${descriptor.minimum_compute_capability} or newer was found.`);
|
|
569
|
+
}
|
|
570
|
+
const docker = await dockerOrThrow();
|
|
571
|
+
const probeImage = descriptor.probe_image[platform];
|
|
572
|
+
// Only a GPU-check image this setup pulls itself is its to remove later. Whether it was absent
|
|
573
|
+
// is recorded on the operation before the pull, so a core that dies between the pull and the
|
|
574
|
+
// activation still knows (review r2, item B); an image the user already had never is.
|
|
575
|
+
if (await imageAbsent(docker, probeImage))
|
|
576
|
+
await own([ownedImageId(probeImage)]);
|
|
577
|
+
await pull(probeImage, { socketPath: docker.socketPath, signal, verify: docker.exec });
|
|
578
|
+
const result = await runOnce(docker.exec, {
|
|
579
|
+
image: probeImage,
|
|
580
|
+
gpuUuid: gpu.gpu_id,
|
|
581
|
+
command: ['nvidia-smi', '--query-gpu=uuid', '--format=csv,noheader'],
|
|
582
|
+
});
|
|
583
|
+
if (result.code !== 0 || !result.stdout.includes(gpu.gpu_id)) {
|
|
584
|
+
// Toolkit diagnostics, so the failure says where to look: what the container printed, and
|
|
585
|
+
// what the host probe says about the runtime Docker is using.
|
|
586
|
+
throw new AtomicCoreError('MANAGED_PREREQUISITE_BLOCKED', `The GPU ${gpu.name} is not visible inside a container: the NVIDIA Container Toolkit did not pass it through. The engine image was not downloaded.`, [
|
|
587
|
+
`gpu=${gpu.gpu_id}`,
|
|
588
|
+
`exit=${String(result.code)}`,
|
|
589
|
+
`toolkit_installed=${String(machine.toolkit_installed)}`,
|
|
590
|
+
`gpu_runtime=${String(machine.docker.gpu_runtime)}`,
|
|
591
|
+
`stdout=${tail(result.stdout.trim())}`,
|
|
592
|
+
`stderr=${tail(result.stderr.trim())}`,
|
|
593
|
+
].join('\n'));
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
async pull(record, onProgress, signal) {
|
|
597
|
+
const descriptor = await pinnedDescriptor(record);
|
|
598
|
+
const image = descriptor.image[await hostPlatform()];
|
|
599
|
+
const docker = await dockerOrThrow();
|
|
600
|
+
const label = 'Downloading the engine image';
|
|
601
|
+
onProgress({ label, completed: 0, total: descriptor.download_bytes, unit: 'bytes' });
|
|
602
|
+
await pull(image, {
|
|
603
|
+
socketPath: docker.socketPath,
|
|
604
|
+
signal,
|
|
605
|
+
knownTotalBytes: descriptor.download_bytes,
|
|
606
|
+
verify: docker.exec,
|
|
607
|
+
onProgress: (progress) => onProgress({ label, completed: progress.current, total: progress.total, unit: 'bytes' }),
|
|
608
|
+
});
|
|
609
|
+
},
|
|
610
|
+
async verify(record) {
|
|
611
|
+
const target = record.machine.operation.target;
|
|
612
|
+
if (target.kind === 'environment') {
|
|
613
|
+
const machine = await facts();
|
|
614
|
+
if (!machine.docker.daemon_reachable || !machine.docker.gpu_runtime) {
|
|
615
|
+
throw new AtomicCoreError('MANAGED_PREREQUISITE_BLOCKED', 'Docker does not answer with a GPU runtime any more.');
|
|
616
|
+
}
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
const descriptor = await pinnedDescriptor(record);
|
|
620
|
+
const image = descriptor.image[await hostPlatform()];
|
|
621
|
+
const docker = await dockerOrThrow();
|
|
622
|
+
const inspected = await inspectImage(docker.exec, image);
|
|
623
|
+
if (!inspected.found || !imageMatchesDigest(inspected.value, image)) {
|
|
624
|
+
throw new AtomicCoreError('MANAGED_IDENTITY_MISMATCH', 'The engine image on this machine does not carry the digest the descriptor pins.', `${image.repository}@${image.digest}`);
|
|
625
|
+
}
|
|
626
|
+
},
|
|
627
|
+
async unloadResident() {
|
|
628
|
+
// Updates are a later change; a setup never reaches this.
|
|
629
|
+
},
|
|
630
|
+
async activate(record) {
|
|
631
|
+
const target = record.machine.operation.target;
|
|
632
|
+
if (target.kind !== 'runtime')
|
|
633
|
+
return;
|
|
634
|
+
const descriptor = await pinnedDescriptor(record);
|
|
635
|
+
const platform = await hostPlatform();
|
|
636
|
+
const probeImage = descriptor.probe_image[platform];
|
|
637
|
+
// Ours if this operation pulled it, or if the installation it replaces already recorded that
|
|
638
|
+
// an earlier setup did (a repeat setup finds it present and claims nothing; review r3, N3).
|
|
639
|
+
// An earlier attempt that never activated leaves no record to carry, so its image stays the
|
|
640
|
+
// user's to remove: the safe direction.
|
|
641
|
+
const previous = await deps.installations.read(target.installation_id);
|
|
642
|
+
const ownsProbe = record.owned_resource_ids.includes(ownedImageId(probeImage)) ||
|
|
643
|
+
previous?.probe_image?.digest === probeImage.digest;
|
|
644
|
+
const installation = {
|
|
645
|
+
schema_version: 1,
|
|
646
|
+
installation: {
|
|
647
|
+
installation_id: target.installation_id,
|
|
648
|
+
engine_id: target.engine_id,
|
|
649
|
+
environment_id: record.machine.operation.environment_id,
|
|
650
|
+
active_descriptor_id: descriptor.descriptor_id,
|
|
651
|
+
candidate_descriptor_id: null,
|
|
652
|
+
availability: 'supported',
|
|
653
|
+
status: 'ready',
|
|
654
|
+
},
|
|
655
|
+
image: descriptor.image[platform],
|
|
656
|
+
...(ownsProbe ? { probe_image: probeImage } : {}),
|
|
657
|
+
platform,
|
|
658
|
+
installed_at: now().toISOString(),
|
|
659
|
+
};
|
|
660
|
+
await deps.installations.write(installation);
|
|
661
|
+
},
|
|
662
|
+
async remove(record) {
|
|
663
|
+
const target = record.machine.operation.target;
|
|
664
|
+
if (target.kind !== 'runtime') {
|
|
665
|
+
throw new AtomicCoreError('INVALID_ARGUMENT', 'Only an engine installation can be removed.');
|
|
666
|
+
}
|
|
667
|
+
const existing = await deps.installations.read(target.installation_id);
|
|
668
|
+
// A loaded model goes first, with its container confirmed stopped: removing the image under a
|
|
669
|
+
// running container is not something Docker allows, and a GPU must never be left held. Loads
|
|
670
|
+
// of the engine stay held off until this removal ends, whichever way.
|
|
671
|
+
const hold = await unload(target.engine_id);
|
|
672
|
+
try {
|
|
673
|
+
const docker = await deps.docker();
|
|
674
|
+
if (docker !== null) {
|
|
675
|
+
// Our own containers of this engine that outlived their session (a crash, a failed load).
|
|
676
|
+
for (const container of docker.journal
|
|
677
|
+
.list()
|
|
678
|
+
.filter((entry) => entry.engine_id === target.engine_id)) {
|
|
679
|
+
const stopped = await stopContainer(docker.exec, container.container_id, STOP_TIMEOUT_SECONDS);
|
|
680
|
+
if (!stopped.confirmed) {
|
|
681
|
+
throw new AtomicCoreError('MANAGED_STOP_UNCONFIRMED', 'A container of this engine could not be confirmed stopped, so nothing was removed.', `${container.container_id}: ${stopped.reason}`);
|
|
682
|
+
}
|
|
683
|
+
await removeContainer(docker.exec, container.container_id);
|
|
684
|
+
await docker.journal.remove(container.container_id);
|
|
685
|
+
}
|
|
686
|
+
if (existing !== null) {
|
|
687
|
+
// No longer `ready` from here on (final review I-1): once the image may be gone, a record
|
|
688
|
+
// that still said `ready` would send every load to `docker create` for a missing image,
|
|
689
|
+
// and a step that fails below (a cache the user cannot delete) would leave it that way.
|
|
690
|
+
// `removing` refuses loads as "not ready" and keeps the removal retryable.
|
|
691
|
+
if (existing.installation.status !== 'removing') {
|
|
692
|
+
await deps.installations.write({
|
|
693
|
+
...existing,
|
|
694
|
+
installation: { ...existing.installation, status: 'removing' },
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
// Only the digest this installation pulled, and only when nobody else's container uses
|
|
698
|
+
// it — a foreign container keeps the image, and Docker would refuse anyway.
|
|
699
|
+
const users = await containersUsingImage(docker.exec, existing.image);
|
|
700
|
+
if (users.length === 0)
|
|
701
|
+
await removeImage(docker.exec, existing.image);
|
|
702
|
+
// The GPU-check image too, unless another installation recorded it or a container uses it.
|
|
703
|
+
const probe = existing.probe_image;
|
|
704
|
+
if (probe !== undefined) {
|
|
705
|
+
const others = (await deps.installations.list()).filter((entry) => entry.installation.installation_id !== target.installation_id &&
|
|
706
|
+
entry.probe_image?.digest === probe.digest);
|
|
707
|
+
if (others.length === 0 && (await containersUsingImage(docker.exec, probe)).length === 0) {
|
|
708
|
+
await removeImage(docker.exec, probe);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
const descriptorId = existing?.installation.active_descriptor_id ?? null;
|
|
714
|
+
if (descriptorId !== null)
|
|
715
|
+
await deps.removeEngineCaches(descriptorId);
|
|
716
|
+
if (record.request.retain_models === false &&
|
|
717
|
+
(await otherEngines(deps.installations, target)).length === 0) {
|
|
718
|
+
await deps.removeStoreModels();
|
|
719
|
+
}
|
|
720
|
+
await deps.installations.remove(target.installation_id);
|
|
721
|
+
}
|
|
722
|
+
finally {
|
|
723
|
+
hold.release?.();
|
|
724
|
+
}
|
|
725
|
+
},
|
|
726
|
+
async cleanup() {
|
|
727
|
+
// A cancelled setup created nothing that is its alone to undo: packages a host step installed
|
|
728
|
+
// stay (they changed the machine with consent), a partly pulled image is Docker's layer cache,
|
|
729
|
+
// and the installation record is only ever written by the last step.
|
|
730
|
+
},
|
|
731
|
+
inventory,
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
//# sourceMappingURL=linux-provisioner.js.map
|